/**
 * Form Plant Pro - Page break (multi-step forms)
 *
 * Paging is done by toggling a class on the elements of each page
 * (assets/js/page-break.js). The form's own inputs and buttons keep the free
 * plugin's class names and design settings.
 */

/* ------------------------------------------------------------------
 * Paging
 * ---------------------------------------------------------------- */

.fplant-pro-page-break {
	display: none;
}

.fplant-pro-page-hidden {
	display: none !important;
}

/* The submit button, and the CAPTCHA widget the free plugin inserts in front
 * of it, belong to the last page. */
.fplant-form.fplant-pro-page-not-last .fplant-submit-button,
.fplant-form.fplant-pro-page-not-last button[type="submit"],
.fplant-form.fplant-pro-page-not-last input[type="submit"],
.fplant-form.fplant-pro-page-not-last .fplant-recaptcha-v2-container,
.fplant-form.fplant-pro-page-not-last .fplant-turnstile-container {
	display: none !important;
}

/* Until the script has split the form, keep everything after the first break
 * out of sight so the long form does not flash. The animation only holds for
 * a few seconds: if the script never runs, the whole form appears and works
 * as a single page. */
@keyframes fplant-pro-pages-guard {
	from,
	to {
		max-height: 0;
		margin: 0;
		padding: 0;
		border: 0;
		overflow: hidden;
		visibility: hidden;
	}
}

.fplant-form:not(.fplant-pro-pages-ready) > .fplant-pro-page-break ~ * {
	animation: fplant-pro-pages-guard 4s step-end;
}

/* ------------------------------------------------------------------
 * Navigation
 * ---------------------------------------------------------------- */

.fplant-pro-page-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75em;
	margin-top: 30px;
}

/* Placed right before the submit button, inside its parent (HTML templates). */
.fplant-pro-page-nav.fplant-pro-page-nav--inline {
	display: inline-flex;
	margin: 0 0.75em 0 0;
	vertical-align: top;
}

/* Not the last page: the submit button is hidden, so nothing sits to the right. */
.fplant-form.fplant-pro-page-not-last .fplant-pro-page-nav--inline {
	margin-right: 0;
}

/* Default layout: the free plugin's submit wrapper holds the buttons as one
 * wrapping row (page-break.js adds the class). Buttons as wide as their text
 * share a line; full-width ones — presets make them so on small screens —
 * stack, as the confirmation screen's buttons do. */
.fplant-submit-wrapper.fplant-pro-page-nav-host {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
}

.fplant-submit-wrapper.fplant-pro-page-nav-host--start {
	justify-content: flex-start;
}

.fplant-submit-wrapper.fplant-pro-page-nav-host--end {
	justify-content: flex-end;
}

.fplant-pro-page-nav-host > .fplant-pro-page-nav.fplant-pro-page-nav--inline {
	display: contents;
}

.fplant-pro-page-nav-host > .fplant-recaptcha-v2-container,
.fplant-pro-page-nav-host > .fplant-turnstile-container {
	flex: 0 0 100%;
}

/* The buttons themselves are styled by the free plugin: "Back" carries
 * .fplant-back-button and "Next" .fplant-submit-button-style, so design
 * presets and the form's design adjustments apply to them. */
.fplant-form.fplant-loading .fplant-pro-page-button {
	pointer-events: none;
	opacity: 0.6;
}

/* ------------------------------------------------------------------
 * Progress indicator
 * ---------------------------------------------------------------- */

.fplant-pro-progress {
	margin: 0 0 24px;
}

.fplant-pro-progress:focus {
	outline: none; /* focused by script only, to keep the reading position */
}

.fplant-pro-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.25em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fplant-pro-step {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0;
	opacity: 0.55;
}

.fplant-pro-step.is-done,
.fplant-pro-step.is-current {
	opacity: 1;
}

.fplant-pro-step.is-current {
	font-weight: 600;
}

.fplant-pro-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 1.9em;
	height: 1.9em;
	border: 2px solid currentColor;
	border-radius: 50%;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1;
}

.fplant-pro-step.is-current .fplant-pro-step-number,
.fplant-pro-step.is-done .fplant-pro-step-number {
	border-color: #2271b1;
	background-color: #2271b1;
	color: #fff;
}

.fplant-pro-bar {
	height: 8px;
	border-radius: 4px;
	background-color: rgba(127, 127, 127, 0.25);
	overflow: hidden;
}

.fplant-pro-bar-fill {
	height: 100%;
	border-radius: 4px;
	background-color: #2271b1;
	transition: width 0.3s;
}

.fplant-pro-bar-label {
	margin-top: 0.4em;
	font-size: 0.9em;
}

/* Announcements for screen readers only. */
.fplant-pro-page-live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.fplant-pro-step-title {
		font-size: 0.9em;
	}
}
