/* ==========================================================================
   HPay — adaptation du systeme de design (hpay-ui.css, maquette 390 x 844)
   a un vrai telephone : pleine largeur, hauteur libre, barre du bas fixe,
   zones sures (encoche), feuilles du bas, notifications, etat de chargement.
   ========================================================================== */
html, body { margin: 0; background: var(--bg); font-family: var(--font); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
* { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font-family: inherit; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid rgba(224, 83, 43, .45); outline-offset: 2px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; background: var(--bg); }
.screen { width: 100%; height: auto; min-height: 100dvh; overflow: visible; padding-top: env(safe-area-inset-top); }
.screen.avec-dock { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.content { overflow: visible; }
.chips { overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { cursor: pointer; font-family: inherit; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.tabbar { width: 100%; max-width: 480px; height: auto; padding-bottom: calc(14px + env(safe-area-inset-bottom)); pointer-events: auto; }
.tabbar a, .tabbar button { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 11.5px var(--font); color: #8A817B; padding: 0; }
.tabbar .on { color: var(--orange-600); }

/* Boutons rendus en <button> */
.btn[disabled] { opacity: .65; cursor: progress; }
.icon-btn { font-family: inherit; }
.qa, .service, .row, .option { cursor: pointer; background: none; border: 0; font-family: inherit; width: 100%; }
.service { background: #fff; }
.option { text-align: left; }
html[dir="rtl"] .option { text-align: right; }
.row { text-align: left; }
html[dir="rtl"] .row, html[dir="rtl"] .row .end { text-align: right; }
html[dir="rtl"] .row .end { align-items: flex-start; }
html[dir="rtl"] svg.flip { transform: scaleX(-1); }

.row .end { white-space: nowrap; }
.montant { unicode-bidi: isolate; }
.neg { color: var(--ink); }
.solde-masque { letter-spacing: 3px; }

/* Feuille du bas */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(31, 26, 23, .55); display: flex; align-items: flex-end; justify-content: center; animation: voile .18s ease-out; }
.voile .sheet { width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto; padding-bottom: calc(26px + env(safe-area-inset-bottom)); animation: monte .22s ease-out; }
@keyframes voile { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(40px); opacity: .4; } }

/* Notification */
#toasts { position: fixed; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top)); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
#toasts .toast { max-width: 448px; width: 100%; pointer-events: auto; animation: monte .2s ease-out; }
#toasts .toast.erreur { background: var(--red); }

/* Chargement */
.squelette { background: linear-gradient(90deg, #F1EAE4 25%, #F8F3EF 50%, #F1EAE4 75%); background-size: 200% 100%; animation: brille 1.2s infinite; border-radius: 12px; }
@keyframes brille { to { background-position: -200% 0; } }
.tourne { width: 20px; height: 20px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.vide { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 14px; font-weight: 600; }

.bandeau-beta { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 10px 3px; border-radius: 0 0 8px 8px; opacity: .75; pointer-events: none; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.marque .tile { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--orange-600); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   CHARTE HPAY : une seule couleur, l'orange HPay (#DD5129, celui du logo et
   de CLIENT/), avec le blanc et le noir. Les pastilles bleues, vertes,
   violettes et jaunes de la maquette passent toutes a l'orange.
   Seule exception : le rouge reste pour les erreurs et les echecs, pour
   qu'une operation ratee ne passe jamais inapercue.
   ========================================================================== */
:root {
  --orange: #DD5129;
  --orange-600: #DD5129;
  --orange-700: #B8411F;
  --peach: #FCE9E2;
  --peach-2: #FEF5F1;
  --green: #DD5129;
  --mint: #FCE9E2;
}
.t-orange, .t-green, .t-blue, .t-violet, .t-amber, .t-rose { background: var(--peach); color: var(--orange); }
.av-orange, .av-blue, .av-green, .av-violet { background: var(--peach); color: var(--orange-700); }
.pos { color: var(--orange); }
.b-success { background: var(--peach); color: var(--orange-700); }
.b-pending, .b-info, .b-neutral { background: #F1ECE8; color: var(--ink-2); }
.n-warn, .n-info, .n-ok { background: var(--peach); color: var(--ink); }
.n-warn svg, .n-info svg, .n-ok svg { color: var(--orange); }
.btn-whatsapp { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-whatsapp svg { color: var(--orange); }
.btn-primary { box-shadow: 0 8px 18px rgba(221, 81, 41, .28); }
.hero { box-shadow: 0 14px 30px rgba(221, 81, 41, .28); }
.hero .label, .hero .small, .hero .big span { color: rgba(255, 255, 255, .85) !important; }
.tabbar .scan span { box-shadow: 0 10px 20px rgba(221, 81, 41, .35); }

/* Logo officiel (orange sur fond transparent) ; en blanc sur le bandeau orange. */
.logo { display: block; width: auto; }
.logo-blanc { filter: brightness(0) invert(1); }
.marque { gap: 10px; }
.pastille-logo { width: 50px; height: 50px; border-radius: 16px; background: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.pastille-logo .logo { height: 40px; }

/* Bouton d'action toujours visible : le pied de l'ecran reste colle en bas pendant
   que le contenu defile (demande de Kalif, 23/11/2026). */
.screen > .footer { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.screen > .content { flex: 1 0 auto; }
/* Ligne qui mene a un historique (au lieu d'une longue liste sous le formulaire). */
.lien-histo .compte { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--orange); color: #fff; font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
/* Scanner : image de la camera dans un cadre carre, viseur orange (charte). */
.scan-cadre { position: relative; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; background: #111; }
.scan-cadre video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-cadre.vide video { visibility: hidden; }
.scan-viseur { position: absolute; inset: 16%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none;
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 34px 4px no-repeat, linear-gradient(var(--orange), var(--orange)) top left / 4px 34px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top right / 34px 4px no-repeat, linear-gradient(var(--orange), var(--orange)) top right / 4px 34px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom left / 34px 4px no-repeat, linear-gradient(var(--orange), var(--orange)) bottom left / 4px 34px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 34px 4px no-repeat, linear-gradient(var(--orange), var(--orange)) bottom right / 4px 34px no-repeat; }
.scan-cadre.vide .scan-viseur { box-shadow: none; }
.scan-etat { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-size: 13.5px; font-weight: 700; }
