/* ═══════════════════════════════════════════════════════════════════════
   EPICEL — Réservation en ligne
   Toutes les couleurs, polices et espacements sont repris du site via
   var(--x, fallback) : à l'intérieur de index.html les jetons existants
   s'appliquent ; sur les pages autonomes (annulation), les valeurs de
   repli prennent le relais. Aucun second design system.
   ═══════════════════════════════════════════════════════════════════════ */

.epb,
.epb * { box-sizing: border-box; }

.epb {
  --epb-cream: var(--cream, #f7eae6);
  --epb-beige: var(--beige, #f1d8d1);
  --epb-sand:  var(--sand,  #eac3b8);
  --epb-rose:  var(--rose,  #8E5872);
  --epb-dark:  var(--rose-dark, #7B4762);
  --epb-ink:   var(--ink,   #2A1C22);
  --epb-muted: var(--muted, #77606A);
  --epb-white: var(--white, #faf2f0);
  --epb-line:  var(--line,  rgba(150, 99, 76, .16));
  --epb-serif: var(--serif, 'Cormorant Garamond', Georgia, serif);
  --epb-sans:  var(--sans,  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif);
  --epb-r:     var(--radius, 3px);
  --epb-ease:  var(--ease, cubic-bezier(.22, .61, .36, 1));

  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--epb-sans);
  color: var(--epb-ink);
}
.epb[hidden] { display: none; }

.epb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 30, 22, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: epb-fade .28s var(--epb-ease);
}

.epb__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 94vh;
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  background: var(--epb-white);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 48px rgba(43, 30, 22, .18);
  animation: epb-rise .34s var(--epb-ease);
  overflow: hidden;
}

@media (min-width: 640px) {
  .epb { align-items: center; padding: 24px; }
  .epb__panel { border-radius: 4px; max-height: 88vh; animation: epb-pop .3s var(--epb-ease); }
}

@keyframes epb-fade { from { opacity: 0 } }
@keyframes epb-rise { from { transform: translateY(28px); opacity: 0 } }
@keyframes epb-pop  { from { transform: translateY(12px) scale(.985); opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  .epb__backdrop, .epb__panel { animation: none; }
}

/* ───────────────────────── En-tête ───────────────────────── */
.epb__head {
  flex: none;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--epb-line);
  background: var(--epb-cream);
}

.epb__grip {
  width: 38px; height: 4px;
  margin: -6px auto 12px;
  border-radius: 99px;
  background: var(--epb-sand);
}
@media (min-width: 640px) { .epb__grip { display: none } }

.epb__bar { display: flex; align-items: center; gap: 12px; }

.epb__title {
  flex: 1;
  margin: 0;
  font-family: var(--epb-serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 4.5vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: .01em;
}

.epb__close,
.epb__back {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--epb-line);
  border-radius: 50%;
  background: var(--epb-white);
  color: var(--epb-dark);
  cursor: pointer;
  transition: background .2s var(--epb-ease), border-color .2s var(--epb-ease);
}
.epb__close:hover, .epb__back:hover { background: var(--epb-beige); border-color: var(--epb-rose); }
.epb__back[hidden] { display: none; }

/* Fil des étapes */
.epb__steps { display: flex; gap: 6px; margin-top: 14px; }
.epb__steps i {
  flex: 1; height: 2px;
  background: var(--epb-sand);
  border-radius: 99px;
  transition: background .3s var(--epb-ease);
}
.epb__steps i.is-done { background: var(--epb-rose); }

.epb__sub {
  margin: 8px 0 0;
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--epb-muted);
}

/* ───────────────────────── Corps ───────────────────────── */
.epb__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 22px;
}

.epb__foot {
  flex: none;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--epb-line);
  background: var(--epb-cream);
}
.epb__foot[hidden] { display: none; }

/* ───────────────────────── Boutons ───────────────────────── */
.epb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  border: 1px solid var(--epb-dark);
  border-radius: var(--epb-r);
  background: var(--epb-dark);
  color: var(--epb-white);
  font-family: var(--epb-sans);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .22s var(--epb-ease), opacity .22s var(--epb-ease);
}
.epb-btn:hover:not(:disabled) { background: var(--epb-ink); border-color: var(--epb-ink); }
.epb-btn:disabled { opacity: .38; cursor: not-allowed; }
.epb-btn--ghost {
  background: transparent;
  color: var(--epb-dark);
  border-color: var(--epb-line);
}
.epb-btn--ghost:hover:not(:disabled) { background: var(--epb-beige); color: var(--epb-dark); border-color: var(--epb-rose); }

/* ───────────────────────── Étape 1 : soins ───────────────────────── */
.epb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--epb-beige);
  border-radius: var(--epb-r);
}
.epb-tabs button {
  flex: 1;
  padding: 10px 6px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--epb-muted);
  font-family: var(--epb-sans);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s var(--epb-ease), color .2s var(--epb-ease);
}
.epb-tabs button[aria-selected="true"] {
  background: var(--epb-white);
  color: var(--epb-dark);
  box-shadow: 0 1px 3px rgba(43, 30, 22, .07);
}

.epb-list { display: flex; flex-direction: column; gap: 8px; }

.epb-item {
  display: flex; align-items: baseline; gap: 14px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--epb-line);
  border-radius: var(--epb-r);
  background: var(--epb-white);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--epb-ease), background .2s var(--epb-ease);
}
.epb-item:hover { border-color: var(--epb-rose); background: var(--epb-cream); }
.epb-item--on {
  border-color: var(--epb-dark);
  background: var(--epb-cream);
  box-shadow: inset 0 0 0 1px var(--epb-dark);
}
.epb-item__tick {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 2px;
  border: 1px solid var(--epb-line);
  border-radius: 3px;
  background: var(--epb-white);
  font-family: var(--epb-sans);
  font-size: .8rem; line-height: 18px;
  text-align: center;
  color: var(--epb-dark);
}
.epb-item--on .epb-item__tick {
  border-color: var(--epb-dark);
  background: var(--epb-dark);
  color: var(--epb-white);
}
.epb-item__name {
  flex: 1;
  font-family: var(--epb-serif);
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--epb-ink);
}
.epb-item__meta {
  display: block;
  margin-top: 3px;
  font-family: var(--epb-sans);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--epb-muted);
}
.epb-item__price {
  flex: none;
  font-family: var(--epb-serif);
  font-size: 1.05rem;
  color: var(--epb-dark);
  white-space: nowrap;
}

/* ───────────────────────── Étape 2 : calendrier ───────────────────────── */
.epb-cal__nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.epb-cal__month {
  font-family: var(--epb-serif);
  font-size: 1.15rem;
  text-transform: capitalize;
}
.epb-cal__arrow {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--epb-line);
  border-radius: 50%;
  background: var(--epb-white);
  color: var(--epb-dark);
  cursor: pointer;
}
.epb-cal__arrow:disabled { opacity: .28; cursor: not-allowed; }

.epb-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.epb-cal__dow {
  padding: 6px 0;
  text-align: center;
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--epb-muted);
}
.epb-cal__day {
  aspect-ratio: 1;
  min-height: 40px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: var(--epb-r);
  background: transparent;
  font-family: var(--epb-sans);
  font-size: .9rem;
  color: var(--epb-ink);
  cursor: pointer;
  transition: background .18s var(--epb-ease), border-color .18s var(--epb-ease);
}
.epb-cal__day.is-free { background: var(--epb-beige); font-weight: 500; }
.epb-cal__day.is-free:hover { border-color: var(--epb-rose); }
/* Un jour sans créneau n'est JAMAIS un bouton actif. */
.epb-cal__day:disabled { color: var(--epb-sand); cursor: not-allowed; background: transparent; }
.epb-cal__day[aria-pressed="true"] {
  background: var(--epb-dark);
  border-color: var(--epb-dark);
  color: var(--epb-white);
}
.epb-cal__day.is-empty { visibility: hidden; }

.epb-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.epb-slot {
  padding: 13px 6px;
  border: 1px solid var(--epb-line);
  border-radius: var(--epb-r);
  background: var(--epb-white);
  font-family: var(--epb-sans);
  font-size: .92rem;
  color: var(--epb-ink);
  cursor: pointer;
  transition: border-color .18s var(--epb-ease), background .18s var(--epb-ease);
}
.epb-slot:hover { border-color: var(--epb-rose); background: var(--epb-cream); }
.epb-slot[aria-pressed="true"] { background: var(--epb-dark); border-color: var(--epb-dark); color: var(--epb-white); }

/* ───────────────────────── Étape 3 : formulaire ───────────────────────── */
.epb-field { margin-bottom: 15px; }
.epb-field label {
  display: block;
  margin-bottom: 6px;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--epb-muted);
}
.epb-field input,
.epb-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--epb-line);
  border-radius: var(--epb-r);
  background: var(--epb-white);
  font-family: var(--epb-sans);
  font-size: 16px;                      /* 16px : empêche le zoom auto sur iOS */
  color: var(--epb-ink);
  transition: border-color .2s var(--epb-ease);
}
.epb-field input:focus,
.epb-field textarea:focus { outline: none; border-color: var(--epb-rose); }
.epb-field textarea { min-height: 76px; resize: vertical; }
.epb-field--half { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.epb-field--half > div { margin: 0; }
.epb-hint { margin-top: 5px; font-size: .72rem; color: var(--epb-muted); }

.epb-check {
  display: flex; align-items: flex-start; gap: 11px;
  margin-bottom: 13px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--epb-muted);
  cursor: pointer;
}
.epb-check input {
  flex: none;
  width: 19px; height: 19px;
  margin-top: 1px;
  accent-color: var(--epb-dark);
}
.epb-check a { color: var(--epb-dark); }
.epb-check--marketing {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--epb-line);
  border-left: 4px solid var(--epb-rose);
  background: var(--epb-cream);
}

/* Piège à robots : invisible pour l'humaine, rempli par les scripts. */
.epb-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ───────────────────────── Récapitulatif ───────────────────────── */
.epb-recap {
  padding: 15px 17px;
  margin-bottom: 20px;
  border: 1px solid var(--epb-line);
  border-left: 2px solid var(--epb-rose);
  border-radius: var(--epb-r);
  background: var(--epb-cream);
}
.epb-recap dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; }
.epb-recap dt { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--epb-muted); }
.epb-recap dd { margin: 0; font-size: .94rem; color: var(--epb-ink); }
.epb-recap dd strong { font-family: var(--epb-serif); font-size: 1.06rem; font-weight: 400; }

/* ───────────────────────── Confirmation ───────────────────────── */
.epb-done { text-align: center; padding: 14px 0 4px; }
.epb-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: .68rem; letter-spacing: .2em;
  text-transform: uppercase; color: #3f7d55;
}
.epb-when {
  margin: 0 0 10px;
  font-family: var(--epb-serif); font-weight: 400;
  font-size: clamp(1.72rem, 7vw, 2.25rem); line-height: 1.2;
  color: var(--epb-ink);
}
/* Une seule colonne : sur un telephone, la reponse doit tenir sur une ligne. */
.epb-recap--done dl { grid-template-columns: 1fr; gap: 3px; }
.epb-recap--done dt { margin-top: 9px; }
.epb-recap--done dt:first-child { margin-top: 0; }
.epb-recap--done dd { font-size: .92rem; }
.epb-what { margin: 0 0 20px; font-size: .88rem; color: var(--epb-muted); }
.epb-recap--done { border-left-color: #3f7d55; }
.epb-advice {
  margin: -8px 0 18px; font-size: .8rem; line-height: 1.65;
  color: var(--epb-muted); text-align: left;
}
.epb-done__mark {
  width: 62px; height: 62px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border: 1px solid var(--epb-rose);
  border-radius: 50%;
  color: var(--epb-dark);
}
.epb-done h3 {
  margin: 0 0 10px;
  font-family: var(--epb-serif);
  font-weight: 400;
  font-size: 1.5rem;
}
.epb-done p { margin: 0 0 18px; font-size: .9rem; line-height: 1.65; color: var(--epb-muted); }
.epb-done .epb-recap { text-align: left; }

/* ───────────────────────── États ───────────────────────── */
.epb-msg {
  padding: 13px 15px;
  margin-bottom: 15px;
  border-radius: var(--epb-r);
  font-size: .85rem;
  line-height: 1.55;
}
.epb-msg--err  { background: #f6e8e4; color: #8a3d24; border: 1px solid #e9c2b7; }
.epb-msg--info { background: var(--epb-beige); color: var(--epb-dark); }

.epb-empty {
  padding: 34px 18px;
  text-align: center;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--epb-muted);
}

.epb-load { display: grid; place-items: center; padding: 40px 0; }
.epb-load i {
  width: 26px; height: 26px;
  border: 1.5px solid var(--epb-sand);
  border-top-color: var(--epb-dark);
  border-radius: 50%;
  animation: epb-spin .7s linear infinite;
}
@keyframes epb-spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .epb-load i { animation-duration: 2.4s } }

/* Accessibilité : le focus reste toujours visible. */
.epb :focus-visible {
  outline: 2px solid var(--epb-dark);
  outline-offset: 2px;
}

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

/* Verrouille le défilement de la page derrière le panneau. */
body.epb-open { overflow: hidden; }
