:root {
  --fond: #f6f5f9;
  --carte: #ffffff;
  --texte: #1d1b26;
  --doux: #6b6880;
  --bord: #e3e1ec;
  --accent: #6d28d9;
  --accent-clair: #ede9fe;
  --pris: #e5e7eb;
  --erreur: #b91c1c;
  --ok: #15803d;
  --rayon: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.5;
}

.entete {
  background: #17132a;
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}
.entete h1 { margin: 0.25rem 0 0.5rem; font-size: 1.9rem; }
.surtitre { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: #c4b5fd; }
.intro { margin: 0 auto; max-width: 34rem; color: #d6d3e6; }

.bandeau {
  max-width: 44rem;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--rayon);
  font-size: 0.9rem;
}

main { max-width: 44rem; margin: 0 auto; padding: 1.25rem; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.carte h2 { margin: 0 0 1rem; font-size: 1.15rem; display: flex; align-items: center; gap: 0.6rem; }
.etape {
  display: inline-grid; place-items: center;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.9rem;
}

.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 34rem) { .ligne { grid-template-columns: 1fr; } }

.champ { display: block; margin-bottom: 1rem; }
.champ span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.champ small { font-weight: 400; color: var(--doux); }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bord);
  border-radius: 8px;
  background: #fff;
  color: var(--texte);
}
input:focus, select:focus, textarea:focus, .heure:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.invalide { border-color: var(--erreur); }

.legende { font-size: 0.8rem; color: var(--doux); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: 0 0 0.75rem; }
.pastille { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; vertical-align: -1px; margin-right: 0.2rem; }
.pastille.dispo { background: var(--accent-clair); border: 1px solid #c4b5fd; }
.pastille.pris { background: var(--pris); }
.pastille.trop-tot { background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 3px, #e5e7eb 3px, #e5e7eb 6px); }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.5rem;
}
.heure {
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.6rem 0;
  border-radius: 8px;
  border: 1px solid #c4b5fd;
  background: var(--accent-clair);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.heure:hover:not(:disabled) { background: #ddd6fe; }
.heure.choisie { background: var(--accent); border-color: var(--accent); color: #fff; }
.heure.dans-plage { background: #c4b5fd; color: #2e1065; }
.heure:disabled { cursor: not-allowed; color: #9ca3af; border-color: transparent; font-weight: 400; }
.heure.pris { background: var(--pris); text-decoration: line-through; }
.heure.trop-tot { background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 3px, #e5e7eb 3px, #e5e7eb 6px); }

.aide { color: var(--doux); font-size: 0.9rem; margin: 0.75rem 0 0; min-height: 1em; }
.resume { margin: 0.75rem 0 0; font-weight: 600; color: var(--accent); min-height: 1.5em; }

.erreur {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--erreur);
  padding: 0.75rem 1rem;
  border-radius: var(--rayon);
}

.bouton {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem;
  border: 0;
  border-radius: var(--rayon);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.bouton:hover:not(:disabled) { background: #5b21b6; }
.bouton:disabled { opacity: 0.6; cursor: wait; }
.bouton.secondaire { background: #fff; color: var(--accent); border: 1px solid var(--accent); margin-top: 1.25rem; }

.merci { text-align: center; padding: 2rem 1.25rem; }
.merci h2 { justify-content: center; font-size: 1.4rem; }
.coche {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #dcfce7; color: var(--ok);
  font-size: 1.8rem; font-weight: 700;
}
