/* ==========================================================================
   Holding France — Formulaire de contact (poignée « hf-form »)
   Champs à cadre fin, libellés en capitales espacées, états sobres.
   Conçu pour les surfaces claires (blanc, ivoire) ; reste lisible sur bleu nuit.
   Contrastes (WCAG 1.4.11, 3:1 minimum pour les limites des champs) : filet navy à 55 %
   = 3,8:1 sur blanc et 3,4:1 contre l'ivoire ; blanc à 50 % sur bleu nuit = 4,9:1.
   Texte d'exemple (placeholder) : ardoise pleine, 5,7:1 sur blanc.
   ========================================================================== */

.hf-form {
	--hf-form-field-bg: var(--hf-white, #fff);
	--hf-form-line: rgba(4, 32, 79, 0.55);
	--hf-form-line-hover: rgba(4, 32, 79, 0.72);
	--hf-form-focus: var(--hf-navy-900, #04204F);
	--hf-form-error: var(--hf-red-700, #D9161C);
	--hf-form-error-bg: rgba(217, 22, 28, 0.04);
	--hf-form-checked-bg: var(--hf-navy-900, #04204F);
	--hf-form-checked-fg: var(--hf-white, #fff);
	position: relative;
	color: var(--hf-fg-2, #2B3651);
	font-family: var(--hf-font-sans, system-ui, sans-serif);
}
:is(.hf-surface--navy, .hf-surface--deep) .hf-form {
	--hf-form-field-bg: rgba(255, 255, 255, 0.04);
	--hf-form-line: rgba(255, 255, 255, 0.5);
	--hf-form-line-hover: rgba(255, 255, 255, 0.72);
	--hf-form-focus: var(--hf-white, #fff);
	--hf-form-error: #FF8E91;
	--hf-form-error-bg: rgba(255, 142, 145, 0.08);
	--hf-form-checked-bg: var(--hf-white, #fff);
	--hf-form-checked-fg: var(--hf-navy-900, #04204F);
}

.hf-form__title {
	margin: 0 0 2rem;
	font-family: var(--hf-font-serif, Georgia, serif);
	font-size: var(--hf-fs-h3, 1.625rem);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--hf-fg, #0B1733);
	text-wrap: balance;
}

/* ---------- Grille ---------- */
.hf-form__form {
	margin: 0;
}
.hf-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.75rem 1.5rem;
}
.hf-form__field {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.hf-form__field--full {
	grid-column: 1 / -1;
}

/* ---------- Libellés ---------- */
.hf-form__label {
	display: block;
	margin: 0 0 0.625rem;
	padding: 0;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hf-fg, #0B1733);
}
.hf-form__req {
	margin-left: 0.25em;
	color: var(--hf-red, #FC2C31);
	font-weight: 600;
	letter-spacing: 0;
}

/* ---------- Champs ---------- */
.hf-form__input {
	display: block;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 0.9375rem 1rem;
	font: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--hf-fg, #0B1733);
	background-color: var(--hf-form-field-bg);
	border: 1px solid var(--hf-form-line);
	border-radius: var(--hf-radius, 2px);
	box-shadow: inset 0 0 0 0 transparent;
	appearance: none;
	transition: border-color var(--hf-dur, 0.45s) var(--hf-ease, ease), box-shadow var(--hf-dur, 0.45s) var(--hf-ease, ease), background-color var(--hf-dur, 0.45s) var(--hf-ease, ease);
}
.hf-form__input::placeholder {
	color: var(--hf-fg-muted, #5E677C);
	opacity: 1;
}
.hf-form__input:hover {
	border-color: var(--hf-form-line-hover);
}
.hf-form__input:focus,
.hf-form__input:focus-visible {
	outline: none;
	border-color: var(--hf-form-focus);
	box-shadow: inset 0 -2px 0 var(--hf-accent, #0359F7);
}
.hf-form__textarea {
	min-height: 196px;
	resize: vertical;
}
/* Message : erreur à gauche, compteur à droite, sur la même ligne */
.hf-form__field--message {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 1rem;
}
.hf-form__field--message > .hf-form__label,
.hf-form__field--message > .hf-form__textarea {
	grid-column: 1 / -1;
}
.hf-form__field--message > .hf-form__error {
	grid-column: 1;
	grid-row: 3;
}
.hf-form__count {
	grid-column: 2;
	grid-row: 3;
	margin: 0.625rem 0 0;
	font-size: var(--hf-fs-xs, 0.8125rem);
	font-variant-numeric: tabular-nums;
	line-height: 1.45;
	text-align: right;
	color: var(--hf-fg-muted, #5E677C);
}

/* Liste déroulante */
.hf-form__select-wrap {
	position: relative;
}
.hf-form__select {
	padding-right: 3rem;
	cursor: pointer;
	text-overflow: ellipsis;
}
.hf-form__select-icon {
	position: absolute;
	top: 50%;
	right: 1rem;
	width: 18px;
	height: 18px;
	color: var(--hf-fg, #0B1733);
	transform: translateY(-50%);
	pointer-events: none;
}
.hf-form__select option {
	color: var(--hf-ink, #0B1733);
	background: var(--hf-white, #fff);
}

/* ---------- « Vous êtes » : étiquettes ---------- */
.hf-form__choice-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.hf-form__choice {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}
.hf-form__choice input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.hf-form__choice span {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 46px;
	padding: 0.625rem 1.125rem;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--hf-fg, #0B1733);
	background-color: var(--hf-form-field-bg);
	border: 1px solid var(--hf-form-line);
	border-radius: var(--hf-radius, 2px);
	transition: background-color var(--hf-dur, 0.45s) var(--hf-ease, ease), border-color var(--hf-dur, 0.45s) var(--hf-ease, ease), color var(--hf-dur, 0.45s) var(--hf-ease, ease);
}
/* Témoin de sélection : petit rond qui se remplit (choix unique) */
.hf-form__choice span::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border: 1px solid currentColor;
	border-radius: 50%;
	opacity: 0.45;
	transition: background-color var(--hf-dur, 0.45s) var(--hf-ease, ease), opacity var(--hf-dur, 0.45s) var(--hf-ease, ease);
}
.hf-form__choice:hover span {
	border-color: var(--hf-form-line-hover);
}
.hf-form__choice input:checked + span {
	color: var(--hf-form-checked-fg);
	background-color: var(--hf-form-checked-bg);
	border-color: var(--hf-form-checked-bg);
}
.hf-form__choice input:checked + span::before {
	background-color: var(--hf-red, #FC2C31);
	border-color: var(--hf-red, #FC2C31);
	opacity: 1;
}
.hf-form__choice input:focus-visible + span {
	outline: 2px solid var(--hf-accent, #0359F7);
	outline-offset: 2px;
}

/* ---------- Consentement ---------- */
.hf-form__check {
	display: flex;
	align-items: flex-start;
	gap: 0.875rem;
}
.hf-form__checkbox {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0.15rem 0 0;
	background-color: var(--hf-form-field-bg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 16px 16px;
	border: 1px solid var(--hf-form-line);
	border-radius: var(--hf-radius, 2px);
	appearance: none;
	cursor: pointer;
	transition: background-color var(--hf-dur, 0.45s) var(--hf-ease, ease), border-color var(--hf-dur, 0.45s) var(--hf-ease, ease);
}
.hf-form__checkbox:hover {
	border-color: var(--hf-form-line-hover);
}
.hf-form__checkbox:checked {
	background-color: var(--hf-form-checked-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.8 6.1-6.4' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	border-color: var(--hf-form-checked-bg);
}
:is(.hf-surface--navy, .hf-surface--deep) .hf-form__checkbox:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.8 6.1-6.4' fill='none' stroke='%2304204F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.hf-form__checkbox:focus-visible {
	outline: 2px solid var(--hf-accent, #0359F7);
	outline-offset: 3px;
}
.hf-form__check-text {
	font-size: var(--hf-fs-small, 0.875rem);
	line-height: 1.6;
	color: var(--hf-fg-2, #2B3651);
	cursor: pointer;
	text-wrap: pretty;
}
.hf-form__check-text a {
	color: var(--hf-fg, #0B1733);
	text-decoration: underline;
	text-decoration-color: var(--hf-accent, #0359F7);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color var(--hf-dur, 0.45s) var(--hf-ease, ease);
}
.hf-form__check-text a:hover {
	color: var(--hf-accent, #0359F7);
}

/* ---------- Erreurs ---------- */
.hf-form__error {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0.625rem 0 0;
	font-size: var(--hf-fs-xs, 0.8125rem);
	font-weight: 500;
	line-height: 1.45;
	color: var(--hf-form-error);
}
.hf-form__error::before {
	content: "";
	flex: none;
	width: 12px;
	height: 1px;
	background: currentColor;
	transform: translateY(-0.28em);
}
.hf-form__error[hidden] {
	display: none;
}
.hf-form__field.is-invalid .hf-form__input,
.hf-form__field.is-invalid .hf-form__checkbox,
.hf-form__choices.is-invalid .hf-form__choice span {
	border-color: var(--hf-form-error);
}
.hf-form__field.is-invalid .hf-form__input:focus {
	box-shadow: inset 0 -2px 0 var(--hf-form-error);
}

/* ---------- Pied du formulaire ---------- */
.hf-form__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--hf-border, rgba(4, 32, 79, 0.12));
}
.hf-form__required {
	margin: 0;
	font-size: var(--hf-fs-xs, 0.8125rem);
	color: var(--hf-fg-muted, #5E677C);
}
.hf-form__required span {
	color: var(--hf-red, #FC2C31);
}
.hf-form__submit {
	min-width: 248px;
}
.hf-form__submit[aria-disabled="true"] {
	cursor: progress;
	opacity: 0.72;
}
.hf-form.is-sending .hf-form__submit .hf-icon {
	animation: hf-form-send 1.2s var(--hf-ease-in-out, ease-in-out) infinite;
}
@keyframes hf-form-send {
	0% { transform: translateX(0); opacity: 1; }
	50% { transform: translateX(6px); opacity: 0.2; }
	100% { transform: translateX(0); opacity: 1; }
}

/* ---------- Messages globaux ---------- */
/* Le message reçoit le focus pour être lu par les lecteurs d'écran ; zone non interactive : pas de cadre. */
.hf-form__status:focus,
.hf-form__status:focus-visible {
	outline: none;
}
.hf-form__status:not(:empty) {
	margin-bottom: 2rem;
}
.hf-form__notice {
	padding: 1.25rem 1.5rem;
	border-left: 2px solid var(--hf-form-error);
	background-color: var(--hf-form-error-bg);
}
.hf-form__notice-title {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--hf-fg, #0B1733);
}
.hf-form__notice-list {
	display: grid;
	gap: 0.375rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}
.hf-form__notice-list a {
	font-size: var(--hf-fs-small, 0.875rem);
	color: var(--hf-form-error);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}
.hf-form__notice-list a:hover {
	color: var(--hf-fg, #0B1733);
}

/* Confirmation d'envoi : remplace le formulaire, dans le même cadre */
.hf-form__success {
	display: grid;
	justify-items: start;
	gap: 1rem;
	padding-block: clamp(0.5rem, 2vw, 1.5rem);
}
.hf-form__success-icon {
	display: inline-grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 0.75rem;
	color: var(--hf-accent, #0359F7);
	border: 1px solid var(--hf-border-strong, rgba(4, 32, 79, 0.24));
	border-radius: 50%;
}
.hf-form__success-icon .hf-icon {
	width: 24px;
	height: 24px;
}
.hf-form__success-title {
	margin: 0;
	font-family: var(--hf-font-serif, Georgia, serif);
	font-size: clamp(1.75rem, 1.4rem + 1.1vw, 2.375rem);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--hf-fg, #0B1733);
}
.hf-form__success-text {
	max-width: 52ch;
	margin: 0;
	font-size: var(--hf-fs-lead, 1.1875rem);
	line-height: 1.6;
	color: var(--hf-fg-2, #2B3651);
	text-wrap: pretty;
}
.hf-form__again {
	margin-top: 1.25rem;
}
.hf-form__success-text + .hf-form__again {
	padding-top: 0.3rem;
}

/* ---------- Piège à robots ---------- */
.hf-form__trap {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 640px) {
	/* Libellés en capitales : 12 px au minimum sur téléphone. */
	.hf-form__label {
		font-size: 0.75rem;
		letter-spacing: 0.14em;
	}
	.hf-form__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}
	.hf-form__footer {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 1rem;
		margin-top: 2rem;
		padding-top: 1.75rem;
	}
	.hf-form__submit {
		width: 100%;
		min-width: 0;
	}
	.hf-form__required {
		text-align: center;
	}
	.hf-form__choice {
		flex: 1 1 calc(50% - 0.25rem);
	}
	.hf-form__choice span {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hf-form__input,
	.hf-form__choice span,
	.hf-form__choice span::before,
	.hf-form__checkbox,
	.hf-form__check-text a {
		transition: none;
	}
	.hf-form.is-sending .hf-form__submit .hf-icon {
		animation: none;
	}
}
