/* ==========================================================================
   HPay UI — système de design de l'application client (refonte 2026)
   Couleurs, typographie, composants. Chaque écran charge ce fichier.
   ========================================================================== */
:root {
  --orange: #E0532B;        /* orange HPay : grandes surfaces, accents */
  --orange-600: #C4441F;    /* boutons et liens (texte blanc lisible) */
  --orange-700: #A3381A;
  --peach: #FFEDE5;
  --peach-2: #FFF6F1;
  --ink: #1F1A17;
  --ink-2: #3A332F;
  --muted: #6B6460;
  --line: #EFE7E1;
  --bg: #FAF6F2;
  --card: #FFFFFF;
  --mint: #E6F6EE;   --green: #1F8A5B;
  --amber-bg: #FFF4DE; --amber: #8A5200;
  --blue-bg: #EAF1FE;  --blue: #2457C5;
  --violet-bg: #F1EDFF; --violet: #5B3FD1;
  --rose-bg: #FDECEC;  --red: #B42318;
  --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .04), 0 8px 24px rgba(60, 30, 20, .07);
  --shadow-lg: 0 18px 40px rgba(60, 30, 20, .14);
  --font: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
}

/* ---------- Écran ---------- */
.screen { width: 390px; height: 844px; background: var(--bg); font-family: var(--font); color: var(--ink); display: flex; flex-direction: column; overflow: hidden; position: relative; box-sizing: border-box; }
.screen *, .ds * { box-sizing: border-box; }
.screen.is-white { background: #fff; }
.screen.is-dark { background: #17120F; color: #fff; }
.screen.is-dim { background: #5E5550; justify-content: flex-end; }
.muted { color: var(--muted); }
.link { color: var(--orange-600); font-weight: 700; text-decoration: none; }

/* Icônes : trait de 2 px, couleur héritée */
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.topbar .titles { flex: 1 1 auto; min-width: 0; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.topbar .sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(60, 30, 20, .05); position: relative; cursor: pointer; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }

/* ---------- Zones ---------- */
.content { flex: 1 1 auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.footer { padding: 12px 20px 26px; display: flex; gap: 10px; background: var(--bg); border-top: 1px solid var(--line); }
.screen.is-white .footer { background: #fff; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

/* ---------- Boutons ---------- */
.btn { height: 56px; border-radius: 18px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 700 16px var(--font); text-decoration: none; cursor: pointer; padding: 0 20px; flex: 1 1 auto; white-space: nowrap; }
.btn-primary { background: var(--orange-600); color: #fff; box-shadow: 0 8px 18px rgba(196, 68, 31, .28); }
.btn-secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-soft { background: var(--peach); color: var(--orange-700); }
.btn-danger { background: var(--rose-bg); color: var(--red); }
.btn-whatsapp { background: #E7F8EE; color: #0B5D33; border: 1px solid #BFEBD1; }
.btn-disabled { background: #EDE6E1; color: #A39A94; box-shadow: none; cursor: not-allowed; }
.btn-sm { height: 44px; border-radius: 14px; font-size: 14px; padding: 0 16px; flex: 0 0 auto; }
.btn-square { width: 56px; padding: 0; flex: 0 0 56px; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input { height: 54px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; padding: 0 8px 0 16px; display: flex; align-items: center; gap: 10px; font: 600 16px var(--font); color: var(--ink); }
.input input, .input select { border: 0; outline: 0; background: transparent; flex: 1 1 auto; min-width: 0; height: 100%; font: inherit; color: inherit; }
.input.is-focus { border-color: var(--orange-600); box-shadow: 0 0 0 4px rgba(224, 83, 43, .12); }
.input.is-error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 24, .10); }
.input.is-readonly { background: #F4EEE9; }
.input .adorn { color: var(--muted); display: inline-flex; padding: 0 8px; }
.help { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.45; }
.help.is-error { color: var(--red); font-weight: 600; }
.amount { height: 84px; border-radius: 22px; border: 2px solid var(--orange-600); background: #fff; padding: 0 18px; display: flex; align-items: center; gap: 10px; box-shadow: 0 0 0 5px rgba(224, 83, 43, .10); }
.amount input { border: 0; outline: 0; flex: 1 1 auto; min-width: 0; font: 800 34px var(--font); color: var(--ink); letter-spacing: -.5px; background: transparent; }
.amount .cur { font-size: 15px; font-weight: 800; color: var(--orange-700); background: var(--peach); padding: 7px 11px; border-radius: 11px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--orange-600); }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp input { height: 60px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; text-align: center; font: 800 24px var(--font); color: var(--ink); }
.otp input.on { border: 2px solid var(--orange-600); background: var(--peach-2); }

/* ---------- Cartes ---------- */
.card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.card.is-ink { background: var(--ink); color: #fff; }
.card.is-peach { background: var(--peach); box-shadow: none; }
.card.is-outline { box-shadow: none; border: 2px solid var(--orange-600); }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; background: var(--orange-600); color: #fff; box-shadow: 0 14px 30px rgba(196, 68, 31, .30); }
.hero::before { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -90px; background: rgba(255, 255, 255, .12); }
.hero::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: 40px; bottom: -80px; background: rgba(255, 255, 255, .08); }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 13px; font-weight: 600; color: #FFE3D8; }
.hero .big { margin: 6px 0 4px; font-size: 34px; font-weight: 800; letter-spacing: -.6px; }
.hero .small { font-size: 12.5px; color: #FFE3D8; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 12.5px; font-weight: 700; }

/* ---------- Titres de section ---------- */
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 -4px; }
.section-title h2 { margin: 0; font-size: 16px; font-weight: 800; }
.section-title a { font-size: 13px; font-weight: 700; color: var(--orange-600); text-decoration: none; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 2px 16px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.list > li:last-child .row { border-bottom: 0; }
.row .main { flex: 1 1 auto; min-width: 0; }
.row .t { display: block; font-size: 14.5px; font-weight: 700; }
.row .s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.row .end { text-align: right; font-size: 14.5px; font-weight: 800; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row .chev { color: #B8AEA7; }
.pos { color: var(--green); }

/* Option sélectionnable (méthode de dépôt, réseau, opérateur…) */
.option { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 2px solid transparent; }
.option.on { border-color: var(--orange-600); background: var(--peach-2); }
.option .main { flex: 1 1 auto; min-width: 0; }
.option .t { display: block; font-size: 15px; font-weight: 800; }
.option .s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ---------- Pastilles d'icônes ---------- */
.tile { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-weight: 800; font-size: 12px; }
.tile.lg { width: 58px; height: 58px; border-radius: 20px; }
.t-orange { background: var(--peach); color: var(--orange-600); }
.t-green { background: var(--mint); color: var(--green); }
.t-blue { background: var(--blue-bg); color: var(--blue); }
.t-violet { background: var(--violet-bg); color: var(--violet); }
.t-amber { background: var(--amber-bg); color: var(--amber); }
.t-rose { background: var(--rose-bg); color: var(--red); }
.t-ink { background: var(--ink); color: #fff; }
.t-white { background: #fff; color: var(--orange-600); box-shadow: var(--shadow); }

/* Actions rapides et services */
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); text-decoration: none; text-align: center; }
.service { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none; text-align: center; }

/* ---------- Puces et statuts ---------- */
.chips { display: flex; gap: 8px; overflow: hidden; }
.chip { height: 38px; padding: 0 15px; border-radius: 19px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-success { background: var(--mint); color: var(--green); }
.b-pending { background: var(--amber-bg); color: var(--amber); }
.b-failed { background: var(--rose-bg); color: var(--red); }
.b-info { background: var(--blue-bg); color: var(--blue); }
.b-neutral { background: #F1ECE8; color: var(--ink-2); }

/* ---------- Avatars ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; }
.av-orange { background: #FFD9CB; color: #8A2E12; }
.av-blue { background: #D6E4FF; color: #1E3F8F; }
.av-green { background: #CFEFDD; color: #14593A; }
.av-violet { background: #E3DBFF; color: #40289A; }
.av-ink { background: var(--ink); color: #fff; }

/* ---------- Récapitulatif ---------- */
.summary { margin: 0; padding: 16px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; row-gap: 10px; column-gap: 12px; font-size: 14.5px; }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.summary .total { padding-top: 12px; border-top: 1.5px dashed var(--line); font-weight: 800; color: var(--ink); }

/* ---------- Messages ---------- */
.note { padding: 12px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.n-warn { background: var(--amber-bg); color: #5E3800; }
.n-danger { background: var(--rose-bg); color: #7A271A; }
.n-info { background: var(--blue-bg); color: #1E3F8F; }
.n-ok { background: var(--mint); color: #0F4D30; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); }

/* ---------- Feuille du bas (bottom sheet) ---------- */
.sheet { background: #fff; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 20px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -12px 30px rgba(0, 0, 0, .14); }
.grabber { width: 44px; height: 5px; border-radius: 3px; background: #E3DAD3; align-self: center; }

/* ---------- Onglets segmentés et étapes ---------- */
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 16px; background: #EFE7E1; }
.segmented button { height: 42px; border: 0; border-radius: 12px; background: transparent; font: 700 14.5px var(--font); color: var(--muted); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(60, 30, 20, .08); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: var(--orange-600); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.steps li { padding: 9px 4px; border-radius: 12px; background: #fff; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); box-shadow: var(--shadow); }
.steps li.done { background: var(--mint); color: var(--green); box-shadow: none; }
.steps li.on { background: var(--orange-600); color: #fff; }

/* ---------- QR ---------- */
.qr-box { padding: 14px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); display: inline-flex; }
.qr-box svg { display: block; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ---------- Barre du bas ---------- */
.tabbar { width: 390px; height: 86px; box-sizing: border-box; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; padding: 10px 6px 16px; font-family: var(--font); box-shadow: 0 -6px 20px rgba(60, 30, 20, .05); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-size: 11.5px; font-weight: 700; color: #8A817B; }
.tabbar a.on { color: var(--orange-600); }
.tabbar .scan { margin-top: -30px; color: var(--ink); }
.tabbar .scan span { width: 62px; height: 62px; border-radius: 22px; background: var(--orange-600); border: 4px solid #fff; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(196, 68, 31, .35); }
.dock { position: absolute; left: 0; right: 0; bottom: 0; }

/* ---------- Planches du système de design ---------- */
.ds { font-family: var(--font); color: var(--ink); background: var(--bg); box-sizing: border-box; }
.ds h1 { margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -.8px; }
.ds h2 { margin: 0 0 14px; font-size: 20px; font-weight: 800; }
.ds .panel { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 24px; }
.ds .cap { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.swatch { height: 76px; border-radius: 16px; border: 1px solid rgba(0, 0, 0, .05); }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-align: center; }
