/* ==========================================================================
   Agenda Étienne Dangien — système visuel
   Clair, contraste bleu Miami. L'heure est l'objet principal.
   ========================================================================== */

:root {
  --ink:        #0A1A2F;
  --ink-2:      #55687F;
  --ink-3:      #8A9BB0;
  --blue:       #0091FF;
  --blue-deep:  #0063C4;
  --blue-wash:  #E6F2FF;
  --coral:      #FF5A5F;
  --coral-wash: #FFECEC;
  --paper:      #FFFFFF;
  --wash:       #F2F6FA;
  --line:       #DCE6F0;

  --r-sm: 8px;
  --r:    13px;
  --r-lg: 20px;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --shadow:    0 1px 2px rgba(10, 26, 47, .05), 0 4px 14px rgba(10, 26, 47, .05);
  --shadow-lg: 0 10px 40px rgba(10, 26, 47, .16);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-deep); }

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Primitives typographiques ------------------------------------------ */

.eyebrow {
  font-family: var(--display);
  font-variation-settings: "wdth" 112, "wght" 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.heure {                      /* la signature : chiffres larges et lourds */
  font-family: var(--display);
  font-variation-settings: "wdth" 118, "wght" 800;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}

.enveloppe {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Boutons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r);
  background: var(--blue);
  color: #fff;
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .12s var(--ease);
}
.btn:hover  { background: var(--blue-deep); }
.btn:active { transform: scale(.98); }

.btn--fantome {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn--fantome:hover { background: var(--paper); border-color: var(--ink-3); color: var(--ink); }

.btn--danger { background: var(--coral); }
.btn--danger:hover { background: #E23F44; }

.btn--large { width: 100%; min-height: 54px; font-size: 16px; }

/* --- Messages flash ----------------------------------------------------- */

.flashs { margin: 16px 0 0; }
.flash {
  display: flex;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r);
  border-left: 4px solid var(--blue);
  background: var(--blue-wash);
  color: var(--blue-deep);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 10px;
}
.flash--erreur { border-color: var(--coral); background: var(--coral-wash); color: #B3282D; }
.flash--succes { border-color: var(--blue); }

/* ==========================================================================
   VUE CLIENT
   ========================================================================== */

.entete {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 30px 0 26px;
}
.entete__nom {
  font-family: var(--display);
  font-variation-settings: "wdth" 116, "wght" 800;
  font-size: clamp(30px, 8.5vw, 46px);
  line-height: .98;
  letter-spacing: -.025em;
  margin: 0;
}
.entete__metier {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}
.entete__regle {
  height: 4px;
  width: 56px;
  background: var(--blue);
  border-radius: 2px;
  margin: 0 0 18px;
}

/* Le compteur d'ouvertures : la rareté est l'information principale */
.compteur {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 10px;
}
.compteur__nombre {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 800;
  font-size: 42px;
  line-height: 1;
  color: var(--blue);
}
.compteur__texte { font-size: 15px; color: var(--ink-2); max-width: 22ch; }

.jours { padding: 4px 0 120px; }

.jour { margin-top: 34px; }

.jour__barre {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.jour__nom {
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.jour__trait { flex: 1; height: 1px; background: var(--line); }
.jour__compte { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

.grille-creneaux {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.creneau {
  position: relative;
  padding: 18px 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--blue-deep);
  font-size: 25px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s, transform .12s var(--ease);
}
.creneau:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  transform: translateY(-2px);
}
.creneau:active { transform: translateY(0) scale(.97); }

.vide {
  margin-top: 40px;
  padding: 44px 26px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  text-align: center;
}
.vide__titre {
  font-family: var(--display);
  font-variation-settings: "wdth" 112, "wght" 700;
  font-size: 20px;
  margin: 0 0 8px;
}
.vide p { color: var(--ink-2); margin: 0; }

/* --- Feuille de réservation --------------------------------------------- */

.voile {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 47, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 40;
}
.voile[data-ouvert="1"] { opacity: 1; pointer-events: auto; }

.feuille {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--paper);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .32s var(--ease);
  max-height: 92vh;
  overflow-y: auto;
}
.feuille[data-ouvert="1"] { transform: translateY(0); }

.feuille__poignee {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 6px auto 20px;
}

.feuille__quand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.feuille__heure { font-size: 38px; color: var(--blue); line-height: 1; }
.feuille__date  { font-size: 15px; color: var(--ink-2); }

.champ { margin-bottom: 14px; }
.champ label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.champ input, .champ select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--wash);
  transition: border-color .15s, background .15s;
}
.champ input:focus, .champ select:focus {
  border-color: var(--blue);
  background: var(--paper);
  outline: none;
}
.champ--duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.feuille__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* Pop-up de confirmation, au-dessus de la feuille */
.popup {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 26, 47, .62);
}
.popup[data-ouvert="1"] { display: flex; animation: apparait .2s ease; }
@keyframes apparait { from { opacity: 0; } }

.popup__boite {
  width: 100%;
  max-width: 380px;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 30px 26px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: monte .3s var(--ease);
}
@keyframes monte { from { transform: translateY(14px) scale(.97); opacity: 0; } }

.popup__question {
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 600;
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.popup__heure { font-size: 46px; color: var(--blue); line-height: 1; margin-bottom: 6px; }
.popup__date  { font-size: 16px; margin-bottom: 8px; }
.popup__qui   { font-size: 14px; color: var(--ink-2); margin: 0 0 26px; }
.popup__actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }

/* --- Page de confirmation (pleine page, fond blanc) --------------------- */

.validation {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.validation__inner { max-width: 460px; width: 100%; }

.coche {
  width: 62px; height: 62px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: var(--blue);
  display: grid;
  place-items: center;
  animation: pop .45s var(--ease) both;
}
.coche svg { width: 30px; height: 30px; stroke: #fff; stroke-width: 3.4; fill: none;
             stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.validation__titre {
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 600;
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 18px;
  letter-spacing: .01em;
}
.validation__heure {
  font-size: clamp(64px, 21vw, 104px);
  line-height: .9;
  color: var(--blue);
  margin-bottom: 10px;
}
.validation__date {
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: clamp(19px, 5.4vw, 25px);
  margin: 0 0 30px;
}
.validation__consigne {
  padding: 20px 22px;
  background: var(--wash);
  border-radius: var(--r);
  border-left: 4px solid var(--blue);
  text-align: left;
  font-size: 15.5px;
  line-height: 1.45;
}
.validation__consigne strong { font-weight: 600; }
.validation__client {
  margin: 26px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}
.validation__retour { margin-top: 28px; display: inline-block; font-size: 14.5px; }

@media (min-width: 640px) {
  .feuille {
    left: 50%;
    bottom: auto;
    top: 50%;
    right: auto;
    width: 440px;
    border-radius: var(--r-lg);
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: transform .3s var(--ease), opacity .2s;
    padding: 26px 28px 28px;
  }
  .feuille[data-ouvert="1"] { transform: translate(-50%, -50%); opacity: 1; }
  .feuille__poignee { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
