/**
 * Super5 Forms — front-end styles.
 * Palette and component rules follow DESIGNER.md (calm-corporate: navy + orange,
 * 8px radius, 1.5px borders, navy focus ring). Fonts inherit from the theme
 * (Manrope) so the plugin never loads its own webfonts.
 */

.s5f-form {
	--s5f-navy: #12375b;
	--s5f-ink: #14263d;
	--s5f-muted: #5b6b7a;
	--s5f-line: #e2e8ee;
	--s5f-placeholder: #9aa7b3;
	--s5f-surface: #ffffff;
	--s5f-cta: #fb4a26;
	--s5f-cta-hover: #d33e20;
	--s5f-accent: #fb4a26;
	--s5f-success: #1f7a4d;
	--s5f-success-bg: #eaf5ef;
	--s5f-error: #c0392b;

	box-sizing: border-box;
	width: 100%;
	color: var(--s5f-ink);
	font-family: inherit;
	line-height: 1.55;
}

.s5f-form *,
.s5f-form *::before,
.s5f-form *::after {
	box-sizing: border-box;
}

/* The [hidden] attribute must win over component display rules (e.g. the
   success box's display:flex), otherwise it shows before submission. */
.s5f-form [hidden] {
	display: none !important;
}

.s5f-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.s5f-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.s5f-label {
	font-size: 16px;
	font-weight: 600;
	color: var(--s5f-ink);
}

.s5f-req {
	color: var(--s5f-accent);
}

/* Field box. Scoped under `.s5f-form` (two classes) so it outweighs Hello
   Elementor's parent-theme rule for bare `input[type="text|tel|email|…"]`,
   `select` and `textarea` (1px #666 border, 3px radius, .5rem padding): a lone
   `.s5f-input` class lost to that `input[type=…]` selector on text inputs while
   the <select> kept ours, so fields looked mismatched (different border colour,
   radius, padding). The modifier/state rules that establish the box below
   (`--select`, `--consent`) are scoped the same way to keep their cascade. */
.s5f-form .s5f-input {
	width: 100%;
	padding: 13px 14px;
	font-family: inherit;
	font-size: 16px;
	color: var(--s5f-ink);
	background: var(--s5f-surface);
	border: 1.5px solid var(--s5f-line);
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
}

.s5f-input::placeholder {
	color: var(--s5f-placeholder);
}

.s5f-input:focus,
.s5f-input:focus-visible {
	outline: none;
	border-color: var(--s5f-navy);
	box-shadow: 0 0 0 3px rgba(18, 55, 91, 0.18);
}

.s5f-input--textarea {
	min-height: 96px;
	resize: vertical;
}

/* Dropdown (select) — .s5f-input strips the native arrow (appearance:none), so
   draw a chevron and leave room for it. */
.s5f-select-wrap {
	position: relative;
}

.s5f-form .s5f-input--select {
	padding-right: 42px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7a' stroke-width='2.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: right 14px center;
	background-size: 18px 18px;
}

/* The <select> placeholder is its empty first <option>; when it's selected the
   closed control shows that option in the select's own `color`, so grey it to
   match the input ::placeholder. Real options stay ink (open list stays legible),
   and the colour reverts to ink once a real option is chosen. */
.s5f-form .s5f-input--select:has(option[value=""]:checked) {
	color: var(--s5f-placeholder);
}

.s5f-form .s5f-input--select option {
	color: var(--s5f-ink);
}

/* Choice / city buttons — the tap-to-select interaction. */
.s5f-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.s5f-choice {
	padding: 10px 16px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--s5f-navy);
	background: var(--s5f-surface);
	border: 1.5px solid var(--s5f-line);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.s5f-choice:hover {
	border-color: var(--s5f-navy);
}

.s5f-choice[aria-checked="true"] {
	background: var(--s5f-navy);
	border-color: var(--s5f-navy);
	color: #fff;
}

/* File / photo upload */
.s5f-file {
	display: block;
	cursor: pointer;
}

.s5f-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.s5f-file__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--s5f-navy);
	background: var(--s5f-surface);
	border: 1.5px dashed var(--s5f-line);
	border-radius: 8px;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.s5f-file:hover .s5f-file__btn {
	border-color: var(--s5f-navy);
}

.s5f-file-input:focus-visible + .s5f-file__btn {
	border-color: var(--s5f-navy);
	box-shadow: 0 0 0 3px rgba(18, 55, 91, 0.18);
}

.s5f-file__status {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	font-size: 14px;
	color: var(--s5f-ink);
}

.s5f-file__name {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 70%;
}

.s5f-file__remove {
	font-family: inherit;
	font-size: 13px;
	color: var(--s5f-error);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

/* Consent */
.s5f-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14.5px;
	color: var(--s5f-muted);
	cursor: pointer;
}

/* Compact custom checkbox — .s5f-input forces appearance:none (killing the
   native tick), so we draw our own box + checkmark and fill it on :checked. */
.s5f-form .s5f-input--consent {
	appearance: none;
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	min-width: 16px;
	padding: 0;
	margin: 2px 0 0;
	flex: 0 0 auto;
	border: 1.5px solid var(--s5f-line);
	border-radius: 4px;
	background: var(--s5f-surface);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.s5f-input--consent:checked {
	background-color: var(--s5f-cta);
	border-color: var(--s5f-cta);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	background-size: 11px 11px;
	background-position: center;
	background-repeat: no-repeat;
}

.s5f-input--consent:focus-visible {
	outline: none;
	border-color: var(--s5f-cta);
	box-shadow: 0 0 0 3px rgba(251, 74, 38, 0.2);
}

.s5f-consent__text {
	line-height: 1.45;
}

.s5f-help {
	font-size: 13.5px;
	color: var(--s5f-muted);
}

/* Error state */
.s5f-error {
	display: none;
	font-size: 13.5px;
	color: var(--s5f-error);
}

.s5f-field--invalid .s5f-error {
	display: block;
}

.s5f-field--invalid .s5f-input {
	border-color: var(--s5f-error);
}

.s5f-field--invalid .s5f-input:focus {
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}

/* Submit — the single primary CTA */
.s5f-submit-wrap {
	margin-top: 18px;
}

.s5f-submit {
	width: 100%;
	padding: 15px 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: var(--s5f-cta);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.s5f-submit:hover {
	background: var(--s5f-cta-hover);
}

.s5f-submit:disabled {
	opacity: 0.75;
	cursor: default;
}

.s5f-submit.is-loading .s5f-submit__label {
	opacity: 0.85;
}

/* Form-level status (non-field errors) */
.s5f-form__status {
	display: none;
	margin-top: 12px;
	padding: 12px 14px;
	font-size: 14.5px;
	border-radius: 8px;
	background: #fbecea;
	color: var(--s5f-error);
	border: 1px solid #eccbc7;
}

.s5f-form__status.is-visible {
	display: block;
}

/* Success box */
.s5f-success {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px;
	background: var(--s5f-success-bg);
	border: 1px solid #cfe6da;
	border-radius: 8px;
	color: #14503a;
}

.s5f-success__icon {
	flex: 0 0 auto;
	display: inline-flex;
	color: var(--s5f-success);
	margin-top: 1px;
}

.s5f-success__text {
	margin: 0;
	font-size: 15.5px;
	font-weight: 600;
}

/* ── Conversational mode ─────────────────────────────────────────────
   One screen per step. A step (.s5f-step) holds one or more fields — e.g.
   phone + email + consent share the final screen. Hiding is gated on
   .s5f-conv-ready (added by JS), so if JS never runs the form degrades to a
   normal stacked layout. */
.s5f-step {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.s5f-conv-ready .s5f-fields {
	gap: 0;
}

.s5f-conv-ready .s5f-step {
	display: none;
}

.s5f-conv-ready .s5f-step.is-active {
	display: flex;
	animation: s5f-step-in 0.25s ease;
}

/* Conversational choices: a 2-column grid of option cards (keeps the tallest
   step compact so the locked card height stays reasonable). Collapses to a
   single column on phones. An odd final option spans the full width. */
.s5f-mode-conversational .s5f-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.s5f-mode-conversational .s5f-choice {
	width: 100%;
	text-align: left;
	padding: 14px 16px;
}

.s5f-mode-conversational .s5f-choice:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

@media (max-width: 560px) {
	.s5f-mode-conversational .s5f-choices {
		grid-template-columns: 1fr;
	}
}

/* Locked step height: JS sets a min-height on .s5f-fields equal to the tallest
   step so the card never resizes between steps (no layout shift). */

@keyframes s5f-step-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.s5f-progress {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.s5f-progress__track {
	flex: 1;
	height: 6px;
	background: var(--s5f-line);
	border-radius: 99px;
	overflow: hidden;
}

.s5f-progress__fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--s5f-navy);
	border-radius: 99px;
	transition: width 0.3s ease;
}

.s5f-progress__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--s5f-muted);
	font-variant-numeric: tabular-nums;
}

.s5f-nav {
	display: flex;
	gap: 10px;
	margin-top: 18px;
}

.s5f-nav__back {
	padding: 13px 20px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var(--s5f-navy);
	background: #fff;
	border: 1.5px solid var(--s5f-line);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.s5f-nav__back:hover {
	border-color: var(--s5f-navy);
}

.s5f-nav__next {
	flex: 1;
	padding: 13px 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: var(--s5f-navy);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.s5f-nav__next:hover {
	background: #0e2b47;
}

/* The submit button, relocated into the nav row on the last step, behaves like
   Next (fills the remaining width beside Back) instead of a full-width block. */
.s5f-nav .s5f-nav__submit {
	flex: 1;
	width: auto;
	margin-top: 0;
}

/* In conversational mode the final submit stays the orange CTA; the per-step
   Next uses navy so only the final action carries the CTA color. */

/* Honeypot — kept out of the visual and accessibility trees. */
.s5f-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
