/* =====================================================================
   S4D Forms — front-end styles (mirrors the design handoff form card)
   ===================================================================== */
.s4d-formwrap {
	--s4d-blue: #136EF6;
	--s4d-blue-hover: #0B4FC0;
	--s4d-navy: #0B1B3A;
	--s4d-ink-600: #4A5468;
	--s4d-ink-400: #7A8496;
	--s4d-border-form: #D5DDEA;
	font-family: 'Archivo', Helvetica, Arial, sans-serif;
}

.s4d-formwrap--card,
.s4d-formwrap--labelless {
	background: #fff;
	border: 1px solid #DDE4F0;
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(11,27,58,0.10);
	overflow: hidden;
	max-width: 460px;
}

.s4d-form__header {
	background: var(--s4d-navy);
	color: #fff;
	padding: clamp(16px, 1.8vw, 22px) clamp(18px, 2vw, 28px);
}
.s4d-form__title { font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; margin: 0; color: #fff; }
.s4d-form__subtitle { font-size: 13px; color: #9FB2D4; margin: 6px 0 0; }

.s4d-form {
	padding: clamp(18px, 2vw, 26px);
}
.s4d-formwrap--hero .s4d-form { padding: 0; }

.s4d-form__hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Progress */
.s4d-form__progress {
	list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 8px; align-items: center;
}
.s4d-form__progress-step {
	width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 800; color: var(--s4d-ink-400); background: #EEF2FA; border: 1px solid #DDE4F0;
}
.s4d-form__progress-step.is-active { background: var(--s4d-blue); color: #fff; border-color: var(--s4d-blue); }

/* Steps */
.s4d-form__step { border: 0; margin: 0; padding: 0; min-width: 0; }
.s4d-form__step:not(.is-active) { display: none; }
.s4d-form__grid {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(11px, 1.1vw, 14px);
}
.s4d-field { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; min-width: 0; }
.s4d-field--half { grid-column: span 1; }
@media (max-width: 380px) { .s4d-field--half { grid-column: span 2; } }

.s4d-field__label { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--s4d-ink-600); }
.s4d-req { color: var(--s4d-blue); }

.s4d-field__input {
	width: 100%; box-sizing: border-box; min-height: 44px; padding: 13px; font-size: 15px;
	font-family: inherit; color: #101114; background: #fff; border: 1px solid var(--s4d-border-form); border-radius: 7px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.s4d-field__input:focus { outline: none; border-color: var(--s4d-blue); box-shadow: 0 0 0 3px rgba(19,110,246,0.15); }
select.s4d-field__input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6478' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

/* Radios */
.s4d-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.s4d-radio { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--s4d-border-form); border-radius: 7px; cursor: pointer; font-size: 15px; }
.s4d-radio input { accent-color: var(--s4d-blue); }
.s4d-radio:has(input:checked) { border-color: var(--s4d-blue); box-shadow: 0 0 0 2px rgba(19,110,246,0.14); }

/* Checkboxes */
.s4d-checks { display: flex; flex-direction: column; gap: 8px; }
.s4d-check { display: flex; align-items: center; gap: 8px; font-size: 15px; }

/* Consent */
.s4d-field--consent { grid-column: span 2; }
/* The label wraps the box, so the whole row is the tap target; it is kept at
   least 44px tall so a thumb never misses. */
.s4d-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--s4d-ink-400); line-height: 1.5; cursor: pointer; min-height: 44px; padding: 3px 0; }
.s4d-consent input { margin-top: 1px; accent-color: var(--s4d-blue); width: 20px; height: 20px; min-width: 20px; min-height: 20px; flex: none; cursor: pointer; }
.s4d-consent__text a { color: #5A6478; text-decoration: underline; }
.s4d-consent-notice { margin: 0; font-size: 12px; color: var(--s4d-ink-400); line-height: 1.5; }
.s4d-consent-notice a { color: #5A6478; text-decoration: underline; }

/* Nav + submit */
.s4d-form__nav { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.s4d-form__back { background: none; border: 1px solid var(--s4d-border-form); color: var(--s4d-navy); border-radius: 7px; padding: 14px 20px; font-weight: 700; font-size: 15px; cursor: pointer; min-height: 44px; }
.s4d-form__back:hover { background: #F4F7FD; }
.s4d-form__next, .s4d-form__submit {
	flex: 1; background: var(--s4d-blue); color: #fff; border: 0; border-radius: 7px;
	padding: 16px 20px; font-weight: 800; font-size: clamp(15px, 1vw, 17px); cursor: pointer; min-height: 44px;
	transition: background-color .15s ease, transform .08s ease; font-family: inherit;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.s4d-form__next:hover, .s4d-form__submit:hover { background: var(--s4d-blue-hover); }
/* Pressed state: a tap is acknowledged the instant it lands. */
.s4d-form__next:active, .s4d-form__submit:active, .s4d-form__back:active { transform: translateY(1px) scale(.98); filter: brightness(.92); }
/* In flight: disabled, "Sending…" (forms.js) and a spinner. */
.s4d-form__submit.is-loading { opacity: .8; cursor: progress; }
.s4d-form__submit.is-loading::after {
	content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
	animation: s4d-form-spin .7s linear infinite;
}
@keyframes s4d-form-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.s4d-form__next:active, .s4d-form__submit:active, .s4d-form__back:active { transform: none; }
}

/* Errors + messages */
.s4d-field--error .s4d-field__input { border-color: #C0392B; box-shadow: 0 0 0 3px rgba(192,57,43,0.12); }
.s4d-field__error { color: #C0392B; font-size: 12px; }
.s4d-field__help { color: #5A6478; font-size: 12px; line-height: 1.45; }
.s4d-form__message { margin-top: 14px; padding: 12px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; }
.s4d-form__message--success { background: #E9F4EC; border: 1px solid #BEDFC8; color: #1C5E32; }
.s4d-form__message--error { background: #FDECEA; border: 1px solid #F5C6C0; color: #A93226; }

/* Calendar */
.s4d-calendar { width: 100%; }
.s4d-calendar iframe { width: 100%; border: 0; display: block; }

/* Editor preview cards */
.s4d-block-preview { border: 1px dashed #B7C4DC; border-radius: 12px; padding: 20px; background: #F7F9FE; text-align: center; }
.s4d-block-preview__badge { display: inline-block; background: #0B1B3A; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; border-radius: 4px; }
.s4d-block-preview__note { font-weight: 700; color: #0B1B3A; margin: 12px 0 4px; }
.s4d-block-preview__meta { font-size: 12px; color: #5A6478; margin: 0; }

/* A show_if field (forms 1.2.0) ships with the hidden attribute and forms.js
   toggles it; this keeps `hidden` winning over the display rule above. */
.s4d-field--cond[hidden] { display: none !important; }
