/* Form Studio – frontend. Override the variables in your theme to restyle. */
.fst-wrap {
	--fst-primary: #2563eb;
	--fst-primary-hover: #1d4ed8;
	--fst-text: inherit;
	--fst-label: inherit;
	--fst-muted: #64748b;
	--fst-border: #cbd5e1;
	--fst-border-hover: #94a3b8;
	--fst-bg: #fff;
	--fst-error: #dc2626;
	--fst-success: #15803d;
	--fst-star: #f59e0b;
	--fst-radius: 8px;
	--fst-gap: 18px;
	--fst-font-size: 16px;
	max-width: 100%;
	color: var(--fst-text);
}

.fst-wrap *,
.fst-wrap *::before,
.fst-wrap *::after { box-sizing: border-box; }

.fst-wrap .fst-title { margin: 0 0 var(--fst-gap); }

.fst-wrap .fst-fields,
.fst-wrap .fst-col {
	display: flex;
	flex-direction: column;
	gap: var(--fst-gap);
	min-width: 0;
}

.fst-wrap .fst-field { min-width: 0; margin: 0; }

/* Column layouts */
.fst-wrap .fst-row { display: grid; gap: var(--fst-gap); align-items: start; }
.fst-wrap .fst-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fst-wrap .fst-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Labels */
.fst-wrap .fst-label {
	display: block;
	margin: 0 0 7px;
	padding: 0;
	font-weight: 600;
	font-size: 0.92em;
	color: var(--fst-label);
}
.fst-wrap .fst-req { color: var(--fst-error); }
.fst-wrap .fst-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Inputs */
.fst-wrap input[type="text"],
.fst-wrap input[type="email"],
.fst-wrap input[type="tel"],
.fst-wrap input[type="number"],
.fst-wrap input[type="url"],
.fst-wrap input[type="date"],
.fst-wrap input[type="time"],
.fst-wrap select,
.fst-wrap textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 11px 14px;
	font: inherit;
	font-size: var(--fst-font-size);
	line-height: 1.4;
	color: inherit;
	background: var(--fst-bg);
	border: 1px solid var(--fst-border);
	border-radius: var(--fst-radius);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.fst-wrap select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' 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;
}
.fst-wrap textarea { min-height: 130px; resize: vertical; }
.fst-wrap input::placeholder,
.fst-wrap textarea::placeholder { color: #94a3b8; opacity: 1; }

.fst-wrap input:hover,
.fst-wrap select:hover,
.fst-wrap textarea:hover { border-color: var(--fst-border-hover); }

.fst-wrap input:focus,
.fst-wrap select:focus,
.fst-wrap textarea:focus {
	outline: none;
	border-color: var(--fst-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--fst-primary) 16%, transparent);
}

/* Choices */
.fst-wrap .fst-choices { display: flex; flex-direction: column; gap: 8px; }
.fst-wrap .fst-choice,
.fst-wrap .fst-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-weight: normal;
	line-height: 1.45;
	cursor: pointer;
}
.fst-wrap .fst-choice input,
.fst-wrap .fst-consent input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--fst-primary);
	cursor: pointer;
}
.fst-wrap .fst-consent { padding: 12px 14px; border: 1px solid var(--fst-border); border-radius: var(--fst-radius); background: color-mix(in srgb, var(--fst-primary) 3%, #fff); font-size: .95em; }
.fst-wrap .fst-consent a { color: var(--fst-primary); }

/* Rating */
.fst-wrap .fst-rating { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.fst-wrap .fst-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fst-wrap .fst-rating label { font-size: 30px; line-height: 1; color: #e2e8f0; cursor: pointer; transition: color .12s, transform .12s; }
.fst-wrap .fst-rating label:hover,
.fst-wrap .fst-rating label:hover ~ label,
.fst-wrap .fst-rating input:checked ~ label { color: var(--fst-star); }
.fst-wrap .fst-rating label:hover { transform: scale(1.12); }
.fst-wrap .fst-rating input:focus-visible + label { outline: 2px solid var(--fst-primary); outline-offset: 2px; border-radius: 4px; }

/* Section heading & divider */
.fst-wrap .fst-section-title { margin: 8px 0 0; font-size: 1.2em; line-height: 1.3; }
.fst-wrap .fst-field-section .fst-desc { margin-top: 4px; }
.fst-wrap .fst-field-section { padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.fst-wrap .fst-field-divider hr { border: 0; border-top: 1px solid #e2e8f0; margin: 4px 0; }

.fst-wrap .fst-desc { margin: 6px 0 0; font-size: 0.85em; color: var(--fst-muted); }

/* Errors */
.fst-wrap .fst-error { margin: 6px 0 0; font-size: 0.85em; color: var(--fst-error); }
.fst-wrap .fst-error[hidden] { display: none; }
.fst-wrap .fst-has-error input,
.fst-wrap .fst-has-error select,
.fst-wrap .fst-has-error textarea,
.fst-wrap .fst-has-error .fst-consent { border-color: var(--fst-error); }
.fst-wrap .fst-has-error input:focus,
.fst-wrap .fst-has-error select:focus,
.fst-wrap .fst-has-error textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--fst-error) 14%, transparent); }

.fst-wrap .fst-turnstile { margin-top: var(--fst-gap); }

/* Messages */
.fst-wrap .fst-messages:empty { display: none; }
.fst-wrap .fst-messages {
	margin-top: var(--fst-gap);
	padding: 14px 16px;
	border-radius: var(--fst-radius);
	border: 1px solid transparent;
	font-size: 0.95em;
}
.fst-wrap .fst-messages > :last-child { margin-bottom: 0; }
.fst-wrap .fst-msg-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--fst-success); }
.fst-wrap .fst-msg-error { background: #fef2f2; border-color: #fecaca; color: var(--fst-error); }

/* Submit */
.fst-wrap .fst-actions { margin-top: calc(var(--fst-gap) + 4px); }
.fst-wrap .fst-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 30px;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--fst-primary);
	border: 0;
	border-radius: var(--fst-radius);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 4px 12px color-mix(in srgb, var(--fst-primary) 25%, transparent);
	cursor: pointer;
	transition: background .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.fst-wrap .fst-submit:hover { background: var(--fst-primary-hover); transform: translateY(-1px); }
.fst-wrap .fst-submit:active { transform: translateY(0); }
.fst-wrap .fst-submit:focus-visible { outline: 2px solid var(--fst-primary); outline-offset: 3px; }
.fst-wrap .fst-busy .fst-submit { opacity: .7; cursor: wait; transform: none; }
.fst-wrap .fst-busy .fst-submit::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fst-spin .7s linear infinite;
}
@keyframes fst-spin { to { transform: rotate(360deg); } }

/* After success with "hide form" enabled */
.fst-wrap .fst-done .fst-fields,
.fst-wrap .fst-done .fst-actions,
.fst-wrap .fst-done .fst-turnstile { display: none; }
.fst-wrap .fst-done .fst-messages { margin-top: 0; }

/* Honeypot */
.fst-wrap .fst-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.fst-wrap .fst-cols-2,
	.fst-wrap .fst-cols-3 { grid-template-columns: 1fr; }
	.fst-wrap .fst-submit { width: 100%; }
}

/* Conditional logic */
.fst-wrap [data-fst-cond][hidden] { display: none !important; }
.fst-wrap [data-fst-cond]:not([hidden]) { animation: fst-reveal .2s ease-out; }
@keyframes fst-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Submit alignment / width (set in the builder) */
.fst-wrap .fst-actions.fst-align-left { text-align: left; }
.fst-wrap .fst-actions.fst-align-center { text-align: center; }
.fst-wrap .fst-actions.fst-align-right { text-align: right; }
.fst-wrap .fst-submit.fst-submit-full { display: flex; width: 100%; }

/* reCAPTCHA add-on */
.fst-wrap .fst-captcha { margin-top: var(--fst-gap); }
.fst-wrap .fst-recaptcha { min-height: 78px; }
.fst-wrap .fst-done .fst-captcha { display: none; }

/* ------------------------------------------------------------------
 * File Upload field (v2.1.0)
 * ---------------------------------------------------------------- */
.fst-wrap input[type="file"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px;
	border: 1.5px dashed var(--fst-border);
	border-radius: var(--fst-radius);
	background: var(--fst-bg);
	color: var(--fst-muted);
	font-size: 14px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.fst-wrap input[type="file"]:hover { border-color: var(--fst-border-hover); }
.fst-wrap input[type="file"]:focus-visible { outline: 2px solid var(--fst-primary); outline-offset: 2px; }
.fst-wrap input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 7px 14px;
	border: 0;
	border-radius: 6px;
	background: var(--fst-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.fst-wrap input[type="file"]::file-selector-button:hover { background: var(--fst-primary-hover); }
.fst-wrap .fst-has-error input[type="file"] { border-color: var(--fst-error); }
.fst-wrap .fst-file-hint { font-size: 13px; }

/* Checkbox / radio: centre the box on the FIRST line of its label, whatever the theme's line-height (v2.7.1) */
.fst-wrap .fst-choice input,
.fst-wrap .fst-consent input {
	line-height: inherit;
	font-size: inherit;
	margin-top: 2px; /* fallback for browsers without the lh unit */
	margin-top: calc((1lh - 18px) / 2);
}
.fst-wrap .fst-choice > span,
.fst-wrap .fst-consent > span { min-width: 0; }

/* Multi-step forms (v2.8.0) – steps are only split once fst-public.js adds .fst-ms-ready, so no-JS visitors see the whole form */
.fst-wrap .fst-progress,
.fst-wrap .fst-prev,
.fst-wrap .fst-next { display: none; }
.fst-wrap .fst-ms-ready .fst-progress { display: block; margin: 0 0 calc(var(--fst-gap) + 4px); }
.fst-wrap .fst-ms-ready .fst-step { display: none; }
.fst-wrap .fst-ms-ready .fst-step.is-active { display: block; animation: fst-step-in .25s ease; }
.fst-wrap .fst-step:focus { outline: none; }
.fst-wrap .fst-step + .fst-step { margin-top: var(--fst-gap); }
.fst-wrap .fst-ms-ready .fst-step + .fst-step { margin-top: 0; }
.fst-wrap .fst-step-title { margin: 0 0 var(--fst-gap); }

@keyframes fst-step-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.fst-wrap .fst-ms-ready .fst-step.is-active { animation: none; }
	.fst-wrap .fst-pfill { transition: none !important; }
}

/* Progress: numbered steps */
.fst-wrap .fst-psteps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.fst-wrap .fst-pstep { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; margin: 0; text-align: center; color: var(--fst-muted); font-size: 0.85em; }
.fst-wrap .fst-pstep[hidden] { display: none; }
.fst-wrap .fst-pstep::before { content: ""; position: absolute; top: 15px; right: calc(50% + 20px); left: calc(-50% + 20px); height: 2px; background: var(--fst-border); }
.fst-wrap .fst-pstep:first-child::before { display: none; }
.fst-wrap .fst-pstep.is-done::before,
.fst-wrap .fst-pstep.is-active::before { background: var(--fst-primary); }
.fst-wrap .fst-pnum { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--fst-border); background: var(--fst-bg); color: var(--fst-muted); font-weight: 700; font-size: 14px; line-height: 1; transition: background .2s, border-color .2s, color .2s; }
.fst-wrap .fst-pstep.is-active .fst-pnum { border-color: var(--fst-primary); color: var(--fst-primary); }
.fst-wrap .fst-pstep.is-done .fst-pnum { border-color: var(--fst-primary); background: var(--fst-primary); color: #fff; }
.fst-wrap .fst-pstep.is-active { color: var(--fst-label); font-weight: 600; }
.fst-wrap .fst-ptitle { max-width: 100%; overflow-wrap: anywhere; line-height: 1.3; }

/* Progress: bar */
.fst-wrap .fst-pbar { height: 8px; border-radius: 999px; background: var(--fst-border); overflow: hidden; }
.fst-wrap .fst-pfill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--fst-primary); transition: width .3s ease; }
.fst-wrap .fst-pbar-label { margin: 8px 0 0; font-size: 0.85em; color: var(--fst-muted); }

/* Buttons: Previous / Next / Submit */
.fst-wrap .fst-ms-ready .fst-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fst-wrap .fst-ms-ready .fst-actions.fst-align-left { justify-content: flex-start; }
.fst-wrap .fst-ms-ready .fst-actions.fst-align-center { justify-content: center; }
.fst-wrap .fst-ms-ready .fst-actions.fst-align-right { justify-content: flex-end; }
.fst-wrap .fst-ms-ready .fst-next,
.fst-wrap .fst-ms-ready .fst-prev { display: inline-flex; align-items: center; justify-content: center; padding: 12px 26px; border-radius: var(--fst-radius); font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background .15s, border-color .15s; }
.fst-wrap .fst-ms-ready .fst-next { border: 0; background: var(--fst-primary); color: #fff; }
.fst-wrap .fst-ms-ready .fst-next:hover { background: var(--fst-primary-hover); }
.fst-wrap .fst-ms-ready .fst-prev { border: 1px solid var(--fst-border); background: transparent; color: inherit; }
.fst-wrap .fst-ms-ready .fst-prev:hover { border-color: var(--fst-border-hover); }
.fst-wrap .fst-ms-ready .fst-next:focus-visible,
.fst-wrap .fst-ms-ready .fst-prev:focus-visible { outline: 2px solid var(--fst-primary); outline-offset: 3px; }
.fst-wrap .fst-ms-ready.is-first .fst-prev { display: none; }
.fst-wrap .fst-ms-ready.is-last .fst-next { display: none; }
.fst-wrap .fst-ms-ready:not(.is-last) .fst-submit { display: none; }
.fst-wrap .fst-ms-ready:not(.is-last) .fst-captcha-zone { display: none; }
.fst-wrap .fst-ms-ready.fst-busy .fst-prev { pointer-events: none; opacity: .6; }
.fst-wrap .fst-ms-ready .fst-submit.fst-submit-full { flex: 1 1 100%; }

@media (max-width: 520px) {
	.fst-wrap .fst-ptitle { display: none; }
	.fst-wrap .fst-pstep.is-active .fst-ptitle { display: block; }
	.fst-wrap .fst-ms-ready .fst-next,
	.fst-wrap .fst-ms-ready .fst-prev { flex: 1 1 0; }
}

/* Multi-step: after a successful submit only the confirmation message remains (v2.8.0) */
.fst-wrap .fst-done .fst-multistep,
.fst-wrap .fst-done .fst-captcha-zone,
.fst-wrap .fst-form.fst-done.fst-ms-ready .fst-actions { display: none !important; }
