/* Feuille de Booking : neutre, polices du système, thème du système. */
:root {
  color-scheme: light dark;
  --page: #f3f4f6;
  --fond: #ffffff;
  --texte: #1a1d21;
  --discret: #4b5563;
  --estompe: #6b7280;
  --bord: #d7dbe0;
  --bord-champ: #6b7280;
  --accent: #1d4ed8;
  --accent-texte: #ffffff;
  --accent-doux: #e8efff;
  --accent-doux-texte: #1e3a8a;
  --danger: #b91c1c;
  --danger-texte: #ffffff;
  --succes: #15803d;
  --succes-doux: #e7f6ec;
  --info-fond: #f1f3f5;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --rayon: .75rem;
  --rayon-petit: .5rem;
  --duree: 120ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1014;
    --fond: #161a20;
    --texte: #e5e7eb;
    --discret: #a1a8b3;
    --estompe: #8b93a1;
    --bord: #2c333d;
    --bord-champ: #7b8494;
    --accent: #7cb2ff;
    --accent-texte: #0b1220;
    --accent-doux: #1e2a40;
    --accent-doux-texte: #cfe0ff;
    --danger: #ff8a8a;
    --danger-texte: #1a0505;
    --succes: #6ee7a0;
    --succes-doux: #13291d;
    --info-fond: #1c2128;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--texte);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

main { padding: 1.5rem 1rem 3rem; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 1.25rem; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: .15em; }
.discret, .note { color: var(--discret); }
.note { font-size: .95rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

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

/* Mise en page : colonne centrée, carte principale sur fond contrasté. */
.page { max-width: 36rem; margin: 0 auto; }
.page-large { max-width: 48rem; }
.carte {
  background: var(--fond);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.5rem;
}
.carte > :last-child { margin-bottom: 0; }
.pied { margin: 1rem 0 0; text-align: center; font-size: .9rem; }
.pied a { color: var(--discret); }

.bandeau {
  max-width: 36rem;
  margin: 0 auto 1rem;
  padding: .75rem 1rem;
  background: var(--fond);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--accent);
  border-radius: var(--rayon-petit);
  box-shadow: var(--ombre);
}
.bandeau p { margin: 0; }
.bandeau-large { max-width: 48rem; }

/* En-tête : qui reçoit, durée, fuseau. */
.entete { display: flex; gap: 1rem; align-items: flex-start; margin: 0 0 1.25rem; padding: 0 .25rem; }
.monogramme {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-texte);
  font-size: 1.25rem; font-weight: 700;
}
.entete-texte { min-width: 0; }
.entete-nom { font-size: 1.125rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.entete-intro { color: var(--discret); margin: .125rem 0 0; }
.entete-infos {
  list-style: none; margin: .375rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .125rem 1.25rem;
  color: var(--discret); font-size: .9rem;
}

/* Boutons et champs. */
button,
.bouton,
select,
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  min-height: 44px;
  padding: .5rem .875rem;
  font: inherit;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bord-champ);
  border-radius: var(--rayon-petit);
}
button,
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-width: 44px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-texte);
  border-color: var(--accent);
  transition: background-color var(--duree), color var(--duree), border-color var(--duree), box-shadow var(--duree);
}
button:hover:not(:disabled), .bouton:hover { box-shadow: 0 0 0 3px var(--accent-doux); }
.bouton-secondaire { background: var(--fond); color: var(--accent); border-color: var(--bord-champ); }
.bouton-secondaire:hover { border-color: var(--accent); }
.bouton-danger { background: var(--danger); color: var(--danger-texte); border-color: var(--danger); }
button:disabled { opacity: .6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .625rem; margin: 1.25rem 0 0; }

/* Calendrier : mois à gauche, heures du jour à droite (empilés sur mobile). */
.agenda { display: grid; gap: 1.5rem; }
.mois + .mois { margin-top: 1.5rem; }
.mois-tete { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .5rem; }
.mois-titre { margin: 0; font-size: 1.1rem; }
.mois-titre::first-letter { text-transform: uppercase; }
.mois-fleche {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; text-decoration: none;
  color: var(--accent);
  transition: background-color var(--duree);
}
a.mois-fleche:hover { background: var(--accent-doux); }
.mois-fleche.inactive { color: var(--estompe); opacity: .45; }
.calendrier { width: 100%; table-layout: fixed; border-collapse: collapse; }
.calendrier th {
  padding: 0 0 .375rem; font-size: .8rem; font-weight: 600;
  color: var(--discret); text-align: center;
}
.calendrier td { padding: 1px 0; text-align: center; }
.jour {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 2.875rem; min-height: 2.75rem; aspect-ratio: 1;
  border-radius: 50%;
  color: var(--estompe);
  font-variant-numeric: tabular-nums;
}
.jour-libre {
  background: var(--accent-doux);
  color: var(--accent-doux-texte);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--duree), color var(--duree);
}
.jour-libre:hover { background: var(--accent); color: var(--accent-texte); }
.jour-choisi, .jour-choisi:hover,
.jour-defaut-ancre, .jour-defaut-ancre:hover { background: var(--accent); color: var(--accent-texte); }
/* Formulaire conservé, sans script : dès qu'un autre jour est ciblé, le jour par défaut n'est plus
   mis en avant (le script, lui, déplace la classe .jour-choisi). */
@supports selector(:has(*)) {
  .agenda-ancres:has(.jour-heures:target) .jour-defaut-ancre:not(.jour-choisi) { background: var(--accent-doux); color: var(--accent-doux-texte); }
  .agenda-ancres:has(.jour-heures:target) .jour-defaut-ancre:not(.jour-choisi):hover { background: var(--accent); color: var(--accent-texte); }
}
.jour-choisi-vide { box-shadow: inset 0 0 0 2px var(--estompe); }
.aujourdhui::after {
  content: ""; position: absolute; bottom: .3rem; left: 50%;
  width: .3rem; height: .3rem; margin-left: -.15rem; border-radius: 50%;
  background: currentColor;
}

.jour-titre { margin: 0 0 .75rem; font-size: 1.05rem; }
.jour-titre::first-letter { text-transform: uppercase; }
.fuseau-visiteur { margin: -.5rem 0 .75rem; font-size: .85rem; color: var(--discret); }
.heures {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
}
.heures li, .heures form { margin: 0; }
.heure {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.heure:hover:not(:disabled), .heure:focus-visible { background: var(--accent); color: var(--accent-texte); box-shadow: none; }
.heure .autre-jour { font-size: .85rem; font-weight: 500; white-space: normal; line-height: 1.2; }
.aucun { color: var(--discret); }
.aucun p { margin: 0 0 .75rem; }

/* Jour masqué par le serveur (le script le montre au clic). */
.jour-heures[hidden] { display: none; }

/* Formulaire conservé : un seul jour visible, choisi par ancre. :has() reste seul dans un
   @supports et jamais dans une liste de sélecteurs : sans lui, :target reste valide, et le repli
   (jour par défaut toujours visible, plus le jour ciblé) laisse chaque jour atteignable. */
.agenda-ancres .jour-heures { display: none; }
.agenda-ancres .jour-heures:target { display: block; }
.agenda-ancres .jour-defaut { display: block; }
@supports selector(:has(*)) {
  .agenda-ancres .agenda-heures:has(.jour-heures:target) .jour-defaut:not(:target) { display: none; }
}

@media (min-width: 48rem) {
  .page-large .agenda { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; }
  /* La colonne prend la hauteur du calendrier et défile au-delà. */
  .page-large .agenda-heures {
    contain: size;
    overflow-y: auto;
    padding: .25rem .375rem .25rem 1.5rem;
    border-left: 1px solid var(--bord);
  }
  .page-large .heures { grid-template-columns: 1fr; }
}

/* Rappel du créneau : date et heure mises en avant. */
.rappel {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--accent-doux);
  color: var(--accent-doux-texte);
  border-radius: var(--rayon-petit);
}
.rappel-etiquette { margin: 0 0 .25rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.moment-date { margin: 0; font-size: 1.15rem; font-weight: 700; }
.moment-date time { display: inline-block; }
.moment-date time::first-letter { text-transform: uppercase; }
.moment-heure { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.moment-duree { font-size: 1rem; font-weight: 500; }
.rappel-lien { margin: .5rem 0 0; }
.rappel a { color: inherit; font-weight: 600; }
.recap { margin: .75rem 0 0; }
.recap dt { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.recap dd { margin: 0; }

.statut {
  display: inline-block; margin: 0 0 .5rem; padding: .125rem .625rem;
  border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--info-fond); color: var(--discret);
}
.statut-ok { background: var(--succes-doux); color: var(--succes); }
.etape { color: var(--discret); }

/* Pages de résultat. */
.resultat { text-align: center; }
.resultat .actions { justify-content: center; }
.etape-cle {
  margin: 0 0 1rem; padding: 1rem 1.25rem; text-align: left;
  background: var(--info-fond); border-radius: var(--rayon-petit);
}
.etape-cle p { margin: 0; }
.etape-cle .etape-titre { margin: 0 0 .25rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--discret); }
.icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.25rem; height: 3.25rem; margin: 0 0 .75rem; border-radius: 50%;
  font-size: 1.5rem; font-weight: 700;
  background: var(--accent-doux); color: var(--accent-doux-texte);
}
.icone-ok { background: var(--succes-doux); color: var(--succes); }
.icone-ok::before { content: "\2713"; }
.icone-envoi::before { content: "\2709\FE0E"; }
.icone-annule { background: var(--info-fond); color: var(--discret); }
.icone-annule::before { content: "\2715"; }
.texte h2 { margin-top: 1.75rem; }
.texte ul { padding-left: 1.25rem; }

/* Formulaire de réservation. */
.groupe { border: 0; margin: 0 0 1.5rem; padding: 0; min-inline-size: 0; }
.groupe legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin: 0 0 .75rem; }
.motifs { display: grid; gap: .5rem; }
.motif {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem 1rem; min-height: 44px;
  border: 1px solid var(--bord-champ); border-radius: var(--rayon-petit);
  cursor: pointer;
  transition: border-color var(--duree), background-color var(--duree), box-shadow var(--duree);
}
.motif:hover { border-color: var(--accent); }
.motif input { flex: none; width: 1.25rem; height: 1.25rem; margin: .125rem 0 0; accent-color: var(--accent); }
.motif:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-doux); }
.motif:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.motif-texte { display: grid; gap: .125rem; }
.motif-titre { font-weight: 600; }
.motif-desc { color: var(--discret); font-size: .9rem; }
.motif:has(input:checked) .motif-desc { color: var(--accent-doux-texte); }

.champ { display: block; margin: 0 0 1rem; }
.champ label { display: block; font-weight: 600; margin-bottom: .25rem; }
.champ input:not([type="checkbox"]):not([type="radio"]), .champ select, .champ textarea { width: 100%; }
.champ textarea { resize: vertical; }
.facultatif { font-weight: 400; color: var(--discret); }
.champ .aide { color: var(--discret); font-size: .9rem; margin: .25rem 0 0; }
.erreur-champ { color: var(--danger); font-weight: 600; margin: .25rem 0 0; }
.invalide { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.champs-cote { display: grid; }
@media (min-width: 40rem) {
  .champs-cote { grid-template-columns: 1fr 1fr; column-gap: 1rem; }
}
.champ-case { display: flex; gap: .625rem; align-items: flex-start; margin: 0 0 1rem; }
.champ-case input { flex: none; margin-top: .2rem; width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.mention { color: var(--discret); font-size: .875rem; }
.envoi { display: flex; flex-direction: column; gap: .5rem; margin: 1.5rem 0 0; }
.bouton-principal { width: 100%; padding-block: .75rem; }
.etat-verif { margin: 0; min-height: 1.25rem; font-size: .85rem; color: var(--discret); }
@media (min-width: 40rem) {
  .envoi { flex-direction: row; align-items: center; gap: 1rem; }
  .bouton-principal { width: auto; padding-inline: 1.5rem; }
}

.sans-js {
  padding: .75rem 1rem; margin: 0 0 1rem;
  background: var(--info-fond); border-left: 4px solid var(--danger);
  border-radius: var(--rayon-petit);
}

/* Champ piège : hors écran, jamais display:none (certains robots l'ignorent alors). */
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Petits écrans : marges de 16 px, calendrier presque bord à bord dans la carte. */
@media (max-width: 30rem) {
  main { padding: 1rem 1rem 2rem; }
  .carte { padding: 1.25rem 1rem; }
  .page-large .carte { padding-inline: .5rem; }
  .page-large .carte > :not(.agenda):not(form),
  .page-large .carte > form > :not(.agenda) { margin-inline: .5rem; }
  .page-large .agenda-heures { padding-inline: .5rem; }
  h1 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Page de visio (composants `ui`, S12-V3c) : seule page de Booking qui charge `ui.css`. Colonne
   centrée comme les autres pages ; la scène prend la largeur de sa colonne. */
main > .ui-entete, main > .ui-visio { max-width: 64rem; margin-inline: auto; }
main > .ui-entete { margin-bottom: 1rem; }
