/* PASS2RENT — démo EUDI Wallet. Identité visuelle alignée sur le site (pass2rent-web) :
   bleu électrique #0F52FF + navy #030039, Open Sans, coins 12–20px, ombres douces + glow,
   glassmorphism léger, animations subtiles. */

:root {
  --blue: #0F52FF;
  --blue-700: #0a3ec2;
  --navy: #030039;
  --indigo: #4f46e5;
  --purple: #a855f7;
  --blue-tint: rgba(15, 82, 255, .10);
  --blue-faint: rgba(15, 82, 255, .05);

  --ink: #030039;          /* titres */
  --text: #2b2f44;         /* corps */
  --muted: #6b7280;        /* secondaire */
  --line: #e9edf6;         /* bordures */
  --surface: #ffffff;
  --bg: #f5f8ff;

  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --sh-1: 0 1px 3px rgba(3, 0, 57, .06), 0 1px 2px rgba(3, 0, 57, .04);
  --sh-card: 0 12px 26px -10px rgba(3, 0, 57, .14), 0 4px 8px -4px rgba(3, 0, 57, .06);
  --sh-lift: 0 24px 40px -14px rgba(3, 0, 57, .22), 0 8px 16px -8px rgba(3, 0, 57, .10);
  --glow: 0 12px 24px -6px rgba(15, 82, 255, .42);

  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Sinon .qr-zone/.banner { display:flex } écrase l'attribut HTML `hidden` (même spécificité, auteur > UA). */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 540px at 88% -8%, var(--blue-faint), transparent 60%),
    radial-gradient(900px 520px at -6% 8%, rgba(79, 70, 229, .06), transparent 62%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* Décor d'ambiance */
.bg-decor { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blob { position: absolute; width: 460px; height: 460px; border-radius: 50%; filter: blur(70px); opacity: .22; }
.blob-a { top: -160px; right: -120px; background: radial-gradient(circle, var(--blue), transparent 70%); animation: float 16s ease-in-out infinite; }
.blob-b { bottom: -200px; left: -140px; background: radial-gradient(circle, var(--purple), transparent 70%); opacity: .16; animation: float 20s ease-in-out infinite reverse; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(26px) } }

/* Header */
.topbar { max-width: 760px; margin: 0 auto; padding: 30px 22px 8px; }
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { height: 26px; width: auto; display: block; }
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: var(--r-pill); }
.badge-soft { color: var(--blue); background: var(--blue-tint); border: 1px solid rgba(15, 82, 255, .18); }
.tagline { margin: 14px 0 0; color: var(--muted); font-size: 15px; max-width: 56ch; }

/* Layout */
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 22px 56px; display: flex; flex-direction: column; gap: 18px; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 24px; animation: fade-in .5s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* Réservation */
.booking { display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg, #fff, #fbfcff); }
.car-badge { flex: 0 0 auto; width: 84px; height: 64px; display: grid; place-items: center; background: var(--blue-tint); border-radius: var(--r); }
.booking-info h1 { margin: 0; font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.muted-inline { color: var(--muted); font-weight: 600; }
.route { margin: 4px 0 2px; font-size: 14.5px; }
.route strong { color: var(--ink); }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.mono, .mono * { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* Stepper */
.stepper { list-style: none; display: flex; align-items: center; gap: 6px; margin: 2px 0; padding: 0; }
.step-ind { display: flex; align-items: center; gap: 9px; flex: 1; color: var(--muted); font-size: 13px; font-weight: 600; }
.step-ind .dot { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid var(--line); color: var(--muted); font-weight: 800; font-size: 13px; transition: all .25s ease; }
.step-ind:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.step-ind.active .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.step-ind.done .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.step-ind.active, .step-ind.done { color: var(--ink); }

/* Étapes — état VERROUILLÉ (l'étape précédente n'est pas terminée).
   Best practice : ne pas se contenter d'un grisé ; affordance explicite (cadenas + raison),
   contenu dimmé mais lisible, et `inert` (JS) retire l'interaction/le focus proprement. */
.step.is-locked { position: relative; overflow: hidden; pointer-events: none; }
.step.is-locked > * { opacity: .5; }                 /* dim le contenu, pas le bandeau (pseudo) */
.step.is-locked .step-n { background: #e7ebf5; color: var(--muted); box-shadow: none; }
.step.is-locked::before {
  content: "🔒 Locked — complete the step above to unlock";
  display: block; margin: -24px -24px 18px; padding: 10px 16px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: var(--muted);
  background: var(--blue-faint); border-bottom: 1px solid var(--line);
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.step-head h2 { margin: 0; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.step-n { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(135deg, var(--blue), var(--indigo)); color: #fff; font-weight: 800; font-size: 15px; box-shadow: var(--glow); }
.muted { color: var(--muted); font-size: 14.5px; margin: 6px 0 16px; }
.small { font-size: 13px; }

/* Segmented control (source d'identité) */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--blue-faint); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.seg-btn { appearance: none; border: 0; background: transparent; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--muted); padding: 9px 16px; border-radius: 10px; transition: all .2s ease; display: inline-flex; align-items: center; gap: 7px; }
.seg-btn small { font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--blue-tint); color: var(--blue); }
.seg-btn.is-on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.seg-btn.is-on small { background: var(--blue); color: #fff; }

/* Boutons */
.btn { appearance: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15.5px; border-radius: var(--r); padding: 14px 22px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--glow); }
.btn-primary:not(:disabled):hover { background: var(--blue-700); transform: translateY(-2px); box-shadow: 0 18px 30px -8px rgba(15, 82, 255, .5); }

/* Panneau d'exigences */
.reqs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.req { display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.req-lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.req-ctl { display: flex; align-items: center; gap: 8px; }
.req-ctl input, .req-ctl select { font-family: inherit; font-size: 17px; font-weight: 800; color: var(--ink); border: 0; background: transparent; width: 100%; padding: 0; outline: none; }
.req-ctl input { -moz-appearance: textfield; }
.req-ctl input::-webkit-outer-spin-button, .req-ctl input::-webkit-inner-spin-button { opacity: .4; }
.req-ctl select { cursor: pointer; }
.unit { font-size: 13px; font-weight: 700; color: var(--muted); }
.always { font-size: 13px; color: var(--muted); margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); }
.chip-ok { color: #047857; background: rgba(16, 185, 129, .12); }
.chip-ok::before { content: "✓"; }

/* QR */
.qr-zone { display: flex; align-items: center; gap: 20px; margin-top: 18px; padding: 18px; background: var(--blue-faint); border: 1px solid var(--line); border-radius: var(--r); animation: fade-in .4s ease both; }
.qr-frame { flex: 0 0 auto; background: #fff; padding: 10px; border-radius: var(--r); box-shadow: var(--sh-1); border: 1px solid var(--line); }
.qr-frame img { display: block; width: 168px; height: 168px; border-radius: 6px; }
.qr-side .scan { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.spinner { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; border: 2px solid var(--blue-tint); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* Flux SAME-DEVICE (mobile / tactile) — on NE PEUT PAS scanner un QR avec le téléphone qui
   l'affiche : recommandation OpenID4VP = ouvrir le wallet par deep-link `openid4vp://`.
   Desktop = QR (cross-device) ; mobile = bouton « Open my wallet » + repli QR pour un autre écran.
   Le basculement est piloté par la classe body.sd (matchMedia, app.js). */
.wallet-cta, .qr-toggle { display: none; }
.wallet-cta { align-items: center; gap: 14px; text-decoration: none; background: var(--blue); color: #fff; border-radius: var(--r); padding: 15px 18px; box-shadow: var(--glow); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.wallet-cta:active { transform: scale(.985); }
.wallet-cta-ic { flex: 0 0 auto; font-size: 26px; line-height: 1; }
.wallet-cta-txt { display: flex; flex-direction: column; gap: 1px; }
.wallet-cta-txt strong { font-size: 16px; font-weight: 800; }
.wallet-cta-txt small { font-size: 12.5px; font-weight: 600; opacity: .85; }
.qr-toggle { appearance: none; border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--blue); padding: 6px 2px; cursor: pointer; align-self: flex-start; }
.qr-toggle:hover { text-decoration: underline; }

body.sd .qr-zone { flex-direction: column; align-items: stretch; text-align: left; gap: 14px; }
body.sd .qr-zone .scan { display: none; }              /* « Scan… » hors-sujet en same-device */
body.sd .qr-frame { display: none; }                   /* QR caché par défaut sur mobile */
body.sd .qr-zone.show-qr .qr-frame { display: block; align-self: center; }
body.sd .wallet-cta { display: flex; }
body.sd .qr-toggle { display: inline-block; }

/* Verdict */
.verdict { margin-top: 18px; animation: fade-in .4s ease both; }
.banner { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15.5px; padding: 13px 16px; border-radius: var(--r); margin-bottom: 14px; }
.banner.ok { color: #047857; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .3); }
.banner.fail { color: #b91c1c; background: rgba(239, 68, 68, .10); border: 1px solid rgba(239, 68, 68, .28); }
.banner.warn { color: #b45309; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .3); }

.checks { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); }
.chk { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 800; margin-top: 1px; }
.chk.ok { background: rgba(16, 185, 129, .15); color: #047857; }
.chk.no { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.chk.na { background: #eef1f7; color: var(--muted); }
.tag-na { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #eef1f7; padding: 2px 8px; border-radius: var(--r-pill); }

.data-rows { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.data-rows .row { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.data-rows .row span:first-child { color: var(--muted); }
.data-rows .row span:last-child { color: var(--ink); font-weight: 700; text-align: right; }
.value-line { margin: 14px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }

.disclaimer { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 60ch; margin: 8px auto 0; line-height: 1.6; }
.disclaimer code { background: var(--blue-faint); color: var(--blue); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* Mode switch (pas à pas / 1 scan) */
.mode-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mode-switch { margin-bottom: 0; }
.mode-hint { margin: 0; font-size: 13px; color: var(--muted); }

/* Micro-copie de finalité */
.why { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); padding-left: 11px; border-left: 2px solid rgba(15, 82, 255, .25); }
.why strong { color: var(--ink); }
.muted2 { color: var(--muted); font-weight: 600; }

/* Explainer — cas conducteur + adresse */
.explainer h3 { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.cases { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 9px; font-size: 14px; color: var(--text); }
.cases li { line-height: 1.5; }
.cases strong { color: var(--ink); }
.addr-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; background: var(--blue-faint); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.addr-note strong { color: var(--ink); }
.addr-note em { color: var(--text); font-style: normal; font-weight: 600; }

/* Sélecteur de cas (contenu du wallet) */
.cases-entry { padding: 20px 22px; }
.entry-h { margin: 0 0 14px; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.case-btn { appearance: none; cursor: pointer; font-family: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.case-btn:hover { border-color: rgba(15, 82, 255, .35); transform: translateY(-2px); box-shadow: var(--sh-1); }
.case-btn.is-on { border-color: var(--blue); background: var(--blue-faint); box-shadow: 0 0 0 3px var(--blue-tint); }
.case-ic { font-size: 22px; }
.case-t { font-size: 15px; font-weight: 800; color: var(--ink); }
.case-d { font-size: 12px; color: var(--muted); line-height: 1.4; }
.case-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Lien-toggle (1 scan ↔ pas-à-pas) */
.link-toggle { margin-left: auto; appearance: none; border: 0; background: transparent; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--blue); padding: 4px 8px; border-radius: 8px; }
.link-toggle:hover { background: var(--blue-tint); }

/* Responsive */
@media (max-width: 600px) {
  .topbar { padding: 22px 18px 6px; }
  /* Safe-area (encoches iPhone / gestes Android) ; padding HTML horizontal préservé via max(). */
  .wrap { padding: 12px max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 14px; }
  .tagline { font-size: 14px; }
  .booking { flex-direction: row; gap: 14px; }
  .booking-info h1 { font-size: 19px; }
  .case-grid { grid-template-columns: 1fr; }
  .reqs { grid-template-columns: 1fr; }
  .step-head h2 { font-size: 17px; }
  .qr-zone { flex-direction: column; align-items: stretch; text-align: center; }
  .qr-frame { align-self: center; }
  .step-ind .lbl { display: none; }
  .stepper { gap: 4px; }
}

/* Accessibilité : respecte la réduction d'animations demandée par l'OS. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .blob { animation: none !important; }
}
