:root {
  --encre: #1d2433;
  --discret: #5b6475;
  --fond: #f6f7f9;
  --carte: #ffffff;
  --trait: #dfe3ea;
  --accent: #2554c7;
  --accent-fonce: #1b3f99;
  --succes: #1f7a4d;
  --succes-fond: #e8f5ee;
  --erreur: #b3261e;
  --erreur-fond: #fdecea;
  --info-fond: #eef3fd;
  --demo-fond: #fff6db;
  --rayon: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--encre);
  background: var(--fond);
  line-height: 1.5;
}

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

html, body { margin: 0; overflow-x: hidden; }

body { font-size: 16px; }

a { color: var(--accent); }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }

small { display: block; color: var(--discret); font-size: 0.8rem; font-weight: normal; }

.bandeau-prototype {
  background: #222b3a;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  text-align: center;
}

.entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--carte);
  border-bottom: 1px solid var(--trait);
}

.marque { font-weight: 700; color: var(--encre); text-decoration: none; }
.marque small { display: inline; margin-left: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.entete nav { display: flex; gap: 1rem; }
.entete nav a { text-decoration: none; font-weight: 600; }

main { max-width: 980px; margin: 0 auto; padding: 1rem; }

.pied { max-width: 980px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--discret); font-size: 0.8rem; }

.intro p { margin: 0.5rem 0; }

.testeur {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--info-fond);
  border-radius: var(--rayon);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.discret { color: var(--discret); font-size: 0.85rem; }

.alerte { padding: 0.75rem; border-radius: var(--rayon); margin: 0 0 1rem; font-size: 0.92rem; overflow-wrap: anywhere; }
.alerte-apporteur { background: var(--succes-fond); border: 1px solid #b9e0ca; display: flex; flex-direction: column; gap: 0.15rem; }
.alerte-info { background: var(--info-fond); border: 1px solid #cbd8f5; }
.alerte-succes { background: var(--succes-fond); border: 1px solid #b9e0ca; }
.alerte-erreur { background: var(--erreur-fond); border: 1px solid #f3c3be; color: var(--erreur); }
.alerte-demo { background: var(--demo-fond); border: 1px solid #f0dc9a; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; }

.grille { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.carte {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.carte h3 { margin: 0 0 0.25rem; }
.carte h3 a { color: var(--encre); text-decoration: none; }
.carte .bouton { margin-top: auto; }

.prestataire { color: var(--discret); margin: 0 0 0.5rem; font-size: 0.9rem; }
.prix { font-size: 1.15rem; font-weight: 700; margin: 0.25rem 0 0.5rem; }
.prix small { display: inline; }

.creneaux-compacts { list-style: none; padding: 0; margin: 0 0 1rem; font-size: 0.88rem; }
.creneaux-compacts li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--trait); }
.creneaux-compacts li.complet { color: var(--discret); }
.creneaux-compacts li.complet .places { color: var(--erreur); font-weight: 600; }
.creneaux-compacts li.autres { color: var(--discret); border-bottom: 0; }
.creneaux-compacts .places { text-align: right; white-space: nowrap; }

.bouton {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--rayon);
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.bouton:hover { background: var(--accent-fonce); }
.bouton.secondaire { background: var(--carte); color: var(--accent); border: 1px solid var(--accent); }
form.reservation .bouton, .formulaire-paiement .bouton { width: 100%; }

.fil { margin: 0 0 0.5rem; font-size: 0.9rem; }

.fiche, .paiement, .confirmation, .bloc {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 1rem;
  margin-bottom: 1rem;
}

fieldset { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }

.creneau {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0.6rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.creneau input { grid-row: span 2; width: 1.15rem; height: 1.15rem; margin: 0; }
.creneau .quand { font-weight: 600; }
.creneau .places { font-size: 0.85rem; color: var(--discret); }
.creneau:has(input:checked) { border-color: var(--accent); background: var(--info-fond); }
.creneau.complet { background: #eceef2; color: #8a91a0; cursor: not-allowed; }
.creneau.complet .places { color: var(--erreur); font-weight: 700; }

.compteur { display: flex; align-items: stretch; gap: 0.5rem; max-width: 14rem; }
.compteur button {
  width: 3rem;
  font-size: 1.3rem;
  border: 1px solid var(--trait);
  background: var(--carte);
  border-radius: var(--rayon);
  cursor: pointer;
}
.compteur input { flex: 1; min-width: 0; text-align: center; font-size: 1.1rem; }

input[type="text"], input[type="email"], input[type="number"] {
  font: inherit;
  padding: 0.6rem;
  border: 1px solid #c4cad6;
  border-radius: var(--rayon);
  width: 100%;
  background: #fff;
}

label { display: block; margin-bottom: 0.75rem; font-weight: 600; }
label input[type="text"], label input[type="email"], label input[type="number"] { margin-top: 0.25rem; }
label.choix { font-weight: normal; display: flex; gap: 0.5rem; align-items: flex-start; }
label.choix input { margin-top: 0.3rem; }

.total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
  padding: 0.75rem;
  margin: 0 0 1rem;
  background: var(--fond);
  border-radius: var(--rayon);
}
.total strong { font-size: 1.4rem; }
.total small { flex-basis: 100%; }

.recap { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; }
.recap dt { color: var(--discret); }
.recap dd { margin: 0; overflow-wrap: anywhere; }

table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--discret); white-space: nowrap; }
td.nombre, td[data-montant], td[data-apercu] { text-align: right; white-space: nowrap; }
tr.complet td { color: var(--discret); }
tr.complet td.places { color: var(--erreur); font-weight: 700; }

.defilement { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

.ventilation th small, .apercu th small { margin-top: 0.15rem; }
.ventilation .ligne-paye th, .ventilation .ligne-paye td { font-weight: 700; font-size: 1rem; }
.ventilation .ligne-prestataire td { font-weight: 700; }
.ventilation tfoot th, .ventilation tfoot td { border-bottom: 0; font-size: 0.82rem; }
.controle-ok td { color: var(--succes); font-weight: 700; }
.controle-ko td { color: var(--erreur); font-weight: 700; }
.apercu .ligne-paye td, .apercu .ligne-plateforme td { font-weight: 700; }
.non-enregistre { color: #8a5a00; }
.nouvelle { color: var(--succes); font-weight: 700; }

meter { width: 4.5rem; vertical-align: middle; }

.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.chiffres div { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 0.75rem; }
.chiffres strong { display: block; font-size: 1.15rem; }
.chiffres span { color: var(--discret); font-size: 0.82rem; }

.reglages { display: grid; gap: 0 1rem; }
.en-ligne { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

@media (min-width: 700px) {
  h1 { font-size: 1.8rem; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reglages { grid-template-columns: 1fr 1fr; }
  .reglages fieldset, .reglages .bouton { grid-column: 1 / -1; }
  .reglages .bouton { justify-self: start; }
}

@media (min-width: 980px) {
  .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
