/* =======================================================================
   A.N.I: Coded Forms (Callback + RFQ) : Premium Redesign
   Applies to:  .ani-form-wrap, .ani-form, and their children.
   Brand tokens from tokens.css (--ani-blue, --ani-ink, etc.).
   Button base from components.css (.btn, .btn--primary).
   RTL-safe: logical CSS only (inline-start/end, block-start/end).
   No hardcoded hex: all from tokens (translucent blue via rgba()).
   ======================================================================= */

/* ── Honeypot: visually hidden, removed from tab order via tabindex=-1 ── */
.ani-form__honeypot {
	position: absolute;
	inset-inline-start: -9999px;
	height: 1px;
	width: 1px;
	overflow: hidden;
	visibility: hidden;
}

/* ── Form wrapper ─────────────────────────────────────────────────────── */
.ani-form-wrap {
	width: 100%;
}

/* Card shell: white, same elevation as the contact details sidebar */
.ani-form {
	background: var(--ani-white);
	border: 1px solid var(--ani-border);
	border-radius: var(--ani-radius-card);
	padding-block: 44px;
	padding-inline: 44px;
	box-shadow: var(--ani-shadow-card);
}

/* ── Fieldset reset ───────────────────────────────────────────────────── */
.ani-form__fieldset {
	border: none;
	margin: 0;
	padding: 0;
	min-inline-size: 0;
}

/* ── Legend / heading block ───────────────────────────────────────────── */
.ani-form__legend {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--ani-ink);
	padding: 0;
	display: block;
	width: 100%;
	/* no margin-block-end: subtitle follows immediately */
}

.ani-form__subtitle {
	font-size: 0.97rem;
	color: var(--ani-muted);
	margin-block-start: 6px;
	margin-block-end: 36px;
	line-height: 1.6;
}

/* ── Two-column field grid ────────────────────────────────────────────── */
.ani-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 24px;
}

.ani-form__contact-hint {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--ani-muted);
	font-size: .86rem;
	line-height: 1.5;
}

/* Half-width pair (name+email / phone+service): natural 1 column each */
/* Full-width fields override to span the whole grid */
.ani-form__field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	grid-column: 1 / -1; /* default: full-width */
}

/* Only half-width fields shrink to one column */
.ani-form__field--half {
	grid-column: span 1;
}

/* ── Label ────────────────────────────────────────────────────────────── */
.ani-form__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ani-ink);
	display: flex;
	align-items: baseline;
	gap: 4px;
	cursor: pointer;
}

/* Required asterisk */
.ani-form__required {
	color: var(--ani-blue);
	font-weight: 800;
	font-size: 1em;
	line-height: 1;
}

/* Optional tag */
.ani-form__optional {
	font-size: 0.78rem;
	font-weight: 400;
	color: var(--ani-muted);
}

/* ── Input, select, textarea: filled style ───────────────────────────── */
.ani-form__input,
.ani-form__select,
.ani-form__textarea {
	font-family: var(--ani-font);
	font-size: 0.97rem;
	color: var(--ani-ink);
	background: var(--ani-surface);
	border: 1.5px solid var(--ani-border);
	border-radius: var(--ani-radius-btn);
	padding-block: 13px;
	padding-inline: 16px;
	width: 100%;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
}

/* Placeholder: quiet, not competing with real text */
.ani-form__input::placeholder,
.ani-form__textarea::placeholder {
	color: var(--ani-muted);
	opacity: 1;
}

/* Hover: signal interactivity */
.ani-form__input:hover:not(:focus),
.ani-form__select:hover:not(:focus),
.ani-form__textarea:hover:not(:focus) {
	border-color: var(--ani-muted);
	background: var(--ani-blueprint);
}

/* Select chevron: logical, RTL auto-flips */
.ani-form__select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23798AA1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 12px center;
	padding-inline-end: 40px;
	cursor: pointer;
}

/* For RTL, chevron sits at the inline-end (visual left) */
[dir="rtl"] .ani-form__select {
	background-position: right 12px center;
}

/* Focus ring: white background + brand-blue ring */
.ani-form__input:focus,
.ani-form__select:focus,
.ani-form__textarea:focus,
.ani-form__input:focus-visible,
.ani-form__select:focus-visible,
.ani-form__textarea:focus-visible {
	border-color: var(--ani-blue);
	box-shadow: 0 0 0 4px rgba(31, 109, 255, 0.14);
	background: var(--ani-white);
	outline: none;
}

/* Error state */
.ani-form__input[aria-invalid="true"],
.ani-form__select[aria-invalid="true"],
.ani-form__textarea[aria-invalid="true"] {
	border-color: #c0392b;
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10);
}

/* LTR isolation for email / phone / url inside RTL layout */
.ani-form__input--ltr {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: start;
}

/* Textarea */
.ani-form__textarea {
	resize: vertical;
	min-block-size: 130px;
}

/* ── Hint text ────────────────────────────────────────────────────────── */
.ani-form__hint {
	font-size: 0.8rem;
	color: var(--ani-muted);
	margin: 0;
	line-height: 1.5;
}

/* ── Error message ────────────────────────────────────────────────────── */
.ani-form__error {
	font-size: 0.82rem;
	color: #c0392b;
	font-weight: 500;
	min-block-size: 1.2em;
	display: block;
}

.ani-form__error:empty {
	min-block-size: 0;
}

/* ── Checkbox field ───────────────────────────────────────────────────── */
.ani-form__field--checkbox {
	gap: 6px;
}

.ani-form__checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--ani-body);
	line-height: 1.55;
}

.ani-form__checkbox {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-block-start: 2px;
	accent-color: var(--ani-blue);
	cursor: pointer;
}

.ani-form__checkbox:focus-visible {
	outline: 3px solid var(--ani-blue);
	outline-offset: 2px;
	border-radius: 3px;
}

.ani-form__checkbox-text a {
	color: var(--ani-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ani-form__checkbox-text a:hover {
	color: var(--ani-blue-deep);
}

/* ── File upload zone: prominent + inviting ──────────────────────────── */
.ani-form__upload-zone {
	position: relative;
	border: 2px dashed var(--ani-border);
	border-radius: var(--ani-radius-card);
	background: var(--ani-surface);
	padding-block: 36px;
	padding-inline: 24px;
	text-align: center;
	transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
	cursor: pointer;
}

/* Drag-over / hover state: brand-blue tint */
.ani-form__upload-zone:hover,
.ani-form__upload-zone.is-dragover {
	border-color: var(--ani-blue);
	border-style: solid;
	background: rgba(31, 109, 255, 0.05);
	box-shadow: 0 0 0 4px rgba(31, 109, 255, 0.08);
}

/* Keyboard focus */
.ani-form__upload-zone:focus-within {
	border-color: var(--ani-blue);
	border-style: solid;
	background: rgba(31, 109, 255, 0.07);
	box-shadow: 0 0 0 4px rgba(31, 109, 255, 0.14);
}

/* Hide native file input, keep keyboard-accessible */
.ani-form__file {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.ani-form__upload-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	pointer-events: none;
	color: var(--ani-muted);
}

/* Icon chip: brand-blue circle */
.ani-form__upload-icon-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(31, 109, 255, 0.12);
	color: var(--ani-blue);
	flex-shrink: 0;
	transition: background 0.18s ease, transform 0.18s ease;
}

.ani-form__upload-zone:hover .ani-form__upload-icon-chip,
.ani-form__upload-zone.is-dragover .ani-form__upload-icon-chip {
	background: rgba(31, 109, 255, 0.18);
	transform: translateY(-2px);
}

.ani-form__upload-cta {
	font-size: 0.97rem;
	font-weight: 700;
	color: var(--ani-ink);
}

.ani-form__upload-cta em {
	font-style: normal;
	color: var(--ani-blue);
}

.ani-form__upload-formats {
	font-size: 0.78rem;
	color: var(--ani-muted);
	direction: ltr;
	unicode-bidi: isolate;
}

/* File list: populated by JS */
.ani-form__file-list {
	margin-block-start: 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: start;
}

.ani-form__file-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.84rem;
	color: var(--ani-body);
	padding-block: 6px;
	padding-inline: 12px;
	background: var(--ani-white);
	border-radius: 6px;
	border: 1px solid var(--ani-border);
}

.ani-form__file-item--error {
	color: #c0392b;
	border-color: rgba(192, 57, 43, 0.35);
	background: rgba(192, 57, 43, 0.05);
}

/* ── Submit button area ───────────────────────────────────────────────── */
.ani-form__field--submit {
	margin-block-start: 8px;
}

.ani-form__submit {
	width: 100%;
	padding-block: 17px;
	font-size: 1.05rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

/* Arrow icon inside submit */
.ani-form__submit-arrow {
	flex-shrink: 0;
	transition: transform 0.18s ease;
}

/* Flip arrow for RTL (points toward inline-start) */
[dir="rtl"] .ani-form__submit-arrow {
	transform: scaleX(-1);
}

/* Hello Elementor specificity fix: see comment in original file */
.ani-form__submit.btn--primary {
	background: var(--ani-blue);
	border-color: transparent;
	box-shadow: 0 6px 20px rgba(31, 109, 255, 0.24);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.ani-form__submit.btn--primary:hover {
	background: var(--ani-blue-deep);
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(31, 109, 255, 0.30);
}

.ani-form__submit.btn--primary:hover .ani-form__submit-arrow {
	transform: translateX(3px);
}

[dir="rtl"] .ani-form__submit.btn--primary:hover .ani-form__submit-arrow {
	transform: scaleX(-1) translateX(3px);
}

.ani-form__submit.btn--primary:focus-visible {
	outline: 3px solid var(--ani-blue);
	outline-offset: 3px;
}

.ani-form__submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none;
}

/* ── Notice banners (success / error) ────────────────────────────────── */
.ani-form-notice {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding-block: 20px;
	padding-inline: 22px;
	border-radius: var(--ani-radius-btn);
	font-size: 0.97rem;
	font-weight: 500;
	line-height: 1.6;
	margin-block-end: 24px;
}

.ani-form-notice:focus,
.ani-form-notice:focus-visible {
	outline: 3px solid var(--ani-blue);
	outline-offset: 2px;
}

.ani-form-notice__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	flex-shrink: 0;
}

.ani-form-notice--success {
	background: rgba(31, 109, 255, 0.06);
	border: 1px solid rgba(31, 109, 255, 0.22);
	border-inline-start: 4px solid var(--ani-blue);
	color: var(--ani-ink);
}

.ani-form-notice--success .ani-form-notice__icon {
	background: rgba(31, 109, 255, 0.12);
	color: var(--ani-blue);
}

.ani-form-notice--success svg {
	color: var(--ani-blue);
	flex-shrink: 0;
	margin-block-start: 1px;
}

.ani-form-notice--error {
	background: rgba(192, 57, 43, 0.06);
	border: 1px solid rgba(192, 57, 43, 0.25);
	border-inline-start: 4px solid #c0392b;
	color: #7b1f1f;
}

.ani-form-notice--pending {
	background: var(--ani-white);
	border: 1px solid var(--ani-border);
	border-inline-start: 4px solid var(--ani-blue);
	color: var(--ani-ink);
	box-shadow: var(--ani-shadow-card);
}

.ani-form-notice--pending strong {
	display: block;
	font-size: 1.05rem;
}

.ani-form-notice--pending p {
	margin-block: 6px 0;
	color: var(--ani-body);
}

.ani-form-unavailable__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-block-start: 18px;
}

.ani-form-unavailable__actions .ani-btn {
	justify-content: center;
	min-block-size: 46px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

/* Tablet: single column, keep card padding */
@media (max-width: 720px) {
	.ani-form__grid {
		grid-template-columns: 1fr;
	}

	.ani-form__field--half {
		grid-column: 1 / -1;
	}
}

/* Mobile: reduce card padding */
@media (max-width: 640px) {
	.ani-form {
		padding-block: 28px;
		padding-inline: 20px;
	}

	.ani-form__legend {
		font-size: 1.25rem;
	}

	.ani-form__input,
	.ani-form__select,
	.ani-form__textarea {
		font-size: 1rem; /* prevent iOS auto-zoom (>=16px effective) */
	}
	.ani-form-unavailable__actions .ani-btn {
		inline-size: 100%;
	}
}
