/**
 * Styles du formulaire public.
 * Volontairement discrets : le formulaire hérite des polices et couleurs du thème.
 */

.sf-form {
	--sf-gap: 1.25rem;
	--sf-radius: 4px;
	--sf-border: #c9ccd1;
	--sf-border-focus: currentColor;
	--sf-error: #b3261e;
	--sf-muted: #63666b;
	--sf-label-size: 1.05em;
	--sf-help-size: 0.95em;
	--sf-accent: currentColor;
}

.sf-form__fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sf-gap);
}

.sf-field {
	flex: 1 1 100%;
	min-width: 0;
}

.sf-w-half {
	flex: 1 1 calc(50% - var(--sf-gap));
}

.sf-w-third {
	flex: 1 1 calc(33.333% - var(--sf-gap));
}

@media (max-width: 600px) {
	.sf-w-half,
	.sf-w-third {
		flex-basis: 100%;
	}
}

.sf-field.sf-hidden,
.sf-field--hidden,
.sf-hp {
	display: none;
}

.sf-label,
.sf-choices .sf-label {
	display: block;
	margin-bottom: 0.35em;
	font-size: var(--sf-label-size);
	font-weight: 600;
	line-height: 1.3;
}

.sf-section {
	font-size: calc(var(--sf-label-size) * 1.3);
}

/*
 * Beaucoup de thèmes neutralisent l'apparence native des cases et des boutons
 * radio pour la remplacer par la leur, ce qui les fait disparaître dans un
 * formulaire qu'ils ne connaissent pas. On la rétablit explicitement.
 */
.sf-form input[type="radio"],
.sf-form input[type="checkbox"] {
	-webkit-appearance: auto;
	appearance: auto;
	width: 1.05em;
	height: 1.05em;
	min-width: 1.05em;
	margin: 0.2em 0 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	opacity: 1;
	position: static;
	clip: auto;
	accent-color: var(--sf-accent);
	flex: 0 0 auto;
}

.sf-form input[type="radio"] {
	border-radius: 50%;
}

.sf-required {
	color: var(--sf-error);
}

/*
 * Un thème qui ne stylise que input[type="text"] laisserait les champs tel,
 * email ou date avec une bordure différente. On vise donc tous les champs de
 * saisie d'un coup, avec une spécificité supérieure à celle d'un sélecteur
 * de thème classique, pour garantir un formulaire homogène.
 */
.sf-form .sf-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.sf-form .sf-field select,
.sf-form .sf-field textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.6em 0.75em;
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius);
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

.sf-form textarea {
	resize: vertical;
}

.sf-form .sf-field input:focus-visible,
.sf-form .sf-field select:focus-visible,
.sf-form .sf-field textarea:focus-visible,
.sf-submit:focus-visible {
	outline: 2px solid var(--sf-border-focus);
	outline-offset: 2px;
}

.sf-choices {
	margin: 0;
	padding: 0;
	border: 0;
}

.sf-choice {
	font-size: 1em;
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	margin-bottom: 0.3em;
	font-weight: 400;
	cursor: pointer;
}



/*
 * Les textes d'aide se fondaient dans un gris pensé pour un fond clair.
 * On part désormais de la couleur du texte environnant, simplement atténuée :
 * lisible sur fond clair comme sur fond sombre, quel que soit le thème.
 */
.sf-help {
	display: block;
	margin-top: 0.35em;
	color: inherit;
	opacity: 0.75;
	font-size: var(--sf-help-size);
	line-height: 1.45;
}

.sf-section {
	margin: 0.5em 0 0;
	padding-bottom: 0.4em;
	border-bottom: 1px solid var(--sf-border);
}

.sf-section__note {
	margin: 0.4em 0 0;
	color: inherit;
	opacity: 0.75;
	font-size: var(--sf-help-size);
}

.sf-field__error {
	display: none;
	margin-top: 0.35em;
	color: var(--sf-error);
	font-size: 0.875em;
}

.sf-field--error .sf-field__error {
	display: block;
}

.sf-form .sf-field--error input,
.sf-form .sf-field--error select,
.sf-form .sf-field--error textarea {
	border-color: var(--sf-error);
}

.sf-form__footer {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-top: var(--sf-gap);
}

.sf-submit {
	padding: 0.7em 1.6em;
	border: 0;
	border-radius: var(--sf-radius);
	background: #1c1e21;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sf-submit:hover {
	opacity: 0.88;
}

.sf-submit[disabled] {
	cursor: progress;
	opacity: 0.6;
}

.sf-spinner {
	display: none;
	width: 1em;
	height: 1em;
	border: 2px solid var(--sf-border);
	border-top-color: transparent;
	border-radius: 50%;
	animation: sf-spin 0.7s linear infinite;
}

.sf-form--busy .sf-spinner {
	display: inline-block;
}

@keyframes sf-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf-spinner {
		animation: none;
	}
}

.sf-form__messages:empty {
	display: none;
}

.sf-form__messages {
	margin-top: 1em;
	padding: 0.75em 1em;
	border-left: 3px solid var(--sf-error);
	background: #fdf2f1;
	color: var(--sf-error);
}

.sf-confirmation {
	padding: 1em 1.25em;
	border-left: 3px solid #2f7d43;
	background: #f1f8f2;
}

.sf-confirmation p:last-child {
	margin-bottom: 0;
}

.sf-notice--error {
	padding: 0.75em 1em;
	border-left: 3px solid var(--sf-error);
	background: #fdf2f1;
}

/* Blocs de service : présents dans le HTML pour les traducteurs front-end. */
.sf-i18n,
.sf-form-wrap [hidden] {
	display: none !important;
}

.sf-captcha {
	margin-top: 1.25rem;
}

.sf-form .sf-field input[type="file"] {
	box-sizing: border-box;
	width: 100%;
	padding: 0.6em 0.75em;
	border: 1px dashed var(--sf-border);
	border-radius: var(--sf-radius);
	background: #fff;
	font: inherit;
}

.sf-help--limits {
	opacity: 0.65;
}
