/* =========================================================
   Izycard — système de design
   ========================================================= */
:root {
  --ink: #14110E;
  --ink-2: #423B34;
  --muted: #8B8178;
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --line: #E9E3DC;
  --line-fort: #D8D0C7;

  --accent: #FF5A1F;
  --accent-fonce: #DC4410;
  --accent-doux: #FFF1EA;
  --vert: #0E9F6E;
  --vert-doux: #E6F7F0;
  --bleu: #2563EB;
  --bleu-doux: #EAF0FE;
  --violet: #7C3AED;
  --violet-doux: #F2ECFE;
  --ambre: #B45309;
  --ambre-doux: #FDF3E3;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;

  --ombre-s: 0 1px 2px rgba(20,17,14,.06), 0 1px 3px rgba(20,17,14,.04);
  --ombre-m: 0 2px 4px rgba(20,17,14,.04), 0 8px 24px rgba(20,17,14,.07);
  --ombre-l: 0 12px 40px rgba(20,17,14,.14);

  --nav: 252px;
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.022em; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--accent); color: #fff; }

.muted { color: var(--muted); }
.petit { font-size: 13px; }
.mini { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 620; color: var(--muted); }
.gras { font-weight: 620; }
.centre { text-align: center; }
.pile { display: flex; flex-direction: column; }
.rang { display: flex; align-items: center; }
.entre { justify-content: space-between; }
.g4 { gap: 4px; } .g8 { gap: 8px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g24 { gap: 24px; }
.grandir { flex: 1; }
.tabulaire { font-variant-numeric: tabular-nums; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-m); border: 1px solid transparent;
  background: var(--surface); color: var(--ink); font-weight: 570; font-size: 14.5px;
  cursor: pointer; white-space: nowrap; transition: .16s ease;
  box-shadow: var(--ombre-s);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--ombre-m); }
.btn:active { transform: translateY(0); }
.btn--principal { background: var(--accent); color: #fff; box-shadow: 0 2px 12px rgba(255,90,31,.32); }
.btn--principal:hover { background: var(--accent-fonce); box-shadow: 0 6px 20px rgba(255,90,31,.34); }
.btn--sombre { background: var(--ink); color: #fff; }
.btn--sombre:hover { background: #000; }
.btn--fantome { background: transparent; border-color: var(--line-fort); box-shadow: none; }
.btn--fantome:hover { background: var(--surface); box-shadow: var(--ombre-s); }
.btn--doux { background: var(--accent-doux); color: var(--accent-fonce); box-shadow: none; }
.btn--grand { padding: 15px 26px; font-size: 16px; border-radius: var(--r-l); }
.btn--bloc { width: 100%; }
.btn--petit { padding: 7px 12px; font-size: 13px; border-radius: var(--r-s); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }

/* ---------- Champs ---------- */
.champ { display: flex; flex-direction: column; gap: 7px; }
.champ > label { font-size: 13.5px; font-weight: 570; color: var(--ink-2); }
.champ .aide { font-size: 12.5px; color: var(--muted); }
.saisie {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-fort); border-radius: var(--r-m);
  background: var(--surface); outline: none; transition: .15s;
}
.saisie:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }
.saisie--grande { font-size: 19px; padding: 16px; font-weight: 600; }
textarea.saisie { resize: vertical; min-height: 76px; }
.groupe-saisie { position: relative; display: flex; align-items: center; }
.groupe-saisie .suffixe { position: absolute; right: 14px; color: var(--muted); font-weight: 570; font-size: 14px; pointer-events: none; }
/* Les flèches natives des champs numériques passaient sous le suffixe (« 10 ▲▼ points ») */
.groupe-saisie input[type="number"] { appearance: textfield; -moz-appearance: textfield; padding-right: 84px; }
.groupe-saisie input[type="number"]::-webkit-outer-spin-button,
.groupe-saisie input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.groupe-saisie .prefixe { position: absolute; left: 14px; color: var(--muted); font-weight: 570; }
.groupe-saisie .saisie { padding-left: 34px; }
.recherche { position: relative; }
.recherche svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.recherche .saisie { padding-left: 40px; }

/* ---------- Cartes / surfaces ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--ombre-s);
}
.carte--pad { padding: 22px; }
.carte-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.carte-corps { padding: 22px; }

.pastille {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pastille--vert { background: var(--vert-doux); color: #07734F; border-color: transparent; }
.pastille--orange { background: var(--accent-doux); color: var(--accent-fonce); border-color: transparent; }
.pastille--bleu { background: var(--bleu-doux); color: #1D4ED8; border-color: transparent; }
.pastille--violet { background: var(--violet-doux); color: #6D28D9; border-color: transparent; }
.pastille--gris { background: #F1EDE8; color: var(--muted); border-color: transparent; }

.point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Mise en page application ---------- */
.appli { display: grid; grid-template-columns: var(--nav) 1fr; min-height: 100vh; }
.nav {
  background: #16130F; color: #EDE8E2; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.marque { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.marque-logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, #FF7A45, #FF3D00); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(255,90,31,.4);
}
.marque-nom { font-weight: 660; letter-spacing: -.02em; font-size: 17px; color: #fff; }
.nav-groupe { display: flex; flex-direction: column; gap: 3px; }
.nav-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #726A61; padding: 0 10px 8px; font-weight: 640; }
.nav-lien {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 11px;
  color: #B9B1A8; font-weight: 545; font-size: 14.5px; cursor: pointer; transition: .15s;
}
.nav-lien svg { width: 18px; height: 18px; }
.nav-lien:hover { background: #221D18; color: #fff; }
.nav-lien.actif { background: #2A231C; color: #fff; }
.nav-lien.actif svg { color: var(--accent); }
.nav-bas { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.nav-commerce {
  display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; background: #201B16; cursor: pointer;
}
.nav-commerce .emoji { width: 34px; height: 34px; border-radius: 9px; background: #2E2720; display: grid; place-items: center; font-size: 18px; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 32px; border-bottom: 1px solid var(--line); background: rgba(246,244,241,.86);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.contenu { padding: 28px 32px 96px; max-width: 1240px; width: 100%; }

/* ---------- Grilles ---------- */
.grille { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-2-3 { grid-template-columns: 1.55fr 1fr; }

/* ---------- Tuiles de statistiques ---------- */
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; box-shadow: var(--ombre-s); }
.tuile-icone { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px; }
.tuile-icone svg { width: 17px; height: 17px; }
.tuile-valeur { font-size: 28px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tuile-libelle { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.evolution { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 620; margin-top: 10px; }
.evolution svg { width: 13px; height: 13px; }
.evolution.hausse { color: #07734F; }
.evolution.baisse { color: #C2410C; }

/* ---------- Tableaux / listes ---------- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 640; padding: 0 16px 10px;
}
.tableau td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tableau tbody tr { cursor: pointer; transition: background .12s; }
.tableau tbody tr:hover { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  font-weight: 640; font-size: 13.5px; color: #fff; background: var(--ink);
}
.ligne-activite { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.ligne-activite:first-child { border-top: 0; }
.puce-activite { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.puce-activite svg { width: 16px; height: 16px; }

/* ---------- Progression ---------- */
.jauge { height: 8px; border-radius: 99px; background: #EDE8E2; overflow: hidden; }
.jauge > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FF7A45, #FF3D00); transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ---------- Graphiques ---------- */
.graph { width: 100%; height: 190px; }
.graph .barre { fill: #EFE9E2; transition: fill .15s; }
.graph .barre.fort { fill: var(--accent); }
.graph text { font-size: 9.5px; fill: var(--muted); font-family: var(--police); }

/* ---------- Carte de fidélité (aperçu wallet) ---------- */
.wallet {
  width: 320px; border-radius: 20px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 18px 44px rgba(20,17,14,.28); flex: 0 0 auto;
}
.wallet::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 80% -10%, rgba(255,255,255,.22), transparent 60%);
}
.wallet-entete { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.wallet-logo { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 21px; }
.wallet-nom { font-weight: 640; font-size: 16px; letter-spacing: -.01em; }
.wallet-sous { font-size: 12px; opacity: .7; }
.wallet-points { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.wallet-legende { font-size: 12px; opacity: .72; text-transform: uppercase; letter-spacing: .07em; font-weight: 620; }
.wallet-jauge { height: 6px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; margin: 16px 0 8px; }
.wallet-jauge > i { display: block; height: 100%; border-radius: 99px; background: #fff; }
.wallet-qr { background: #fff; border-radius: 12px; padding: 8px; width: 92px; height: 92px; }
.wallet-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 18px; }
.wallet--google { border-radius: 16px; }
.wallet--google .wallet-bande { height: 3px; background: rgba(255,255,255,.35); border-radius: 99px; margin-bottom: 16px; }

.btn-wallet {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 12px;
  background: #000; color: #fff; font-weight: 560; cursor: pointer; border: 0; box-shadow: var(--ombre-m);
}
.btn-wallet svg { width: 22px; height: 22px; }
.btn-wallet small { display: block; font-size: 10.5px; opacity: .8; line-height: 1.1; }
.btn-wallet b { font-size: 15px; font-weight: 620; letter-spacing: -.01em; }
.btn-wallet--google { background: #fff; color: #202124; border: 1px solid #DADCE0; }

/* ---------- Téléphone ---------- */
.telephone {
  width: 372px; border-radius: 46px; background: #16130F; padding: 11px; box-shadow: var(--ombre-l); flex: 0 0 auto;
}
.telephone-ecran { border-radius: 36px; background: var(--surface); overflow: hidden; height: 748px; position: relative; display: flex; flex-direction: column; }
.telephone-barre { display: flex; justify-content: space-between; padding: 12px 22px 4px; font-size: 12px; font-weight: 640; }
.telephone-contenu { flex: 1; overflow-y: auto; padding: 8px 20px 28px; }

/* ---------- Modale ---------- */
.voile {
  position: fixed; inset: 0; background: rgba(20,17,14,.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fondu .18s ease;
}
.modale { background: var(--surface); border-radius: var(--r-xl); width: min(520px, 100%); box-shadow: var(--ombre-l); animation: monte .22s cubic-bezier(.2,.8,.2,1); max-height: 92vh; overflow: auto; }
@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Notification ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 550; font-size: 14.5px; box-shadow: var(--ombre-l);
  animation: monte .22s cubic-bezier(.2,.8,.2,1);
}
.toast svg { width: 17px; height: 17px; }
.toast--succes { background: #0B7A55; }

/* ---------- Onglets ---------- */
.onglets { display: inline-flex; gap: 3px; padding: 3px; background: #EEE9E3; border-radius: 12px; }
.onglet { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 570; color: var(--ink-2); cursor: pointer; border: 0; background: transparent; }
.onglet.actif { background: var(--surface); box-shadow: var(--ombre-s); color: var(--ink); }

/* ---------- Caisse ---------- */
.caisse { min-height: 100vh; background: #16130F; color: #fff; display: flex; flex-direction: column; }
.caisse-entete { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #2A231C; }
.caisse-corps { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; width: min(520px, 100%); margin: 0 auto; }
.montant { font-size: 62px; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 22px; }
.touche {
  padding: 20px 0; border-radius: 16px; background: #221D18; border: 0; color: #fff; font-size: 24px;
  font-weight: 560; cursor: pointer; transition: .12s; font-variant-numeric: tabular-nums;
}
.touche:hover { background: #2E2720; }
.touche:active { transform: scale(.97); background: #3A3128; }
.scanner {
  aspect-ratio: 1; width: min(300px, 76vw); border-radius: 26px; background: #0B0906; position: relative; overflow: hidden;
  display: grid; place-items: center; border: 1px solid #2A231C;
}
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-cadre { position: absolute; inset: 34px; border-radius: 18px; box-shadow: 0 0 0 2px rgba(255,90,31,.75); }
.scanner-ligne { position: absolute; left: 34px; right: 34px; height: 2px; background: var(--accent); box-shadow: 0 0 18px 3px rgba(255,90,31,.75); animation: balayage 2.1s ease-in-out infinite; }
@keyframes balayage { 0%,100% { top: 40px; } 50% { top: calc(100% - 40px); } }

/* ---------- Affiche QR ---------- */
.affiche {
  width: 340px; aspect-ratio: 1 / 1.414; border-radius: var(--r-l); padding: 30px 26px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  box-shadow: var(--ombre-m); border: 1px solid var(--line);
}
.affiche-qr { background: #fff; border-radius: 16px; padding: 12px; width: 190px; height: 190px; box-shadow: var(--ombre-s); }

/* ---------- Étapes onboarding ---------- */
.etapes { display: flex; align-items: center; gap: 8px; }
.etape-point { height: 5px; border-radius: 99px; background: var(--line-fort); width: 34px; transition: .3s; }
.etape-point.actif { background: var(--accent); width: 54px; }
.etape-point.faite { background: var(--accent); opacity: .45; }

/* ---------- Choix (radio cartes) ---------- */
.choix {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: var(--r-m); cursor: pointer; background: var(--surface); transition: .15s; text-align: left; width: 100%;
}
.choix:hover { border-color: var(--line-fort); }
.choix.actif { border-color: var(--accent); background: var(--accent-doux); }
.choix .emoji { font-size: 22px; }

.pastille-couleur { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; transition: .15s; }
.pastille-couleur.actif { border-color: var(--ink); transform: scale(1.08); }

/* ---------- Navigation mobile ---------- */
.nav-mobile { display: none; }

/* ---------- Page d'accueil ---------- */
.accueil { min-height: 100vh; background: radial-gradient(120% 70% at 50% -10%, #FFF3EC 0%, var(--bg) 55%); }
.accueil-entete { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; max-width: 1180px; margin: 0 auto; }
.hero { max-width: 1180px; margin: 0 auto; padding: 46px 32px 70px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 50px; letter-spacing: -.035em; line-height: 1.04; }
.hero p.chapo { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 30em; }
.bandeau-preuves { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; }
.preuve b { display: block; font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.preuve span { font-size: 13px; color: var(--muted); }
.blocs { max-width: 1180px; margin: 0 auto; padding: 0 32px 80px; }

@media (max-width: 1120px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-3, .g-3 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 860px) {
  .appli { grid-template-columns: 1fr; }
  .nav { display: none; }
  .entete { padding: 14px 18px; }
  .contenu { padding: 18px 18px 110px; }
  .g-4, .g-2 { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 24px; }
  .nav-mobile {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .nav-mobile a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
    font-size: 10.5px; color: var(--muted); font-weight: 570;
  }
  .nav-mobile a svg { width: 21px; height: 21px; }
  .nav-mobile a.actif { color: var(--accent); }
  .telephone { width: 100%; max-width: 372px; border-radius: 34px; }
  .telephone-ecran { height: 660px; }
  .cacher-mobile { display: none !important; }
  .affiche { width: 100%; max-width: 340px; }
}
@media (max-width: 520px) {
  .g-4, .g-2 { grid-template-columns: 1fr; }
  .hero { padding: 26px 18px 48px; }
  .accueil-entete { padding: 16px 18px; }
  .blocs { padding: 0 18px 60px; }
}

/* ---------- Impression des supports ---------- */
@media print {
  body * { visibility: hidden !important; }
  .impression, .impression * { visibility: visible !important; }
  .impression {
    position: fixed; inset: 0; margin: auto; box-shadow: none !important;
    width: 190mm !important; max-width: none; border: 0 !important;
  }
  .nav, .nav-mobile, .entete { display: none !important; }
}

/* ---------- Indicateur de chargement ---------- */
.tourniquet {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line-fort); border-top-color: var(--accent);
  animation: tourner .7s linear infinite;
}
@keyframes tourner { to { transform: rotate(360deg); } }

/* ---------- Bandeau d'incarnation (administrateur) ---------- */
.bandeau-incarnation {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 32px; background: var(--violet-doux); color: #5B21B6;
  font-size: 13.5px; font-weight: 550; border-bottom: 1px solid rgba(124,58,237,.18);
}
.bandeau-incarnation .btn { margin-left: auto; background: #fff; color: #5B21B6; }
@media (max-width: 860px) { .bandeau-incarnation { padding: 10px 18px; } }
