/**
 * FormPilot — Smart Form Builder — frontend styles.
 *
 * Intentionally minimal so themes keep control of the look.
 *
 * @package FormPilot
 */

.formpilot-form__fields {
	display: block;
}

.formpilot-field {
	margin-bottom: 1.25em;
}

.formpilot-field__label {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 600;
}

.formpilot-field__required {
	color: #b32d2e;
}

.formpilot-field__group {
	padding: 0;
	margin: 0;
	border: 0;
}

.formpilot-field__description {
	margin: 0.35em 0 0;
	font-size: 0.875em;
	opacity: 0.8;
}

.formpilot-input {
	max-width: 100%;
}

.formpilot-input--text,
.formpilot-input--email,
.formpilot-input--phone,
.formpilot-input--number,
.formpilot-input--date,
.formpilot-input--textarea,
.formpilot-input--select {
	width: 100%;
	box-sizing: border-box;
}

.formpilot-choices {
	padding: 0;
	margin: 0;
	list-style: none;
}

.formpilot-choice {
	margin-bottom: 0.25em;
}

.formpilot-choice label {
	margin-inline-start: 0.35em;
}

.formpilot-captcha {
	margin-bottom: 1em;
}

/* Honeypot: off screen rather than display:none, which some bots skip. */
.formpilot-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Conditional logic hides the wrapper; [hidden] alone loses to display rules. */
.formpilot-field--hidden,
.formpilot-field[hidden] {
	display: none !important;
}

.formpilot-field__error {
	margin: 0.35em 0 0;
	font-size: 0.875em;
	color: #b32d2e;
}

.formpilot-field--invalid .formpilot-input {
	border-color: #b32d2e;
}

/* Multi-step */

.formpilot-form [hidden] {
	display: none !important;
}

.formpilot-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.formpilot-step:focus {
	outline: none;
}

/* The step is focused to announce it, which should not look like a text cursor. */
.formpilot-step:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.formpilot-step__title {
	margin: 0 0 0.25em;
}

.formpilot-step__description {
	margin: 0 0 1em;
	opacity: 0.8;
}

.formpilot-progress {
	margin-bottom: 1.5em;
}

.formpilot-progress__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	padding: 0;
	margin: 0 0 0.75em;
	list-style: none;
	counter-reset: none;
}

.formpilot-progress__link {
	display: flex;
	gap: 0.4em;
	align-items: center;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	background: none;
	border: 0;
}

.formpilot-progress__link[disabled] {
	cursor: default;
	opacity: 0.5;
}

.formpilot-progress__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8em;
	height: 1.8em;
	font-size: 0.85em;
	border: 1px solid currentColor;
	border-radius: 50%;
}

.formpilot-progress__step.is-current .formpilot-progress__link {
	font-weight: 600;
}

.formpilot-progress__step.is-complete .formpilot-progress__number {
	color: #fff;
	background: currentColor;
}

.formpilot-progress__step.is-complete .formpilot-progress__label {
	text-decoration: underline;
}

.formpilot-progress__track {
	height: 6px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 3px;
}

.formpilot-progress__fill {
	display: block;
	width: 0;
	height: 100%;
	background: currentColor;
	transition: width 0.25s ease;
}

@media ( prefers-reduced-motion: reduce ) {
	.formpilot-progress__fill {
		transition: none;
	}
}

.formpilot-progress__status {
	margin: 0.5em 0 0;
	font-size: 0.875em;
	opacity: 0.8;
}

.formpilot-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	align-items: center;
}

.formpilot-save {
	margin-inline-start: auto;
}

.formpilot-form__resume {
	padding: 0.75em 1em;
	margin-top: 1em;
	border-inline-start: 4px solid currentColor;
	background: rgba(0, 0, 0, 0.04);
}

.formpilot-form__resume-url {
	width: 100%;
	box-sizing: border-box;
}

.formpilot-form.is-stepping {
	opacity: 0.7;
}

.formpilot-form__message {
	padding: 0.75em 1em;
	margin-bottom: 1em;
	border-inline-start: 4px solid currentColor;
}

.formpilot-form__message--success {
	color: #007017;
	background: #f0f6f1;
}

.formpilot-form__message--error {
	color: #b32d2e;
	background: #fcf0f1;
}

.formpilot-form.is-submitting {
	opacity: 0.7;
}

.formpilot-notice--editor {
	padding: 0.75em 1em;
	border-inline-start: 4px solid #dba617;
	background: #fcf9e8;
}
