/**
 * LE FORMULAIRE DE RESERVATION, VIVANT (2026-11-06).
 * Voir assets/js/reservation-saisie.js et includes/class-reservation-saisie.php.
 * Complete reservation-formulaire.css sans le remplacer. Couleurs : jetons.css.
 * Animations : transform et opacity seulement.
 *
 * @package Restaurant_Manager
 */

/* Les etapes arrivent l'une apres l'autre. */
@keyframes rm-rtb-entree {
	from { opacity: 0; transform: translateY( 14px ); }
	to { opacity: 1; transform: translateY( 0 ); }
}

.rtb-booking-form fieldset {
	animation: rm-rtb-entree 0.5s var( --rm-courbe-sortie ) both;
}

.rtb-booking-form fieldset:nth-of-type( 2 ) {
	animation-delay: 0.08s;
}

.rtb-booking-form fieldset:nth-of-type( 3 ) {
	animation-delay: 0.16s;
}

/* Une etape terminee prend une coche verte a cote de son titre. */
.rtb-booking-form fieldset.rm-rtb-etape--faite > legend::after {
	content: "✓";
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	margin-left: 10px;
	border-radius: var( --rm-rayon-pastille );
	background-color: var( --rm-succes );
	color: var( --rm-creme );
	font-family: var( --rm-fa-texte, "Geist", system-ui, sans-serif );
	font-size: 0.8rem;
	font-weight: 700;
	vertical-align: middle;
	animation: rm-rtb-coche 0.35s var( --rm-courbe-sortie );
}

@keyframes rm-rtb-coche {
	from { opacity: 0; transform: scale( 0.4 ); }
	to { opacity: 1; transform: scale( 1 ); }
}

/* ================================================================
 * LE NOMBRE DE PERSONNES, D'UN TOUCHER
 * ============================================================= */

.rm-rtb-personnes {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 8px;
	margin: 0 0 10px;
}

.rm-rtb-personne {
	min-height: 52px;
	padding: 0 6px;
	border: 1px solid var( --rm-trait-net );
	border-radius: var( --rm-rayon-grand );
	background-color: var( --rm-creme );
	color: var( --rm-brun );
	font: inherit;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: transform var( --rm-duree-reponse ) var( --rm-courbe ), background-color var( --rm-duree-reponse ) var( --rm-courbe ), color var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-rtb-personne:hover {
	transform: translateY( -2px );
}

.rm-rtb-personne:active {
	transform: scale( 0.94 );
}

.rm-rtb-personne:focus-visible {
	outline: var( --rm-focus-epaisseur ) solid var( --rm-focus-couleur );
	outline-offset: var( --rm-focus-ecart );
}

.rm-rtb-personne[aria-pressed="true"] {
	border-color: var( --rm-terracotta );
	background-color: var( --rm-terracotta );
	color: var( --rm-creme );
	box-shadow: var( --rm-elevation-2 );
}

.rm-rtb-personne--plus {
	font-size: 0.95rem;
}

/* Le menu de l'extension : cache tant qu'un bouton suffit, ouvert pour 8 et plus. */
/* !important : les regles des champs de reservation-formulaire.css (largeur, hauteur, marges) passaient devant. */
.rtb-booking-form select.rm-rtb-menu-cache,
body.rm-fa-page .rtb-booking-form select.rm-rtb-menu-cache {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
	clip: rect( 0 0 0 0 ) !important;
	white-space: nowrap;
}

.rtb-booking-form select.rm-rtb-menu-ouvert {
	animation: rm-rtb-entree 0.3s var( --rm-courbe-sortie );
}

/* ================================================================
 * LE RESUME, AU-DESSUS DU BOUTON
 * ============================================================= */

.rm-rtb-resume {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 14px;
	padding: 14px 16px;
	border: 1px dashed var( --rm-trait-net );
	border-radius: var( --rm-rayon-grand );
	background-color: var( --rm-creme );
	color: var( --rm-brun );
	transition: background-color var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-rtb-resume__table {
	font-size: 1.1rem;
	font-weight: 700;
}

.rm-rtb-resume__reste {
	color: var( --rm-texte-doux );
	font-size: 0.92rem;
}

.rm-rtb-resume--pret {
	border-style: solid;
	border-color: var( --rm-succes );
}

.rm-rtb-resume--pret .rm-rtb-resume__reste {
	color: var( --rm-succes );
	font-weight: 600;
}

/* ================================================================
 * APRES L'ENVOI : C'EST RESERVE
 * ============================================================= */

/*
 * La phrase de l'extension est reprise par la carte : on ne la dit pas deux
 * fois. Et le cadre du formulaire, vide apres l'envoi, ne laisse plus sa
 * frise seule sous la carte (vu par l'exploitant le 2026-11-07).
 */
.rm-resa-merci + .rtb-booking-form {
	display: none !important;
}

.rm-resa-merci {
	/* La largeur du cadre du formulaire (760 px, mesure) : la carte prend sa place. */
	box-sizing: border-box;
	width: 100%;
	max-width: 760px;
	margin: 0 auto 24px;
	padding: 32px clamp( 18px, 4vw, 40px ) 28px;
	/* Le theme met le texte de la page a 22 px : la carte fixe sa propre echelle. */
	font-family: var( --rm-fa-texte, "Geist", system-ui, sans-serif );
	font-size: 16px;
	line-height: 1.5;
	border: 1px solid var( --rm-trait );
	border-top: 6px solid var( --rm-succes );
	border-radius: var( --rm-rayon-grand );
	background-color: var( --rm-creme-chaud );
	color: var( --rm-brun );
	text-align: center;
	box-shadow: var( --rm-elevation-3 );
	scroll-margin-top: 120px;
	animation: rm-rtb-entree 0.55s var( --rm-courbe-sortie ) both;
}

.rm-resa-merci:focus {
	outline: none;
}

.rm-resa-merci--attente {
	border-top-color: var( --rm-terracotta-vif );
}

.rm-resa-merci__coche {
	display: inline-grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 10px;
	border-radius: var( --rm-rayon-pastille );
	background-color: var( --rm-succes );
	color: var( --rm-creme );
	font-size: 26px;
	font-weight: 700;
	animation: rm-rtb-coche 0.5s var( --rm-courbe-sortie ) 0.2s both;
}

.rm-resa-merci--attente .rm-resa-merci__coche {
	background-color: var( --rm-terracotta-vif );
}

.rm-resa-merci__surtitre {
	margin: 0 0 6px !important;
	color: var( --rm-terracotta-sombre );
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.rm-resa-merci__titre {
	margin: 0 0 8px !important;
	font-family: var( --rm-fa-titre, "Instrument Serif", Georgia, serif );
	font-size: clamp( 24px, 20px + 1vw, 30px );
	font-weight: 500;
	line-height: 1.2;
	text-wrap: balance;
}

.rm-resa-merci__phrase,
.rm-resa-merci__suite,
.rm-resa-merci__tel {
	max-width: 52ch;
	margin: 0 auto 12px !important;
	color: var( --rm-texte-doux );
	font-size: 15px !important;
	line-height: 1.55;
}

.rm-resa-merci__tel {
	font-size: 14px !important;
}

.rm-resa-merci__fiche {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 8px;
	margin: 16px 0 14px;
	text-align: left;
}

.rm-resa-merci__fiche div {
	padding: 10px 14px;
	border-radius: var( --rm-rayon-doux );
	background-color: var( --rm-creme );
}

.rm-resa-merci__fiche dt {
	color: var( --rm-texte-doux );
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rm-resa-merci__fiche dd {
	margin: 2px 0 0;
	color: var( --rm-brun );
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.rm-resa-merci__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 6px 0 14px;
}

.rm-resa-merci__bouton {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	font-size: 14px;
	border: 1px solid var( --rm-terracotta );
	border-radius: var( --rm-rayon-pastille );
	color: var( --rm-terracotta-sombre ) !important;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-resa-merci__bouton:hover {
	transform: translateY( -2px );
}

.rm-resa-merci__bouton:active {
	transform: scale( 0.97 );
}

.rm-resa-merci__bouton:focus-visible {
	outline: var( --rm-focus-epaisseur ) solid var( --rm-focus-couleur );
	outline-offset: var( --rm-focus-ecart );
}

.rm-resa-merci__bouton--plein {
	background-color: var( --rm-terracotta );
	color: var( --rm-creme ) !important;
}

@media ( max-width: 640px ) {

	.rm-resa-merci__fiche {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( prefers-reduced-motion: reduce ) {

	.rtb-booking-form fieldset,
	.rtb-booking-form fieldset.rm-rtb-etape--faite > legend::after,
	.rm-resa-merci,
	.rm-resa-merci__coche,
	.rtb-booking-form select.rm-rtb-menu-ouvert {
		animation: none;
	}
}
