/* Lucii — démo Kigali. Charte : #011918 fond · #002F37 surfaces · #1BA2AC
   primaire · #6EE5D8 accent · #086483 profond. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #011918;
  --surface: #02252b;
  --surface-2: #002F37;
  --line: rgba(110, 229, 216, .12);
  --primary: #1BA2AC;
  --accent: #6EE5D8;
  --deep: #086483;
  --text: #EAF7F5;
  --muted: #7FA8A3;
  --danger: #E5766E;
  --ok: #58D6A0;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.screen { padding: 20px 20px 40px; min-height: 100dvh; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* --- Auth --- */
.auth-wrap { display: flex; flex-direction: column; justify-content: center; min-height: 90dvh; gap: 28px; }
.brand { text-align: center; }
.brand-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 8px 40px rgba(27,162,172,.35); }
.brand h1 { font-size: 34px; letter-spacing: .12em; margin-top: 12px; font-weight: 700; }
.tagline { color: var(--muted); margin-top: 4px; }
form { display: flex; flex-direction: column; gap: 14px; }
label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 17px; outline: none;
}
input:focus { border-color: var(--primary); }
.demo-note { text-align: center; font-size: 12px; color: var(--muted); }

/* --- Boutons --- */
.btn {
  padding: 15px 18px; border-radius: 14px; border: none; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: transform .06s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--deep)); color: #fff; }
.btn.primary:disabled { opacity: .5; }
.btn.ghost { background: none; color: var(--accent); }
.btn.big { width: 100%; margin-top: 24px; }
.chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* --- Accueil --- */
.home-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.head-actions { display: flex; gap: 8px; }
.hello { font-size: 18px; font-weight: 600; }
.msisdn { color: var(--muted); font-size: 13px; }
.balance-card {
  background: linear-gradient(150deg, var(--surface-2), #01353a 60%, #0a4a54);
  border: 1px solid var(--line); border-radius: 22px; padding: 24px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.balance-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.balance { font-size: 42px; font-weight: 700; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.balance .cur { font-size: 20px; color: var(--accent); font-weight: 600; }
.powered { font-size: 12px; color: var(--muted); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 26px; }
.action {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 8px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.action:active { transform: scale(.97); }
.action .ico {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(27,162,172,.18);
  color: var(--accent); display: grid; place-items: center; font-size: 18px;
}

/* --- Transactions --- */
.tx-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tx-head h2 { font-size: 17px; }
.tx-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tx {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px;
}
.tx .who { font-size: 15px; font-weight: 600; }
.tx .what { font-size: 12px; color: var(--muted); }
.tx .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx .amt.in { color: var(--ok); }
.tx .amt.out { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 14px; }

/* --- Sous-écrans --- */
.sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.sub-head h2 { font-size: 20px; }
.back {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; font-size: 22px; cursor: pointer; line-height: 1;
}
.op-sub { color: var(--muted); margin: -10px 0 18px; font-size: 14px; }
.amount-box {
  display: flex; align-items: baseline; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; padding: 8px 18px; margin-bottom: 14px;
}
.amount-box input { border: none; background: none; font-size: 40px; font-weight: 700; padding: 8px 0; }
.amount-box .cur { color: var(--accent); font-weight: 700; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--accent); padding: 10px 4px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.limits-note { color: var(--muted); font-size: 12px; margin-top: 14px; }
.field { display: block; margin-bottom: 14px; }

/* --- Audit --- */
.audit-badge {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px;
  font-weight: 700; margin-bottom: 14px; border: 1px solid var(--line);
}
.audit-badge.ok { background: rgba(88,214,160,.1); color: var(--ok); }
.audit-badge.ko { background: rgba(229,118,110,.12); color: var(--danger); }
.audit-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.audit-limits div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.audit-limits b { display: block; font-size: 15px; }
.audit-limits span { font-size: 11px; color: var(--muted); }
.audit-explain { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.audit-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.audit-rec {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 11.5px;
}
.audit-rec .l1 { display: flex; justify-content: space-between; gap: 8px; }
.audit-rec .act { color: var(--accent); font-weight: 700; }
.audit-rec .dec-ok { color: var(--ok); }
.audit-rec .dec-refused { color: var(--danger); }
.audit-rec .hash { color: var(--muted); word-break: break-all; margin-top: 3px; }

/* --- Modale --- */
.modal {
  position: fixed; inset: 0; background: rgba(0, 10, 10, .7); backdrop-filter: blur(6px);
  display: grid; place-items: end center; z-index: 50;
}
.modal-card {
  background: var(--surface-2); border: 1px solid var(--line); width: 100%; max-width: 480px;
  border-radius: 26px 26px 0 0; padding: 30px 24px calc(30px + env(safe-area-inset-bottom));
  text-align: center; animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-icon { font-size: 46px; margin-bottom: 10px; }
.modal-icon .spinner {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  border: 4px solid rgba(110,229,216,.2); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal-card h3 { font-size: 19px; margin-bottom: 6px; }
.modal-card p { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 14px; font-size: 14px; z-index: 60; max-width: 90vw;
  box-shadow: 0 6px 30px rgba(0,0,0,.4);
}
.toast.err { border-color: rgba(229,118,110,.5); }

/* hidden doit TOUJOURS gagner (sinon display:grid/flex le neutralise et un
   élément invisible intercepte les clics). */
[hidden] { display: none !important; }

/* --- Biométrie vocale --- */
.voice-banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 14px; padding: 14px 16px; text-align: left;
  background: linear-gradient(120deg, rgba(27,162,172,.25), rgba(8,100,131,.18));
  border: 1px solid var(--primary); border-radius: 16px; color: var(--text);
  font: inherit; cursor: pointer;
}
.voice-banner .ico { font-size: 22px; }
.voice-banner-text b { display: block; }
.voice-banner-text small { color: var(--muted); }
.voice-banner.enrolled {
  background: var(--surface); border-color: var(--line);
}
.voice-banner.enrolled .voice-banner-text b { color: var(--ok); }
.voice-card {
  margin-top: 18px; padding: 22px 18px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 18px; text-align: center;
  display: flex; flex-direction: column; gap: 16px;
}
.voice-step-label { color: var(--muted); font-size: 14px; }
.voice-phrase { font-size: 20px; font-weight: 600; color: var(--accent); min-height: 58px; }
