/**
 * AKF Application Form — error / loading / success states.
 *
 * Layered on top of Webflow's form.contact_form markup. Selectors are scoped to
 * form.contact_form so nothing leaks to the rest of the site. Palette borrowed
 * from the popup itself (navy headings, coral CTA, off-white background).
 */

/* --- Top-of-form error banner ------------------------------------------------ */
form.contact_form .akf-form-banner {
	display: none;
	margin: 0 0 16px 0;
	padding: 12px 16px;
	border-radius: 8px;
	background: #fdecec;
	border: 1px solid #f3b9b6;
	color: #8a1f1a;
	font-size: 14px;
	line-height: 1.4;
}
form.contact_form.akf-form-banner-visible .akf-form-banner {
	display: block;
	animation: akfFormFadeSlide 180ms ease-out;
}

/* --- Inline field error message --------------------------------------------- */
form.contact_form .akf-field-error {
	display: block;
	min-height: 0;
	margin: 6px 0 0 0;
	color: #c0322c;
	font-size: 13px;
	line-height: 1.35;
}
form.contact_form .akf-field-error:empty {
	display: none;
}

/* --- Invalid input visual state --------------------------------------------- */
form.contact_form .akf-field-invalid .form_input,
form.contact_form .form_input[aria-invalid="true"] {
	border-color: #c0322c !important;
	box-shadow: 0 0 0 1px #c0322c inset;
}
form.contact_form .akf-field-invalid.w-checkbox .w-checkbox-input,
form.contact_form .akf-field-invalid .w-checkbox-input {
	border-color: #c0322c !important;
	box-shadow: 0 0 0 1px #c0322c inset;
}

/* --- Submit button busy state ----------------------------------------------- */
form.contact_form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
form.contact_form button[type="submit"][aria-busy="true"] {
	cursor: progress;
	opacity: 0.92;
}
form.contact_form button[type="submit"][aria-busy="true"] .akf-btn-label {
	opacity: 0.85;
}
form.contact_form .akf-btn-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.45);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: akfFormSpin 700ms linear infinite;
	flex-shrink: 0;
}

/* --- Success card ------------------------------------------------------------ */
form.contact_form .akf-form-success {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 12px;
	padding: 32px 24px;
	min-height: 240px;
}
form.contact_form.akf-form-done .akf-form-success {
	display: flex;
	animation: akfFormFadeSlide 220ms ease-out;
}
form.contact_form.akf-form-done .form-content-wrap,
form.contact_form.akf-form-done .akf-form-banner {
	display: none !important;
}
form.contact_form .akf-form-success-icon {
	color: #2eaa6a;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
}
form.contact_form .akf-form-success-icon svg {
	width: 56px;
	height: 56px;
	animation: akfFormSuccessPop 320ms cubic-bezier(.2, .9, .3, 1.2);
}
form.contact_form .akf-form-success-title {
	margin: 4px 0 0 0;
	font-size: 22px;
	font-weight: 700;
	color: #1d2257;
	line-height: 1.2;
}
form.contact_form .akf-form-success-body {
	margin: 0;
	font-size: 15px;
	color: #4a4f78;
	line-height: 1.5;
	max-width: 360px;
}

/* --- Animations --------------------------------------------------------------- */
@keyframes akfFormFadeSlide {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes akfFormSpin {
	to { transform: rotate(360deg); }
}
@keyframes akfFormSuccessPop {
	0%   { transform: scale(0.6); opacity: 0; }
	60%  { transform: scale(1.08); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

/* --- Mobile tightening -------------------------------------------------------- */
@media (max-width: 600px) {
	form.contact_form .akf-form-success {
		min-height: 200px;
		padding: 24px 16px;
	}
	form.contact_form .akf-form-success-title {
		font-size: 19px;
	}
	form.contact_form .akf-form-success-body {
		font-size: 14px;
	}
}

/* --- Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	form.contact_form .akf-form-banner,
	form.contact_form .akf-form-success,
	form.contact_form .akf-form-success-icon svg {
		animation: none !important;
	}
	form.contact_form .akf-btn-spinner {
		animation-duration: 1400ms;
	}
}
