/**
 * Multi-Step Form (Forms Pro) — frontend widget styles.
 *
 * @package LandTechExtras
 * @since   3.6.3
 */

.ee-multi-step-form {
	--ltxe-msf-accent: #2271b1;
	--ltxe-msf-track-bg: rgba(15, 23, 42, 0.1);
	--ltxe-msf-border: rgba(15, 23, 42, 0.18);
	--ltxe-msf-text: #1d2327;
	--ltxe-msf-muted: #50575e;
	--ltxe-msf-radius: 6px;
	--ltxe-msf-gap: 1rem;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */

.ee-multi-step-form__progress-track {
	height: 6px;
	margin-bottom: var(--ltxe-msf-gap);
	background: var(--ltxe-msf-track-bg);
	border-radius: 999px;
	overflow: hidden;
}

/* The engine sets an inline width on this element as the user advances. It has to be a
   block for that width to take effect — as a default inline span, width is ignored and
   the bar never appears. */
.ee-multi-step-form__progress {
	display: block;
	width: 0;
	height: 100%;
	background: var(--ltxe-msf-accent);
	border-radius: inherit;
	transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.ee-multi-step-form__progress {
		transition: none;
	}
}

/* ── Notice ─────────────────────────────────────────────────────────────── */

.ee-multi-step-form__notice {
	margin: 0 0 var(--ltxe-msf-gap);
	padding: 0.65rem 0.8rem;
	border-radius: var(--ltxe-msf-radius);
	background: #e8f5e9;
	color: #1e4620;
	font-size: 0.9375rem;
}

.ee-multi-step-form__notice[hidden] {
	display: none;
}

.ee-multi-step-form__notice--error {
	background: #fcebea;
	color: #8a1f11;
}

/* ── Steps ──────────────────────────────────────────────────────────────── */

.ee-multi-step-form__step {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.ee-multi-step-form__step[hidden] {
	display: none;
}

.ee-multi-step-form__step > legend {
	padding: 0;
	margin-bottom: 0.75rem;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ltxe-msf-text);
}

/* ── Fields ─────────────────────────────────────────────────────────────── */

.ee-multi-step-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0 0 0.9rem;
}

.ee-multi-step-form__field > label {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ltxe-msf-text);
}

/* Unstyled controls default to a size-based width that ignores the container, which
   leaves fields short of the form on narrow screens. */
.ee-multi-step-form__field input,
.ee-multi-step-form__field select,
.ee-multi-step-form__field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--ltxe-msf-border);
	border-radius: var(--ltxe-msf-radius);
	background: #fff;
	color: var(--ltxe-msf-text);
	/* 16px keeps iOS Safari from zooming the page when a field takes focus. */
	font-size: 16px;
	line-height: 1.4;
	font-family: inherit;
}

.ee-multi-step-form__field textarea {
	min-height: 96px;
	resize: vertical;
}

.ee-multi-step-form__field input:focus-visible,
.ee-multi-step-form__field select:focus-visible,
.ee-multi-step-form__field textarea:focus-visible {
	outline: 2px solid var(--ltxe-msf-accent);
	outline-offset: 1px;
	border-color: var(--ltxe-msf-accent);
}

/* ── Actions ────────────────────────────────────────────────────────────── */

.ee-multi-step-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	margin-top: var(--ltxe-msf-gap);
}

.ee-multi-step-form__prev,
.ee-multi-step-form__next,
.ee-multi-step-form__submit {
	/* 44px comfortably clears the 24px WCAG 2.5.8 minimum and matches the field height. */
	min-height: 44px;
	padding: 0.6rem 1.25rem;
	border: 1px solid transparent;
	border-radius: var(--ltxe-msf-radius);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.ee-multi-step-form__next,
.ee-multi-step-form__submit {
	background: var(--ltxe-msf-accent);
	color: #fff;
}

.ee-multi-step-form__prev {
	background: transparent;
	border-color: var(--ltxe-msf-border);
	color: var(--ltxe-msf-text);
}

.ee-multi-step-form__prev[hidden],
.ee-multi-step-form__next[hidden],
.ee-multi-step-form__submit[hidden] {
	display: none;
}

.ee-multi-step-form__prev:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ee-multi-step-form__next:hover,
.ee-multi-step-form__submit:hover,
.ee-multi-step-form__prev:hover:not(:disabled) {
	filter: brightness(0.94);
}

/* ── Phones ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	/* Full-width, stacked controls so neither button is a narrow target on a small screen. */
	.ee-multi-step-form__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.ee-multi-step-form__prev,
	.ee-multi-step-form__next,
	.ee-multi-step-form__submit {
		width: 100%;
	}
}
