/*
 * VoertuigWP · the stylesheet of a form, loaded only with a form (D-0111).
 *
 * Like the display it follows the theme: font, colour and the look of the inputs are inherited;
 * each selector has one class of the plugin, so a theme overrides it with one class of its own.
 */

.voertuigwp-form {
	--voertuigwp-accent: var(--wp--preset--color--primary, currentColor);
	--voertuigwp-line: color-mix(in srgb, currentColor 30%, transparent);
	--voertuigwp-error: #b32d2e;
	display: grid;
	gap: 1rem;
	max-width: 40rem;
}

.voertuigwp-form__body,
.voertuigwp-form__step {
	display: grid;
	gap: 1rem;
}

.voertuigwp-form__step {
	margin: 0;
	padding: 0;
	border: 0;
}

.voertuigwp-form__step legend {
	margin-bottom: 0.5rem;
	padding: 0;
	font-weight: 600;
}

.voertuigwp-form__field {
	display: grid;
	gap: 0.25rem;
}

.voertuigwp-form__field[hidden],
.voertuigwp-form__body[hidden] {
	display: none;
}

.voertuigwp-form__field label {
	font-weight: 600;
}

.voertuigwp-form__field :where(input:not([type="checkbox"]), textarea) {
	box-sizing: border-box;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--voertuigwp-line);
	border-radius: 4px;
	font: inherit;
}

.voertuigwp-form__field--checkbox {
	grid-template-columns: auto 1fr;
	align-items: start;
	column-gap: 0.5rem;
}

.voertuigwp-form__field--checkbox label {
	font-weight: normal;
}

.voertuigwp-form__field--checkbox .voertuigwp-form__error,
.voertuigwp-form__field--checkbox .voertuigwp-form__help {
	grid-column: 1 / -1;
}

.voertuigwp-form__field [aria-invalid="true"] {
	border-color: var(--voertuigwp-error);
}

.voertuigwp-form__error {
	margin: 0;
	color: var(--voertuigwp-error);
}

.voertuigwp-form__error:empty,
.voertuigwp-form__status:empty {
	display: none;
}

.voertuigwp-form__help,
.voertuigwp-form__privacy {
	margin: 0;
	font-size: 0.9em;
}

.voertuigwp-form__status {
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--voertuigwp-accent);
}

.voertuigwp-form__status.is-error {
	border-left-color: var(--voertuigwp-error);
}

/* The honeypot: out of sight, not display: none, which some bots skip. */
.voertuigwp-form__website {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.voertuigwp-form__submit {
	justify-self: start;
	cursor: pointer;
}

.voertuigwp-form__submit:disabled {
	cursor: progress;
	opacity: 0.6;
}
