/* RATP RP : inspiré de l'application de transport (fond clair, vert jade,
   bleu nuit, gros arrondis, barre d'onglets en bas sur mobile). Projet RP. */
:root {
  --jade: #00C4B3;
  --jade-fonce: #008a7d;
  --jade-clair: #e0f7f5;
  --nuit: #0b2a3c;
  --gris-1: #f3f6f8;
  --gris-2: #e3e9ed;
  --gris-3: #8a99a5;
  --blanc: #fff;
  --rouge: #d64550;
  --ambre: #e59a00;
  --rayon: 18px;
  --ombre: 0 1px 2px rgba(11,42,60,.06), 0 8px 24px rgba(11,42,60,.07);
  --haut-avert: 0px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gris-1);
  color: var(--nuit);
  line-height: 1.45;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding-bottom: 72px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.material-ico {
  font-family: 'Material Symbols Rounded'; font-weight: 400; font-style: normal;
  font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 1, 'wght' 500; vertical-align: middle; user-select: none;
}

/* ── Avertissement ── */
.avertissement {
  background: var(--nuit); color: #d9eef0; padding: .55rem 1rem;
  display: flex; gap: .6rem; align-items: center; justify-content: center;
  font-size: .78rem; line-height: 1.35; text-align: left;
}
.avertissement .material-ico { color: var(--jade); font-size: 18px; flex: none; }
.avertissement strong { color: #fff; }

/* ── En-tête ── */
.entete {
  position: sticky; top: 0; z-index: 30;
  background: var(--jade); color: #fff;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1rem;
  box-shadow: 0 2px 12px rgba(0,120,110,.25);
}
.marque { display: flex; align-items: center; gap: .55rem; }
.marque-nom { font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.marque-nom em { font-style: normal; font-weight: 600; opacity: .85; font-size: .8em; }
.nav-haut { display: none; margin-left: 1.5rem; gap: .25rem; }
.nav-haut a { padding: .5rem .9rem; border-radius: 999px; font-weight: 600; font-size: .95rem; opacity: .9; }
.nav-haut a:hover { background: rgba(255,255,255,.18); }
.nav-haut a.actif { background: #fff; color: var(--jade-fonce); opacity: 1; }
.compte { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.compte .avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); object-fit: cover; background: #fff3; }
.compte .nom { font-weight: 600; font-size: .9rem; display: none; }
.btn-entete { background: #fff; color: var(--jade-fonce); font-weight: 700; padding: .5rem 1rem; border-radius: 999px; font-size: .9rem; }
.btn-fantome { color: #fff; opacity: .85; padding: .4rem; border-radius: 8px; }
.btn-fantome:hover { background: rgba(255,255,255,.18); opacity: 1; }

/* ── Navigation basse (mobile) ── */
.nav-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--gris-2);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.nav-bas a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--gris-3); padding: .3rem 0; }
.nav-bas a.actif { color: var(--jade-fonce); }
.nav-bas a.actif .material-ico { background: var(--jade-clair); border-radius: 999px; padding: 2px 16px; box-sizing: content-box; }

/* ── Page ── */
.app { width: 100%; max-width: 980px; margin: 0 auto; padding: 1.1rem 1rem 2rem; flex: 1; }
.chargement { display: grid; place-items: center; padding: 4rem 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--gris-2); border-top-color: var(--jade); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 1.6rem 0 .7rem; }
.sous { color: var(--gris-3); font-size: .92rem; }
.carte { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.1rem; }
.vide { text-align: center; padding: 2.2rem 1rem; color: var(--gris-3); }
.vide .material-ico { font-size: 46px; color: var(--jade); opacity: .6; display: block; margin: 0 auto .5rem; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--jade); color: #04302b; font-weight: 700; padding: .8rem 1.3rem;
  border-radius: 999px; transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(.95); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.plein { width: 100%; }
.btn.sombre { background: var(--nuit); color: #fff; }
.btn.clair { background: var(--jade-clair); color: var(--jade-fonce); }

/* ── Accueil ── */
.salut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.solde { background: #fff; border-radius: 999px; box-shadow: var(--ombre); padding: .45rem 1rem; font-weight: 700; display: inline-flex; gap: .5rem; align-items: center; }
.solde .material-ico { color: var(--jade); }
.raccourcis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1.2rem; }
.raccourci { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1rem .5rem; text-align: center; font-weight: 700; font-size: .85rem; display: flex; flex-direction: column; gap: .4rem; align-items: center; transition: transform .12s; }
.raccourci:hover { transform: translateY(-2px); }
.raccourci .material-ico { font-size: 28px; color: var(--jade-fonce); background: var(--jade-clair); border-radius: 14px; padding: 8px; }
.bandeau { background: linear-gradient(135deg, var(--jade), #00a89a); color: #032b27; border-radius: var(--rayon); padding: 1.3rem; margin-top: 1.2rem; position: relative; overflow: hidden; }
.bandeau h3 { font-size: 1.25rem; font-weight: 800; }
.bandeau p { margin: .3rem 0 .9rem; max-width: 34ch; }
.bandeau::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 26px solid rgba(255,255,255,.22); }

/* ── Cartes physiques (Navigo) ── */
.cartes-rail { display: flex; gap: .9rem; overflow-x: auto; padding: .3rem .2rem 1rem; scroll-snap-type: x mandatory; }
.navigo-carte {
  flex: none; width: min(320px, 82vw); aspect-ratio: 1.586; border-radius: 18px; padding: 1rem 1.1rem;
  color: #fff; position: relative; overflow: hidden; scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 28px rgba(0,100,92,.28); cursor: pointer; text-align: left;
}
.navigo-carte.navigo { background: linear-gradient(135deg, #00c4b3 0%, #007f74 70%); }
.navigo-carte.easy { background: linear-gradient(135deg, #0b2a3c 0%, #1a4a63 100%); }
.navigo-carte::before { content: ''; position: absolute; right: -50px; bottom: -70px; width: 230px; height: 230px; border-radius: 50%; border: 34px solid rgba(255,255,255,.12); }
.navigo-carte .rang { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .95rem; }
.navigo-carte .puce { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #f2d98a, #c7a44a); }
.navigo-carte .num { font-variant-numeric: tabular-nums; letter-spacing: .12em; font-weight: 600; }
.navigo-carte .porteur { font-size: .8rem; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }
.carte-vide { flex: none; width: min(320px, 82vw); aspect-ratio: 1.586; border-radius: 18px; border: 2px dashed var(--gris-2); display: grid; place-items: center; text-align: center; color: var(--gris-3); padding: 1rem; background: #fff8; }

/* ── Onglets segmentés ── */
.segments { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--ombre); margin: 1rem 0; }
.segments button { padding: .55rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--gris-3); }
.segments button.actif { background: var(--jade); color: #04302b; }

/* ── Produits ── */
.grille { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.produit { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1rem 1.1rem; display: flex; align-items: center; gap: 1rem; text-align: left; width: 100%; transition: transform .12s, box-shadow .12s; }
.produit:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(11,42,60,.06), 0 14px 30px rgba(11,42,60,.1); }
.produit .pic { flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--jade-clair); color: var(--jade-fonce); display: grid; place-items: center; }
.produit .pic .material-ico { font-size: 28px; }
.produit .corps { flex: 1; min-width: 0; }
.produit .titre { font-weight: 700; }
.produit .desc { color: var(--gris-3); font-size: .85rem; }
.prix { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.prix small { font-weight: 600; color: var(--gris-3); font-size: .7rem; }

/* ── Titres ── */
.liste-titres { display: grid; gap: .7rem; }
.titre-ligne { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: .9rem 1rem; display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; }
.titre-ligne .pic { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--jade-clair); color: var(--jade-fonce); display: grid; place-items: center; }
.titre-ligne .corps { flex: 1; min-width: 0; }
.titre-ligne .t { font-weight: 700; }
.titre-ligne .s { color: var(--gris-3); font-size: .82rem; }
.pastille { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.pastille.actif { background: #d6f5ee; color: #007a56; }
.pastille.neuf { background: var(--jade-clair); color: var(--jade-fonce); }
.pastille.a_venir { background: #fff2d1; color: #8a5b00; }
.pastille.expire { background: var(--gris-2); color: var(--gris-3); }

/* ── Feuille modale ── */
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(11,42,60,.55); display: flex; align-items: flex-end; justify-content: center; animation: fondu .18s; }
.voile[hidden] { display: none; }
.feuille { background: #fff; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom)); animation: monte .25s cubic-bezier(.2,.9,.3,1); }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
@keyframes fondu { from { opacity: 0; } }
.feuille .poignee { width: 42px; height: 4px; background: var(--gris-2); border-radius: 4px; margin: -.5rem auto 1rem; }
.feuille h3 { font-size: 1.25rem; font-weight: 800; }
.champ { margin-top: 1rem; }
.champ > label, .champ > .lib { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .4rem; }
.choix { display: grid; gap: .5rem; }
.option { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border: 2px solid var(--gris-2); border-radius: 14px; text-align: left; width: 100%; }
.option.sel { border-color: var(--jade); background: var(--jade-clair); }
.option .o-t { font-weight: 700; font-size: .92rem; }
.option .o-s { color: var(--gris-3); font-size: .8rem; }
.option .material-ico { color: var(--jade-fonce); }
.recap { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--gris-2); font-weight: 700; }
.recap .prix { font-size: 1.5rem; }
.erreur { background: #fde8ea; color: #a1212d; padding: .65rem .8rem; border-radius: 12px; font-size: .88rem; margin-top: .9rem; }
input[type=text] { width: 100%; padding: .75rem .9rem; border: 2px solid var(--gris-2); border-radius: 12px; font: inherit; }
input[type=text]:focus { outline: none; border-color: var(--jade); }

/* ── QR ── */
.qr-boite { background: #fff; border: 2px solid var(--gris-2); border-radius: 20px; padding: 1rem; display: grid; place-items: center; margin: 1rem auto; width: fit-content; }
.qr-boite svg, .qr-boite img { width: 210px; height: 210px; display: block; }
.qr-boite.floute svg, .qr-boite.floute img { filter: blur(7px); opacity: .5; }
.decompte { text-align: center; font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--jade-fonce); }
.code { text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: .74rem; color: var(--gris-3); word-break: break-all; }

/* ── Connexion ── */
.accroche { text-align: center; padding: 2rem 1rem; max-width: 520px; margin: 0 auto; }
.accroche img { width: 84px; height: 84px; }
.accroche h1 { margin-top: 1rem; font-size: 1.9rem; }
.accroche p { color: var(--gris-3); margin: .6rem 0 1.4rem; }
.tarifs-apercu { display: grid; gap: .5rem; margin-top: 2rem; text-align: left; }
.tarifs-apercu .l { background: #fff; border-radius: 14px; padding: .7rem 1rem; display: flex; justify-content: space-between; box-shadow: var(--ombre); font-weight: 600; }

/* ── Historique ── */
.historique { display: grid; gap: .5rem; }
.h-ligne { background: #fff; border-radius: 14px; padding: .8rem 1rem; display: flex; justify-content: space-between; gap: 1rem; box-shadow: var(--ombre); }
.h-ligne .t { font-weight: 700; }
.h-ligne .s { color: var(--gris-3); font-size: .82rem; }

.pied { max-width: 980px; margin: 0 auto; padding: 1rem 1rem 1.5rem; color: var(--gris-3); font-size: .74rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--nuit); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.mal { background: var(--rouge); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .nav-bas { display: none; }
  .nav-haut { display: flex; }
  .compte .nom { display: block; }
  .app { padding-top: 1.8rem; }
  .grille { grid-template-columns: 1fr 1fr; }
  .voile { align-items: center; }
  .feuille { border-radius: 24px; }
  .feuille .poignee { display: none; }
  .raccourcis { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
