/**
 * Style du formulaire de réservation Bistrot — charte Stella Padel Society.
 * Basilic #003F2D (identité globale), Crème #FFF3DE (fonds clairs).
 */

.stella-resa-form {
	max-width: 480px;
	margin: 0 auto;
}

.stella-resa-form p {
	margin-bottom: 16px;
}

.stella-resa-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.stella-resa-form input,
.stella-resa-form select,
.stella-resa-form textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 16px;
	box-sizing: border-box;
}

.stella-resa-etape-titre {
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #666;
	margin-bottom: 16px;
}

/* Honeypot anti-robot (voir class-securite.php) : positionné hors de
   l'écran plutôt qu'en display:none/visibility:hidden. Ces deux
   propriétés sont les toutes premières que les robots un peu évolués
   savent détecter pour ignorer le champ ; le décalage hors-écran
   trompe davantage de robots basiques tout en restant invisible et
   inatteignable au clavier (tabindex="-1" posé côté HTML) pour un
   humain. */
.stella-resa-honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
}

/* --- Civilité / Service : groupes de radios présentés en boutons toggle --- */

.stella-resa-civilite-label,
.stella-resa-service-label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.stella-resa-civilite-options,
.stella-resa-service-options {
	display: flex;
	gap: 10px;
}

.stella-resa-civilite-option,
.stella-resa-service-option {
	display: flex !important;
	flex: 1;
	flex-direction: row !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-weight: 600 !important;
	margin-bottom: 0 !important;
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Le radio natif reste présent (accessibilité, validation native), mais
   visuellement caché : c'est le <label> englobant qui prend l'aspect
   "bouton". :has() est supporté par tous les navigateurs modernes. */
.stella-resa-civilite-option input,
.stella-resa-service-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.stella-resa-civilite-option:has( input:checked ),
.stella-resa-service-option:has( input:checked ) {
	background: #002a1f;
	border-color: #002a1f;
	color: #fff3de;
}

.stella-resa-civilite-option:has( input:focus-visible ),
.stella-resa-service-option:has( input:focus-visible ) {
	outline: 2px solid #002a1f;
	outline-offset: 2px;
}

.stella-resa-checkbox-option {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 8px;
	font-weight: 600 !important;
	margin-bottom: 0 !important;
	cursor: pointer;
}

.stella-resa-checkbox-option input {
	width: auto;
}

.stella-resa-checkbox-option:has( input:disabled ) {
	opacity: 0.45;
	cursor: default;
}

.stella-resa-ligne-double {
	display: flex;
	gap: 16px;
}

.stella-resa-ligne-double p {
	flex: 1;
	min-width: 0;
}

.stella-resa-recap {
	background: #f5f5f5;
	padding: 12px 14px;
	border-radius: 4px;
	font-size: 14px;
	margin-bottom: 20px;
}

.stella-resa-form .description {
	display: block;
	font-size: 13px;
	color: #777;
	margin-top: 4px;
}

.stella-resa-ferme {
	padding: 16px;
	border-radius: 4px;
	background: #f5f5f5;
	text-align: center;
}

.stella-resa-message {
	padding: 12px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 15px;
}

.stella-resa-message--succes {
	background: #d4edda;
	color: #155724;
}

.stella-resa-message--erreur {
	background: #f8d7da;
	color: #721c24;
}

/* --- Boutons --- */

.stella-resa-bouton-principal,
.stella-resa-bouton-secondaire {
	padding: 14px 26px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	transition: background 0.15s ease;
}

.stella-resa-bouton-principal {
	border: none;
	background: #002a1f;
	color: #fff3de;
}

.stella-resa-bouton-principal:hover {
	background: #003f2d;
}

.stella-resa-bouton-principal:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Bouton "Réserver" (déclencheur de la modale) : identité visuelle
   propre, distincte des boutons internes du formulaire ci-dessus —
   couleurs et typographie de marque Stella Padel Society. */
.stella-resa-bouton-ouvrir {
	display: block;
	width: fit-content;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 10px 20px;
	border: 2px solid #FF4300; /* Spritz */
	border-radius: 3px;
	cursor: pointer;
	font-family: 'Obviously-extended', sans-serif;
	font-weight: 700;
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-align: left;
	color: #FFF3DE; /* Crème */
	background: #FF4300; /* Spritz */
	transition: background 0.15s ease, opacity 0.15s ease;
}

.stella-resa-bouton-ouvrir:hover {
	background: #002A20; /* Basilic Foncé */
}

.stella-resa-bouton-ouvrir:disabled {
	opacity: 0.6;
	cursor: default;
}

.stella-resa-bouton-secondaire {
	border: 1px solid #003f2d;
	background: transparent;
	color: #003f2d;
}

.stella-resa-bouton-secondaire:hover {
	background: #f5f5f0;
}

.stella-resa-actions {
	display: flex;
	margin-top: 8px;
}

.stella-resa-actions--droite {
	justify-content: flex-end;
}

.stella-resa-actions--entre {
	justify-content: space-between;
}

/* --- Modale --- */

.stella-resa-modale {
	position: fixed;
	inset: 0;
	/* Doit passer au-dessus de tout élément du thème, y compris les
	   méga-menus Divi qui peuvent avoir un z-index élevé. */
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
}

.stella-resa-modale-fond {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.stella-resa-modale-boite {
	position: relative;
	background: #fff;
	border-radius: 8px;
	padding: 40px 32px 32px;
	max-width: 520px;
	width: 90%;
	max-height: 85vh;
	overflow-y: auto;
}

/* Calendrier Flatpickr, positionnement dynamique standard (frère de
   la modale dans <body>) : z-index suffit pour passer au-dessus. */
.flatpickr-calendar {
	z-index: 2147483647 !important;
}

.stella-resa-modale-fermer {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	z-index: 1;
}

/* --- Écran de confirmation (après succès) --- */

.stella-resa-confirmation {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 220px;
	padding-top: 24px;
	gap: 20px;
}

.stella-resa-confirmation .stella-resa-message--succes {
	text-align: center;
	font-size: 16px;
	margin-bottom: 0;
}

.stella-resa-confirmation .stella-resa-bouton-fermer-succes {
	width: 100%;
	text-align: center;
}

/* --- Responsive : Tablette (≤768px) --- */

@media ( max-width: 768px ) {
	.stella-resa-modale-boite {
		width: 94%;
		padding: 32px 24px 24px;
	}
}

/* --- Responsive : Mobile (≤480px) --- */

@media ( max-width: 480px ) {
	/* La boîte centrée avec marge perdue tout autour fait sens sur
	   desktop, mais grignote un espace précieux sur un petit écran :
	   passage en quasi plein écran, avec juste un peu d'air en haut/bas
	   pour ne pas coller aux bords physiques de l'appareil. */
	.stella-resa-modale-boite {
		width: 100%;
		max-width: none;
		max-height: 92vh;
		border-radius: 8px 8px 0 0;
		padding: 28px 18px 20px;
	}

	.stella-resa-modale {
		align-items: flex-end;
	}

	.stella-resa-etape-titre {
		font-size: 13px;
	}

	/* Empilés en pleine largeur plutôt que côte à côte : évite que
	   "Confirmer la réservation" se resserre, et agrandit la zone
	   tactile de chaque bouton (recommandation d'accessibilité : 44px
	   minimum). L'ordre visuel (Confirmer au-dessus de Retour) suit
	   l'ordre de lecture naturel pour l'action principale du bas d'écran. */
	.stella-resa-actions--entre {
		flex-direction: column-reverse;
		gap: 10px;
	}

	.stella-resa-actions--entre .stella-resa-bouton-principal,
	.stella-resa-actions--entre .stella-resa-bouton-secondaire {
		width: 100%;
		text-align: center;
		padding: 14px 20px;
	}

	/* Sécurité anti-débordement si jamais un écran est particulièrement
	   étroit (< 360px) avec des libellés personnalisés plus longs que
	   "Madame"/"Monsieur" ou "Midi"/"Soir". */
	.stella-resa-civilite-options,
	.stella-resa-service-options {
		flex-wrap: wrap;
	}

	/* Zone tactile minimale recommandée (44px) : la valeur demandée
	   (10px de rembourrage haut/bas) reste un peu courte sur mobile une
	   fois combinée à la taille de police, on la complète ici plutôt
	   que de toucher au style de base validé pour desktop. */
	.stella-resa-bouton-ouvrir {
		padding: 13px 20px;
		width: 100%;
		max-width: 320px;
	}

	/* Prénom/Nom repassent en pile sur mobile : côte à côte, chaque
	   champ deviendrait trop étroit pour rester confortable à remplir
	   au clavier tactile. */
	.stella-resa-ligne-double {
		flex-direction: column;
		gap: 0;
	}
}