/* Page de réservation — réutilise les tokens de styles.css. */
:root { --accent: #1f4eea; --accent-soft: #eef2ff; }
.book-body { background: var(--surface); }
.book { max-width: 980px; margin: 0 auto; padding: clamp(14px, 3vw, 28px); }

/* En-tête */
.book-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
  margin: 0 calc(-1 * clamp(14px, 3vw, 28px)) var(--s-3);
  padding: 10px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease;
}
.book-head.scrolled {
  background: var(--glass-bg, rgba(255, 255, 255, 0.72));
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(10, 10, 10, 0.05);
}
.book-head .seller-logo { height: 52px; transition: height 0.25s ease; }
.book-head.scrolled .seller-logo { height: 44px; }
.seller-logo { height: 80px; width: auto; display: block; }
.seller-fallback { font-weight: 700; font-size: 1.05rem; }
.prefs { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.seg button {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border: none; background: none; color: var(--muted);
}
.seg button.active { background: var(--ink); color: #fff; }
.seg.sm button { padding: 8px 18px; }

/* Bandeau carte bancaire */
.cc-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #d4ddfb; border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: var(--s-3); margin-top: var(--s-3);
  font-size: 0.88rem; color: var(--ink-2);
}
.cc-banner .cc-ico { height: 26px; flex: none; }
.cc-banner #cc-text { flex: 1; min-width: 160px; }
.cc-banner .cc-cards { display: inline-flex; gap: 6px; }
.cc-banner .cc-cards img { height: 26px; }
.cc-banner .btn-sm { background: var(--accent); border-color: var(--accent); }
.cc-banner .btn-sm:hover { background: #173dc0; }
.cc-link { text-decoration: none; text-align: center; }

/* Disposition principale */
.book-main { display: grid; grid-template-columns: 1fr 320px; gap: var(--s-3); align-items: start; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 28px); }
#ev-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.ev-meta { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.ev-desc { color: var(--ink-2); font-size: 0.92rem; margin-top: var(--s-2); }
.ev-closes { font-size: 0.85rem; color: var(--muted); margin-top: var(--s-2); }

/* Indicateur d'étapes : pastilles numérotées + connecteurs */
.steps { display: flex; align-items: center; list-style: none; margin: var(--s-4) 0 var(--s-5); padding: 0; }
.steps li { display: flex; align-items: center; flex: 1; }
.steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 6px; }
.steps li .num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.82rem; font-weight: 700; background: var(--bg); color: var(--muted);
  border: 2px solid var(--line); transition: all 0.2s ease; flex: none;
}
.steps li.done .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps li.done:not(:last-child)::after { background: var(--accent); }
.steps li.active .num { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.step-title { font-size: 1.1rem; font-weight: 700; margin-bottom: var(--s-3); }

/* Tickets */
.ticket {
  display: flex; align-items: center; gap: 14px; padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}
.ticket:last-child { border-bottom: none; }
.ticket .info { flex: 1; min-width: 0; }
.ticket .t-name { font-weight: 700; font-size: 0.98rem; }
.ticket .t-dist { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.ticket .t-note { color: var(--muted); font-size: 0.76rem; margin-top: 4px; font-style: italic; }
.ticket .t-price { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button {
  width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer;
  background: #2aa7e0; color: #fff; font-size: 1.2rem; line-height: 1; font-weight: 700;
}
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .qty { min-width: 18px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.relay-select { font: inherit; font-weight: 600; cursor: pointer; padding: 8px 16px; border: 1px solid #2aa7e0; color: #2aa7e0; background: var(--bg); border-radius: 9px; }
.relay-select.active { background: #2aa7e0; color: #fff; }

.closed-notice { padding: var(--s-4); text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-sm); }

/* Formulaire */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-3); }
.field.span2 { grid-column: 1 / -1; }
.field-label.req::after { content: " *"; color: #c0392b; }
select, input[type="date"] { width: 100%; font: inherit; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); }
select:focus, input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.06); }
.phone-row { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.phone-row .cc { width: 110px; flex: none; }
.phone-row .grow { flex: 1; }
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: var(--s-3); flex-wrap: wrap; }
.terms { display: flex; align-items: flex-start; gap: 10px; margin-top: var(--s-3); font-size: 0.88rem; color: var(--ink-2); }
.terms input { width: 18px; height: 18px; margin-top: 2px; }
.terms a { color: var(--ink); font-weight: 600; }

/* Récap */
/* top calé sous le header sticky (hauteur ~72px) + marge, pour ne pas passer dessous. */
.summary-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-3); position: sticky; top: 88px; }
.summary-card h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: var(--s-2); }
.summary-lines { font-size: 0.88rem; }
.summary-lines .sl { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; color: var(--ink-2); }
.summary-lines .empty { color: var(--muted); }
.summary-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-2); font-weight: 700; }
.disclaimer { font-size: 0.72rem; color: var(--muted); margin-top: var(--s-3); line-height: 1.5; }

/* Navigation */
.nav-row { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.nav-row .btn { flex: 1; }
.step-error { color: #c0392b; font-weight: 600; font-size: 0.85rem; margin-top: var(--s-2); }

/* Paiement */
.pay-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: var(--s-3); font-size: 0.9rem; }
.pay-status { margin-top: var(--s-3); text-align: center; }
.small { font-size: 0.8rem; }
.msisdn-preview { margin-top: 6px; font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.msisdn-preview.ok { color: #0f7a52; }
.msisdn-preview.bad { color: #c0392b; }

/* Pied : confiance + partenaire */
.book-foot { margin-top: var(--s-4); padding: var(--s-4) var(--s-3); border-top: 1px solid var(--line); text-align: center; }
.trust-strip { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.trust-strip img { height: 32px; }
.trust-strip .ic { height: 24px; }
.tech-line { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: var(--s-3); color: var(--muted); font-size: 0.82rem; }
.tech-logo { height: 20px; width: auto; }

/* OTP / PIN modal */
.pin-modal { text-align: center; }
.pin-head { display: flex; justify-content: center; margin-bottom: var(--s-2); }
.pin-logo { height: 30px; }
.pin-title { font-size: 1.05rem; font-weight: 700; }
.req-star { color: #c0392b; }
.pin-boxes { display: flex; justify-content: center; gap: 10px; margin: var(--s-3) 0 var(--s-2); }
.pin-box {
  width: 52px; height: 60px; text-align: center; font-size: 1.6rem; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
  padding: 0; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.pin-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pin-help { color: var(--muted); font-size: 0.84rem; }
.pin-confirm { background: var(--accent); border-color: var(--accent); }
.pin-confirm:hover:not(:disabled) { background: #173dc0; }

/* Écran de succès */
.success-wrap { grid-column: 1 / -1; display: grid; place-items: center; padding: clamp(20px, 6vw, 60px) 0; }
.success-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 6vw, 48px); max-width: 460px; width: 100%; text-align: center; }
.success-check { width: 64px; height: 64px; margin: 0 auto var(--s-3); border-radius: 50%; background: #15a06a; color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.success-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.success-msg { color: var(--ink-2); margin-top: var(--s-2); }
.success-meta { color: var(--muted); font-size: 0.84rem; margin-top: var(--s-1); }
.success-actions { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-4); }
.success-actions .btn { text-decoration: none; }
.success-trust { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.success-trust img { height: 24px; }

@media (max-width: 800px) {
  .book-main { grid-template-columns: 1fr; }
  .summary-card { position: static; order: -1; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

/* --- Se souvenir du participant --- */
.remember-box {
  margin-top: var(--s-3); padding: var(--s-3); text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.remember-title { font-weight: 700; font-size: 0.95rem; }
.remember-why { color: var(--ink-2); font-size: 0.84rem; margin: 6px 0 var(--s-2); line-height: 1.5; }
.remember-actions { display: flex; gap: 8px; }
.remember-actions .btn { width: auto; flex: 1; }
.remember-done { color: #0f7a52; font-weight: 700; font-size: 0.86rem; margin-top: 4px; }

.remember-load {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  margin: var(--s-3) 0; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent, #1f4eea); background: var(--accent-soft, #eef2ff);
}
.rl-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; min-width: 0; }
.rl-text strong { font-size: 0.95rem; }
.rl-phone { color: var(--muted); font-size: 0.8rem; }
/* Deux boutons égaux sur toute la largeur (.btn-sm n'existe que dans l'admin). Côte à côte quand
   ils tiennent ; sinon chacun passe sur toute la largeur (libellés FR plus longs sur mobile). */
.rl-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.rl-actions .btn { flex: 1 1 140px; width: auto; padding: 10px 14px; font-size: 0.9rem; white-space: nowrap; }

/* --- Don caritatif (upsell) --- */
.donation-block { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: var(--s-3); margin-bottom: var(--s-3); }
.don-toggle { display: flex; align-items: center; gap: 9px; font-weight: 700; cursor: pointer; }
.don-toggle input { width: 18px; height: 18px; flex: none; }
.don-text { color: var(--ink-2); font-size: 0.86rem; margin-top: 8px; line-height: 1.5; }
.don-options { margin-top: var(--s-3); }
.don-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.don-preset { font: inherit; font-weight: 700; font-size: 0.9rem; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; transition: border-color 0.12s ease; }
.don-preset:hover { border-color: var(--ink); }
.don-preset.active { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.don-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--bg); }
.don-cur { color: var(--muted); font-weight: 700; }
.don-custom input { border: none; background: none; padding: 10px 0; width: 100%; }
.don-custom input:focus { outline: none; box-shadow: none; border: none; }

/* --- Résumé paiement (avec don) --- */
.ps-items { color: var(--ink-2); font-size: 0.88rem; }
.ps-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 0.9rem; color: var(--ink-2); }
.ps-total { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 1rem; }

/* Autres coureurs (panier qty > 1) — accordéon */
.extra-runners { margin-top: 18px; }
.extra-h { font-size: 1rem; font-weight: 800; margin: 6px 0 10px; }
.extra-card { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.extra-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; cursor: pointer; padding: 12px 14px; font: inherit; color: var(--ink); text-align: left; }
.extra-badge { background: var(--ink); color: var(--bg); font-weight: 800; border-radius: 999px; padding: 2px 10px; font-size: .8rem; flex: none; }
.extra-title { font-weight: 700; flex: none; }
.extra-name { color: var(--muted); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extra-chev { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .18s ease; }
.extra-card.open .extra-chev { transform: rotate(180deg); }
.extra-body { padding: 0 14px 14px; }

/* Encaissement espèces (agent) */
.cash-block { margin-top: 16px; }
.cash-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 10px 0; }
.cash-sep::before, .cash-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cash-btn { width: 100%; }
