/**
 * Andaf Elementor Widgets — style frontend.
 * Semua nilai memakai custom property agar mudah ditimpa dari tema/kit Elementor.
 */

.elementor-widget-andaf-ocr-extractor,
.elementor-widget-andaf-hero-cta,
.elementor-widget-andaf-info-card,
.elementor-widget-andaf-stat-counter,
.elementor-widget-andaf-faq-accordion {
	--andaf-ink: #101820;
	--andaf-muted: #5c6a72;
	--andaf-surface: #ffffff;
	--andaf-accent: #0f6f5c;
	--andaf-accent-soft: #e6f2ee;
	--andaf-line: #e0e6e4;
	--andaf-radius: 14px;
	--andaf-speed: 220ms;
}

/* -----------------------------------------------------------------
 * Tombol bersama
 * ----------------------------------------------------------------- */
.andaf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color var(--andaf-speed) ease, color var(--andaf-speed) ease, transform var(--andaf-speed) ease;
}

.andaf-btn:focus-visible {
	outline: 2px solid var(--andaf-accent);
	outline-offset: 3px;
}

.andaf-btn--primary {
	background-color: var(--andaf-accent);
	color: #ffffff;
}

.andaf-btn--primary:hover,
.andaf-btn--primary:focus {
	background-color: var(--andaf-ink);
	color: #ffffff;
	transform: translateY(-1px);
}

.andaf-btn--ghost {
	background-color: transparent;
	border-color: var(--andaf-line);
	color: var(--andaf-ink);
}

.andaf-btn--ghost:hover,
.andaf-btn--ghost:focus {
	border-color: var(--andaf-accent);
	color: var(--andaf-accent);
}

/* -----------------------------------------------------------------
 * Hero CTA
 * ----------------------------------------------------------------- */
.andaf-hero {
	background-color: var(--andaf-surface);
	border-radius: var(--andaf-radius);
	color: var(--andaf-ink);
}

.andaf-hero__badge {
	display: inline-block;
	margin-bottom: 16px;
	padding: 6px 14px;
	border: 1px solid var(--andaf-accent);
	border-radius: 999px;
	color: var(--andaf-accent);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.andaf-hero__title {
	margin: 0 0 14px;
	font-size: clamp(28px, 4vw, 46px);
	line-height: 1.15;
}

.andaf-hero__desc {
	margin: 0;
	max-width: 60ch;
	color: var(--andaf-muted);
	font-size: 17px;
	line-height: 1.65;
}

.andaf-hero[style*="text-align: center"] .andaf-hero__desc,
.andaf-hero[style*="text-align:center"] .andaf-hero__desc {
	margin-inline: auto;
}

.andaf-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
	justify-content: inherit;
}

.andaf-hero {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.andaf-hero[style*="text-align: center"],
.andaf-hero[style*="text-align:center"] {
	align-items: center;
}

.andaf-hero[style*="text-align: right"],
.andaf-hero[style*="text-align:right"] {
	align-items: flex-end;
}

/* -----------------------------------------------------------------
 * Info Card
 * ----------------------------------------------------------------- */
.andaf-card {
	position: relative;
	display: flex;
	gap: 18px;
	background-color: var(--andaf-surface);
	border: 1px solid var(--andaf-line);
	border-radius: var(--andaf-radius);
	color: var(--andaf-ink);
	transition: transform var(--andaf-speed) ease, box-shadow var(--andaf-speed) ease, border-color var(--andaf-speed) ease;
	height: 100%;
}

.andaf-card--top {
	flex-direction: column;
	align-items: flex-start;
}

.andaf-card--left {
	flex-direction: row;
	align-items: flex-start;
}

.andaf-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.2em;
	height: 2.2em;
	background-color: var(--andaf-accent-soft);
	border-radius: 12px;
	color: var(--andaf-accent);
	font-size: 26px;
}

.andaf-card__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.andaf-card__body {
	min-width: 0;
}

.andaf-card__title {
	margin: 0 0 8px;
	font-size: 20px;
	line-height: 1.3;
}

.andaf-card__desc {
	margin: 0;
	color: var(--andaf-muted);
	line-height: 1.65;
}

.andaf-card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	color: var(--andaf-accent);
	font-weight: 600;
	text-decoration: none;
}

.andaf-card__arrow {
	transition: transform var(--andaf-speed) ease;
}

.andaf-card__link:hover .andaf-card__arrow {
	transform: translateX(4px);
}

.andaf-card--lift:hover {
	transform: translateY(-4px);
	border-color: var(--andaf-accent);
	box-shadow: 0 14px 30px rgba(16, 24, 32, 0.09);
}

/* Seluruh kartu dapat diklik: link diperluas memakai pseudo-element. */
.andaf-card--clickable .andaf-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* -----------------------------------------------------------------
 * Stat Counter
 * ----------------------------------------------------------------- */
.andaf-counter__number {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 2px;
	color: var(--andaf-ink);
	font-size: clamp(34px, 5vw, 52px);
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.andaf-counter[style*="text-align: left"] .andaf-counter__number,
.andaf-counter[style*="text-align:left"] .andaf-counter__number {
	justify-content: flex-start;
}

.andaf-counter[style*="text-align: right"] .andaf-counter__number,
.andaf-counter[style*="text-align:right"] .andaf-counter__number {
	justify-content: flex-end;
}

.andaf-counter__prefix,
.andaf-counter__suffix {
	color: var(--andaf-accent);
}

.andaf-counter__label {
	margin-top: 6px;
	color: var(--andaf-muted);
	font-size: 15px;
	letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------
 * FAQ Accordion
 * ----------------------------------------------------------------- */
.andaf-faq {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.andaf-faq__item {
	background-color: var(--andaf-surface);
	border: 1px solid var(--andaf-line);
	border-radius: var(--andaf-radius);
	overflow: hidden;
	transition: border-color var(--andaf-speed) ease;
}

.andaf-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 18px 20px;
	background: none;
	border: 0;
	color: var(--andaf-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: 17px;
	font-weight: 600;
	text-align: left;
	line-height: 1.4;
}

.andaf-faq__question:focus-visible {
	outline: 2px solid var(--andaf-accent);
	outline-offset: -2px;
}

.andaf-faq__toggle {
	position: relative;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--andaf-accent);
}

.andaf-faq__toggle::before,
.andaf-faq__toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	background-color: currentColor;
	transform: translate(-50%, -50%);
	transition: transform var(--andaf-speed) ease, opacity var(--andaf-speed) ease;
}

.andaf-faq__toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.andaf-faq__item.is-open .andaf-faq__toggle::after {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(0deg);
}

.andaf-faq__panel {
	padding: 0 20px 18px;
}

.andaf-faq__panel[hidden] {
	display: none;
}

.andaf-faq__answer {
	color: var(--andaf-muted);
	line-height: 1.7;
}

.andaf-faq__answer > *:first-child {
	margin-top: 0;
}

.andaf-faq__answer > *:last-child {
	margin-bottom: 0;
}

/* -----------------------------------------------------------------
 * Responsif & aksesibilitas
 * ----------------------------------------------------------------- */
@media (max-width: 767px) {
	.andaf-card--left {
		flex-direction: column;
	}

	.andaf-hero__actions .andaf-btn {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.andaf-btn,
	.andaf-card,
	.andaf-card__arrow,
	.andaf-faq__item,
	.andaf-faq__toggle::before,
	.andaf-faq__toggle::after {
		transition: none;
	}
}


/* -----------------------------------------------------------------
 * OCR Extractor
 * ----------------------------------------------------------------- */
.andaf-ocr {
	background-color: var(--andaf-surface);
	border-radius: var(--andaf-radius);
	color: var(--andaf-ink);
}

.andaf-ocr__head {
	margin-bottom: 18px;
}

.andaf-ocr__title {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.3;
}

.andaf-ocr__subtitle {
	margin: 0;
	color: var(--andaf-muted);
	line-height: 1.6;
}

.andaf-ocr__dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 190px;
	padding: 24px;
	background-color: #fafcfb;
	border: 2px dashed var(--andaf-line);
	border-radius: 12px;
	cursor: pointer;
	text-align: center;
	transition: background-color var(--andaf-speed) ease, border-color var(--andaf-speed) ease;
}

.andaf-ocr__dropzone:focus-visible {
	outline: 2px solid var(--andaf-accent);
	outline-offset: 3px;
}

.andaf-ocr__dropzone.is-dragover {
	background-color: var(--andaf-accent-soft);
	border-color: var(--andaf-accent);
}

.andaf-ocr__dz-icon svg {
	width: 40px;
	height: 40px;
	color: var(--andaf-accent);
}

.andaf-ocr__dz-text {
	font-size: 17px;
	font-weight: 600;
}

.andaf-ocr__dz-hint {
	color: var(--andaf-muted);
	font-size: 13px;
}

.andaf-ocr__browse {
	margin-top: 8px;
	pointer-events: none;
}

.andaf-ocr__progress {
	margin-top: 16px;
}

.andaf-ocr__bar {
	height: 6px;
	background-color: var(--andaf-line);
	border-radius: 999px;
	overflow: hidden;
}

.andaf-ocr__bar span {
	display: block;
	width: 0;
	height: 100%;
	background-color: var(--andaf-accent);
	border-radius: inherit;
	transition: width 180ms linear;
}

.andaf-ocr__status {
	margin: 8px 0 0;
	color: var(--andaf-muted);
	font-size: 13px;
}

.andaf-ocr__status.is-error {
	color: #b32d2e;
}

.andaf-ocr__files {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.andaf-ocr__file {
	width: 92px;
	margin: 0;
}

.andaf-ocr__file img {
	display: block;
	width: 92px;
	height: 72px;
	border: 1px solid var(--andaf-line);
	border-radius: 8px;
	object-fit: cover;
}

.andaf-ocr__file figcaption {
	margin-top: 4px;
	color: var(--andaf-muted);
	font-size: 11px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.andaf-ocr__result {
	margin-top: 20px;
}

.andaf-ocr__result-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.andaf-ocr__result-title {
	margin: 0;
	font-size: 16px;
}

.andaf-ocr__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.andaf-ocr__actions .andaf-btn {
	padding: 8px 16px;
	font-size: 13px;
}

.andaf-ocr__text {
	max-height: 320px;
	padding: 16px;
	background-color: #f7faf9;
	border: 1px solid var(--andaf-line);
	border-radius: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px;
	line-height: 1.7;
	overflow: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

.andaf-ocr__text:focus-visible {
	outline: 2px solid var(--andaf-accent);
	outline-offset: 2px;
}

.andaf-ocr__data {
	margin-top: 14px;
}

.andaf-ocr__table-wrap {
	overflow-x: auto;
}

.andaf-ocr__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.andaf-ocr__table th,
.andaf-ocr__table td {
	padding: 10px 12px;
	border: 1px solid var(--andaf-line);
	vertical-align: top;
	word-break: break-word;
}

.andaf-ocr__table thead th {
	background-color: var(--andaf-accent-soft);
	color: var(--andaf-ink);
	font-weight: 600;
}

.andaf-ocr__nodata {
	margin: 0;
	color: var(--andaf-muted);
	font-size: 14px;
}

@media (max-width: 767px) {
	.andaf-ocr__actions {
		width: 100%;
	}

	.andaf-ocr__actions .andaf-btn {
		flex: 1 1 auto;
	}
}

/* -----------------------------------------------------------------
 * Widget dinamis
 * ----------------------------------------------------------------- */
.andaf-dyn__error {
	padding: 12px 14px;
	background: #fcf0f1;
	border: 1px solid #e6b3b4;
	border-radius: 8px;
	color: #b32d2e;
	font-size: 13px;
	line-height: 1.6;
}
