/**
 * Bloc nailpop/demande-rdv : maquette v28, « Formulaire de demande de rendez-vous ».
 * Uniquement les presets du thème (couleurs, polices, tailles, rayons) : aucune couleur en dur.
 * Les nuances (fond de barre, filets, voile) sont dérivées des presets avec color-mix().
 */

.np-rdv {
	--np-trait: var(--wp--preset--color--line);
	--np-trait-fort: color-mix(in srgb, var(--wp--preset--color--contrast) 25%, transparent);
	--np-rayon-champ: var(--wp--custom--radius--md, 12px);
	--np-rayon-carte: var(--wp--custom--radius--lg, 16px);
	--np-rayon-bouton: var(--wp--custom--radius--sm, 10px);
	--np-rayon-pastille: var(--wp--custom--radius--pill, 100px);
	--np-transition: var(--wp--custom--transition, 0.3s ease);

	box-sizing: border-box;
	background: var(--wp--preset--color--white);
	border-radius: var(--np-rayon-carte);
	padding: clamp(22px, 3.5vw, 44px);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	line-height: 1.55;
	scroll-margin-top: 96px; /* En-tête collant du thème. */
	-webkit-tap-highlight-color: transparent; /* La racine porte les écouteurs délégués : pas de carte bleue au toucher. */
	container-type: inline-size; /* Mise en page selon la largeur du bloc, pas de l'écran. */
}

.np-rdv *,
.np-rdv *::before,
.np-rdv *::after {
	box-sizing: border-box;
}

/* L'attribut hidden doit l'emporter sur les display: flex/grid ci-dessous. */
.np-rdv [hidden] {
	display: none !important;
}

.np-rdv p {
	margin: 0;
}

.np-rdv__formulaire,
.np-rdv__etape-contenu,
.np-rdv__pile {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.np-rdv__pile {
	gap: 14px;
}

/* ------------------------------------------------------------------ */
/* En-tête : progression et titre                                      */
/* ------------------------------------------------------------------ */

.np-rdv__entete {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.np-rdv__repere {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: var(--wp--preset--font-size--small);
}

.np-rdv__etape {
	flex: none;
	white-space: nowrap;
	font-weight: 500;
	color: var(--wp--preset--color--accent);
}

.np-rdv__ensuite {
	color: var(--wp--preset--color--contrast);
	text-align: right;
}

.np-rdv__barre {
	height: 4px;
	border-radius: 4px;
	overflow: hidden;
	background: color-mix(in srgb, var(--wp--preset--color--accent) 12%, var(--wp--preset--color--white));
}

.np-rdv__barre-remplie {
	display: block;
	height: 100%;
	border-radius: 4px;
	background: var(--wp--preset--color--accent);
	transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.np-rdv__titre,
.np-rdv__confirmation-titre {
	margin: 6px 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--heading-block);
	line-height: 1.1;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__titre:focus {
	outline: none; /* Focus programmé pour les lecteurs d'écran, pas d'anneau visuel. */
}

/* ------------------------------------------------------------------ */
/* Questions, aides, erreurs                                           */
/* ------------------------------------------------------------------ */

.np-rdv__groupe {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.np-rdv__question {
	padding: 0 0 2px;
	font-weight: 500;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--contrast);
}

.np-rdv__precision {
	font-weight: 400;
	font-size: var(--wp--preset--font-size--small);
}

.np-rdv__requis {
	color: var(--wp--preset--color--accent);
}

.np-rdv__aide {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__aide--apres {
	margin-top: -16px;
}

.np-rdv__erreur {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--accent);
}

.np-rdv__alerte {
	padding: 12px 16px;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: var(--np-rayon-champ);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 6%, var(--wp--preset--color--white));
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.np-rdv__note {
	margin-top: -16px;
	padding: 12px 16px;
	border-radius: var(--np-rayon-champ);
	background: var(--wp--preset--color--peach);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
}

/* ------------------------------------------------------------------ */
/* Boutons de choix                                                    */
/* ------------------------------------------------------------------ */

.np-rdv__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.np-rdv__option {
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--np-trait);
	border-radius: var(--np-rayon-pastille);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color var(--np-transition), border-color var(--np-transition), color var(--np-transition);
}

.np-rdv__option:hover:not(:disabled) {
	border-color: var(--wp--preset--color--contrast);
}

.np-rdv__option[aria-pressed="true"] {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--white);
}

.np-rdv__option:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.np-rdv__groupe--grande .np-rdv__options {
	gap: 10px;
}

.np-rdv__groupe--grande .np-rdv__option {
	min-height: 48px;
	padding: 0 26px;
	font-weight: 500;
}

/* Tuiles des prestations, avec icône. */
.np-rdv__groupe--tuile .np-rdv__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
	gap: 10px;
}

.np-rdv__groupe--tuile .np-rdv__option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 10px 14px;
	border-radius: var(--np-rayon-champ);
	font-weight: 500;
	text-align: left;
}

.np-rdv__groupe--tuile .np-rdv__option[aria-pressed="true"] {
	background: var(--wp--preset--color--peach);
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 0 0 1px var(--wp--preset--color--contrast);
}

.np-rdv__icone {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
}

/* ------------------------------------------------------------------ */
/* Champs de saisie                                                    */
/* ------------------------------------------------------------------ */

.np-rdv__grille {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 16px;
}

.np-rdv__champ {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.np-rdv__label {
	font-weight: 500;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

.np-rdv__label--question {
	font-size: var(--wp--preset--font-size--medium);
}

.np-rdv__label--petit {
	font-weight: 400;
}

.np-rdv__saisie {
	width: 100%;
	min-height: 50px;
	padding: 0 16px;
	border: 1px solid var(--np-trait);
	border-radius: var(--np-rayon-champ);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: 1rem; /* 16 px : évite le zoom automatique d'iOS. */
	transition: border-color var(--np-transition);
}

.np-rdv__saisie--longue {
	min-height: 120px;
	padding: 12px 16px;
	resize: vertical;
	line-height: 1.5;
}

.np-rdv__saisie:hover {
	border-color: var(--np-trait-fort);
}

.np-rdv__saisie[aria-invalid="true"] {
	border-color: var(--wp--preset--color--accent);
}

.np-rdv__date {
	display: grid;
	grid-template-columns: 1fr 1.6fr;
	gap: 12px;
	max-width: 360px;
}

.np-rdv__case {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-top: 4px;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	cursor: pointer;
}

.np-rdv__case input {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--wp--preset--color--accent);
}

/* ------------------------------------------------------------------ */
/* Photos                                                              */
/* ------------------------------------------------------------------ */

.np-rdv__photos {
	gap: var(--wp--preset--spacing--10, 0.5rem);
}

.np-rdv__depot {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 72px;
	padding: 20px;
	border: 1.5px dashed color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent);
	border-radius: var(--np-rayon-champ);
	background: color-mix(in srgb, var(--wp--preset--color--peach) 45%, var(--wp--preset--color--white));
	cursor: pointer;
	transition: border-color var(--np-transition), background-color var(--np-transition);
}

.np-rdv__depot:hover {
	border-color: var(--wp--preset--color--accent);
}

/* Anneau de focus sur la zone quand le champ fichier (invisible) a le focus clavier. */
.np-rdv__depot:has(.np-rdv__fichier:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.np-rdv__depot-icone {
	flex: 0 0 28px;
	color: var(--wp--preset--color--accent);
}

.np-rdv__depot-texte {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.np-rdv__depot-texte strong {
	font-weight: 500;
	color: var(--wp--preset--color--accent);
}

/* Zone en pointillés avec deux boutons de même largeur : appareil photo et galerie. */
.np-rdv__depot--capture {
	flex-direction: column;
	align-items: stretch;
	gap: var(--wp--preset--spacing--20, 1rem);
	cursor: default;
	container-type: inline-size; /* Les boutons s'empilent selon la largeur de la zone (≈ 340 px d'écran). */
}

.np-rdv__depot-aide {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__capture {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--10, 0.5rem);
}

.np-rdv__capture-bouton {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 64px;
	padding: 10px 8px;
	border: 1px solid var(--np-trait-fort);
	border-radius: var(--np-rayon-bouton);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color var(--np-transition), border-color var(--np-transition);
}

.np-rdv__capture-bouton--appareil {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.np-rdv__capture-bouton:hover {
	background: var(--wp--preset--color--peach);
}

.np-rdv__capture-bouton svg {
	flex: none;
}

/* Zone étroite (écran de moins de 340 px environ) : les deux boutons s'empilent. */
@container (max-width: 230px) {
	.np-rdv__capture {
		grid-template-columns: 1fr;
	}
}

/* Champ fichier relié à un bouton par « for » : hors écran mais focalisable. */
.np-rdv__fichier-cache {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.np-rdv__depot--capture:has(.np-rdv__fichier-cache:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Aperçu encadré (une photo par emplacement). */
.np-rdv__apercu--cadre {
	padding: 10px;
	border: 1.5px dashed color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent);
	border-radius: var(--np-rayon-champ);
	background: color-mix(in srgb, var(--wp--preset--color--peach) 45%, var(--wp--preset--color--white));
}

.np-rdv__apercu--cadre .np-rdv__retirer {
	top: 14px;
	right: 14px;
}

/* Indicateur de chargement sur un bouton désactivé pendant une requête. */
.np-chargement {
	position: relative;
	padding-left: 44px;
	cursor: progress;
	opacity: 0.85;
}

.np-chargement::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -9px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: np-rotation 0.8s linear infinite;
}

@keyframes np-rotation {
	to { transform: rotate(360deg); }
}

/* Champ fichier : visuellement masqué mais focalisable (pas de display: none). */
.np-rdv__fichier {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.np-rdv__apercus {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.np-rdv__apercu {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.np-rdv__apercu-image {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--np-rayon-champ);
	background: var(--wp--preset--color--base);
}

.np-rdv__apercu-nom {
	overflow: hidden;
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__retirer {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--np-rayon-pastille);
	background: color-mix(in srgb, var(--wp--preset--color--white) 90%, transparent);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.np-rdv__retirer:hover,
.np-rdv__retirer:focus-visible {
	background: var(--wp--preset--color--pink); /* Bouton blanc : survol rose (règle 62). */
}

/* Sans aperçu (HEIC hors Safari) : le bouton se place à côté du nom. */
.np-rdv__apercu:has(.np-rdv__apercu-image[hidden]) {
	align-self: start;
	flex-direction: row;
	align-items: center;
	min-height: 52px;
	padding: 4px 4px 4px 14px;
	border: 1px solid var(--np-trait);
	border-radius: var(--np-rayon-champ);
}

.np-rdv__apercu:has(.np-rdv__apercu-image[hidden]) .np-rdv__apercu-nom {
	flex: 1;
}

.np-rdv__apercu:has(.np-rdv__apercu-image[hidden]) .np-rdv__retirer {
	position: static;
}

/* ------------------------------------------------------------------ */
/* Encarts                                                             */
/* ------------------------------------------------------------------ */

.np-rdv__encart {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
	border-radius: var(--np-rayon-champ);
}

.np-rdv__encart--peche {
	background: var(--wp--preset--color--peach);
}

.np-rdv__encart--base {
	gap: 12px;
	background: var(--wp--preset--color--base);
}

.np-rdv__encart--rose {
	padding: 22px;
	background: var(--wp--preset--color--pink);
}

.np-rdv__encart-titre,
.np-rdv__avantage-titre {
	font-weight: 500;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__liste {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}

.np-rdv__details summary {
	cursor: pointer;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--accent);
}

.np-rdv__details p {
	margin-top: 10px;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}

.np-rdv__avantages-titre {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--heading-sub);
	line-height: 1.1;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__avantages {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
	gap: 14px;
}

.np-rdv__avantage {
	padding: 14px;
	border-radius: var(--np-rayon-champ);
	background: color-mix(in srgb, var(--wp--preset--color--white) 60%, transparent);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.np-rdv__avantage-titre {
	margin-bottom: 4px;
}

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

.np-rdv__navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: 22px;
	border-top: 1px solid var(--np-trait);
}

.np-rdv__bouton {
	min-height: 52px;
	padding: 0 22px;
	border-radius: var(--np-rayon-bouton);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color var(--np-transition), border-color var(--np-transition), color var(--np-transition), opacity var(--np-transition);
}

.np-rdv__bouton--retour {
	border: 1px solid var(--np-trait-fort);
	background: transparent;
	color: var(--wp--preset--color--contrast);
}

.np-rdv__bouton--retour:hover {
	border-color: var(--wp--preset--color--contrast);
}

.np-rdv__bouton--suivant {
	margin-left: auto;
	padding: 0 30px;
	border: 1px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
}

/* Survol et focus : règle globale du thème (wp-element-button), aucune couleur propre ici. */

/* Bloc étroit (mobile, colonne) : boutons pleine largeur, l'action principale en premier. */
@container (max-width: 400px) {
	.np-rdv__navigation {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.np-rdv__bouton--suivant {
		margin-left: 0;
	}
}

/* Étape incomplète : bouton atténué mais cliquable, le clic montre ce qui manque. */
.np-rdv__bouton--suivant[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
}

.np-rdv__bouton--suivant:disabled {
	cursor: progress;
}

.np-rdv__mention {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--ink);
}

.np-rdv__mention a {
	color: var(--wp--preset--color--accent);
}

/* ------------------------------------------------------------------ */
/* Confirmation                                                        */
/* ------------------------------------------------------------------ */

.np-rdv__confirmation {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 24px 0;
	text-align: center;
}

.np-rdv__confirmation:focus {
	outline: none;
}

.np-rdv__illustration {
	width: auto;
	height: 140px;
}

.np-rdv__confirmation-titre {
	margin: 0;
}

.np-rdv__confirmation-message {
	max-width: 44ch;
	line-height: 1.6;
}

.np-rdv__signature {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--heading-small);
	color: var(--wp--preset--color--accent);
}

/* ------------------------------------------------------------------ */
/* Accessibilité                                                       */
/* ------------------------------------------------------------------ */

.np-rdv button:focus-visible,
.np-rdv input:focus-visible,
.np-rdv select:focus-visible,
.np-rdv textarea:focus-visible,
.np-rdv summary:focus-visible,
.np-rdv a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.np-rdv__lecteur {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.np-rdv__piege {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.np-rdv *,
	.np-rdv *::before,
	.np-rdv *::after {
		transition: none !important;
		animation: none !important;
	}

	.np-chargement::before {
		border-right-color: currentColor;
		opacity: 0.5;
	}
}
