:root {
  --bg: #EEF1F8; --card: #ffffff; --ink: #0E1526; --ink-2: #55607A;
  --muted: #6C7690; --line: #E4E8F3; --line-strong: #D3D9EA;
  --blue: #3B5BDB; --blue-deep: #1E2A6B; --amber: #FFB020;
  --good: #1F9D57; --bad: #C0392B; --dark: #0E1526;
  --disp: "Space Grotesk", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; }
html, body { margin: 0; }
body { background: var(--dark); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
input, select, button, textarea { font-family: inherit; }

.app { position: relative; max-width: 460px; margin: 0 auto; background: var(--bg); overflow-x: hidden; }
.screen { min-height: 100vh; display: flex; flex-direction: column; position: relative; }

.mode-badge { position: fixed; top: 12px; left: 50%; transform: translateX(150px); z-index: 60;
  font-family: var(--disp); font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
  padding: 4px 9px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.mode-badge.mock { background: #FFEBC7; color: #7A4A06; }
.mode-badge.live { background: #D3F0DE; color: #16603A; }
@media (max-width: 480px) { .mode-badge { transform: none; left: auto; right: 12px; } }

h1 { font-family: var(--disp); font-weight: 700; font-size: 31px; line-height: 1.06; letter-spacing: -0.6px; margin: 0 0 8px; }
.lede { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 20px; }

/* buttons */
.primary { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  background: var(--blue); color: #fff; border: none; cursor: pointer; font-family: var(--disp);
  font-weight: 600; font-size: 17px; padding: 17px; border-radius: 16px;
  box-shadow: 0 14px 24px -12px rgba(59,91,219,.75); }
.primary:hover { filter: brightness(1.06); } .primary:active { transform: translateY(1px); }
.push { margin-top: auto; }

/* segmented progress */
.prog4 { display: flex; gap: 7px; }
.prog4 .seg { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.prog4 .seg.on { background: var(--blue); } .prog4 .seg.done { background: var(--good); }
.prog4.on-dark .seg, .prog4 .seg.dim { background: rgba(255,255,255,.16); }
.prog4.on-dark .seg.on { background: var(--blue); } .prog4.on-dark .seg.done { background: var(--good); }

/* top nav */
.topnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topnav .back { width: 42px; height: 42px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink); }
.topnav .step { font-size: 13px; font-weight: 700; color: var(--muted); }
.topnav.on-dark .back { background: rgba(255,255,255,.1); border: none; color: #fff; }

/* fields */
.fld { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.fld-in { display: block; width: 100%; margin-top: 9px; font-size: 16px; font-weight: 600;
  padding: 15px 16px; border: 1.5px solid var(--line-strong); border-radius: 15px;
  background: #fff; color: var(--ink); appearance: none; -webkit-appearance: none; }
.fld-in.strong { font-family: var(--disp); letter-spacing: .5px; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(59,91,219,.12); }
.fld-in::placeholder { color: #9198AD; font-weight: 500; letter-spacing: 0; }
.fld-in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59,91,219,.14); }
select.fld-in { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236C7690' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 42px; }
.hint { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 9px; }
.hint.bad { color: var(--bad); }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0 10px; }
.two { display: flex; gap: 12px; }
.two .fld { flex: 1; }

/* ===== START (hero) ===== */
.s-start { background: var(--bg); padding-bottom: 26px; }
.hero { position: relative; background: var(--blue); padding: 58px 26px 86px; border-radius: 0 0 34px 34px; overflow: hidden; color: #fff; }
.hero-c1 { position: absolute; top: -70px; right: -60px; width: 230px; height: 230px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-c2 { position: absolute; bottom: 20px; right: -46px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,176,32,.18); }
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.hero-logo { height: 26px; width: auto; filter: brightness(0) invert(1); }
.chip { font-size: 12px; font-weight: 700; color: #fff; background: rgba(255,255,255,.18); padding: 6px 13px; border-radius: 999px; }
.hero-title { font-family: var(--disp); position: relative; margin: 34px 0 0; font-weight: 700; font-size: 40px; line-height: 1.03; letter-spacing: -1px; }
.hero-sub { position: relative; margin: 15px 0 0; color: rgba(255,255,255,.84); font-size: 15px; line-height: 1.5; max-width: 290px; }
.float-card { margin: -54px 22px 0; background: #fff; border-radius: 24px; padding: 22px; box-shadow: 0 24px 48px -20px rgba(20,32,80,.34); position: relative; }
.fc-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input-icon { margin-top: 13px; display: flex; align-items: center; gap: 11px; border: 1.5px solid var(--line-strong); border-radius: 15px; padding: 4px 15px; background: #FAFBFE; }
.input-icon svg { flex: none; }
.input-icon input { flex: 1; border: none; background: transparent; padding: 14px 0; font-size: 16px; font-weight: 600; color: var(--ink); outline: none; }
.input-icon input::placeholder { color: #9198AD; font-weight: 500; }
.float-card .primary { margin-top: 15px; }
.trust { margin: 20px 22px 0; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.spacer-top { margin: 22px 22px 0; }
.prog4-labels { display: flex; margin: 9px 22px 0; }
.prog4-labels span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.prog4-labels span.on { color: var(--ink); font-weight: 700; }

/* ===== LIGHT screens (card, form, review, cardconfirm) ===== */
.s-light { background: var(--bg); padding: 56px 24px 28px; }

/* ghana card visual */
.gcard { margin: 24px 0 4px; border-radius: 22px; padding: 22px; background: var(--ink); position: relative; overflow: hidden; box-shadow: 0 20px 40px -22px rgba(14,21,38,.6); }
.gcard-c1 { position: absolute; top: -40px; right: -30px; width: 150px; height: 150px; border-radius: 50%; background: rgba(59,91,219,.35); }
.gcard-c2 { position: absolute; bottom: -50px; left: -20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,176,32,.18); }
.gcard-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.gcard-name { color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 1.5px; }
.flag { display: flex; gap: 3px; } .flag i { width: 14px; height: 9px; border-radius: 2px; }
.flag i:nth-child(1){background:#CE1126;} .flag i:nth-child(2){background:#FCD116;} .flag i:nth-child(3){background:#006B3F;}
.gcard-chip { width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(135deg,#F5D36B,#C9A227); margin: 20px 0 16px; position: relative; }
.gcard-num { font-family: var(--disp); color: #fff; font-size: 20px; font-weight: 600; letter-spacing: 2px; position: relative; }

/* detail / review rows */
.rows { list-style: none; padding: 0; margin: 4px 0 20px; }
.rows.card-rows { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 18px; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows li:last-child { border-bottom: none; }
.rows li > span:first-child { color: var(--muted); font-weight: 600; font-size: 14px; }
.rows li .ok, .rows li .val { color: var(--ink); font-weight: 700; text-align: right; }

/* amount hero */
.amount-hero { margin: 8px 0 20px; background: var(--ink); border-radius: 20px; padding: 18px 22px; position: relative; overflow: hidden; }
.ah-c1 { position: absolute; top: -40px; right: -30px; width: 150px; height: 150px; border-radius: 50%; background: rgba(59,91,219,.42); }
.ah-label { position: relative; color: rgba(255,255,255,.6); font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.ah-input { position: relative; display: flex; align-items: baseline; gap: 9px; margin-top: 6px; }
.ah-cur { font-family: var(--disp); color: rgba(255,255,255,.7); font-size: 22px; font-weight: 600; }
.ah-input input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: #fff;
  font-family: var(--disp); font-size: 40px; font-weight: 700; letter-spacing: -1px; padding: 0; }
.ah-input input::placeholder { color: rgba(255,255,255,.4); }
.ah-input input::-webkit-outer-spin-button, .ah-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ah-input input { -moz-appearance: textfield; }
.ah-pills { position: relative; display: flex; gap: 8px; margin-top: 15px; }
.ah-pills button { border: none; cursor: pointer; font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; }
.ah-pills button.on { background: var(--amber); color: var(--ink); }

/* loan-type pills */
.pills { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.pills button { border: 1.5px solid var(--line-strong); background: #fff; cursor: pointer; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--ink); border-radius: 14px; padding: 14px 4px; }
.pills button.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* quote (deduction) card */
.quote { background: var(--blue); border-radius: 20px; padding: 20px 22px; margin: 2px 0 16px; position: relative; overflow: hidden; }
.quote-c1 { position: absolute; bottom: -44px; right: -26px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,176,32,.24); }
.quote-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; position: relative; }
.quote-row span { color: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; flex: none; }
.quote-row strong { font-family: var(--disp); color: #fff; font-size: 27px; font-weight: 700; letter-spacing: -0.5px; text-align: right; }
.quote-ref { position: relative; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.6); margin-top: 10px; word-break: break-all; }

/* ===== SELFIE (dark) ===== */
.s-dark { background: var(--ink); color: #fff; padding: 56px 24px 30px; overflow: hidden; }
.selfie-glow { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); width: 340px; height: 340px; border-radius: 50%; background: rgba(59,91,219,.22); filter: blur(12px); }
.white { color: #fff; position: relative; }
.lede-d { color: rgba(255,255,255,.66); font-size: 15px; line-height: 1.5; margin: 0 0 4px; position: relative; }
.oval { position: relative; margin: 26px auto 0; width: 244px; height: 312px; }
.oval video, .oval img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 122px / 156px; background: #1A2338; border: 3px solid rgba(255,255,255,.14); }
.br { position: absolute; width: 34px; height: 34px; }
.br.tl { top: -4px; left: 22px; border-top: 4px solid var(--amber); border-left: 4px solid var(--amber); border-radius: 14px 0 0 0; }
.br.tr { top: -4px; right: 22px; border-top: 4px solid var(--amber); border-right: 4px solid var(--amber); border-radius: 0 14px 0 0; }
.br.bl { bottom: -4px; left: 22px; border-bottom: 4px solid var(--amber); border-left: 4px solid var(--amber); border-radius: 0 0 0 14px; }
.br.brr { bottom: -4px; right: 22px; border-bottom: 4px solid var(--amber); border-right: 4px solid var(--amber); border-radius: 0 0 14px 0; }
.tips { display: flex; gap: 8px; justify-content: center; margin-top: 24px; position: relative; }
.tips span { font-size: 12px; font-weight: 600; color: #fff; background: rgba(255,255,255,.1); padding: 8px 13px; border-radius: 999px; }
.shutter-wrap { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.shutter { width: 78px; height: 78px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,.28); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.shutter span { width: 56px; height: 56px; border-radius: 50%; background: var(--amber); display: block; }
.shutter-wrap .primary, .ghost-d { width: 100%; }
.ghost-d { background: rgba(255,255,255,.08); color: #fff; border: 1.5px solid rgba(255,255,255,.2); cursor: pointer;
  font-family: var(--disp); font-weight: 600; font-size: 15px; padding: 14px; border-radius: 14px; }
.fallback { display: block; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.7); margin-top: 16px; position: relative; }
.fallback input { display: block; margin-top: 10px; color: #fff; }

/* ===== RESULT (blue) ===== */
.s-result { background: var(--blue); color: #fff; align-items: center; padding: 0 26px 32px; overflow: hidden; }
.res-c1 { position: absolute; top: -90px; left: -70px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); }
.res-c2 { position: absolute; bottom: 70px; right: -70px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,176,32,.16); }
.result { position: relative; text-align: center; width: 100%; padding-top: 132px; }
.result .big { width: 108px; height: 108px; border-radius: 50%; margin: 0 auto 30px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.result .big::after { content: ""; width: 78px; height: 78px; border-radius: 50%; background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%231F9D57' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.result h1 { color: #fff; margin: 0 0 12px; font-size: 34px; }
.result .lede { color: rgba(255,255,255,.82); margin: 0 auto; max-width: 300px; }
.result .chipbox { margin: 24px auto 0; background: rgba(255,255,255,.14); border-radius: 16px; padding: 15px 22px; display: inline-block; }
.result .chipbox .k { display: block; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.result .chipbox .v { display: block; font-family: var(--disp); color: #fff; font-size: 21px; font-weight: 700; letter-spacing: 1px; margin-top: 5px; }
.result .rows { text-align: left; margin-top: 22px; }
.result .rows li { border-color: rgba(255,255,255,.16); }
.result .rows li > span:first-child { color: rgba(255,255,255,.66); }
.result .rows li .val { color: #fff; }
.result .token { margin: 22px auto 0; background: rgba(255,255,255,.1); border: none; text-align: left; color: rgba(255,255,255,.7); }
.result .token code { color: #fff; }
.on-blue-btn { width: 100%; background: #fff; color: var(--blue); border: none; cursor: pointer;
  font-family: var(--disp); font-weight: 700; font-size: 17px; padding: 18px; border-radius: 16px; }

/* token box (light contexts) */
.token { margin-top: 20px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; word-break: break-all; text-align: left; }
.token code { color: var(--ink); font-size: 12px; }

/* ===== global overlays ===== */
.error { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
  width: calc(100% - 36px); max-width: 424px; background: #201014; color: #FFD9D2;
  border: 1px solid #4a2a2a; border-radius: 14px; padding: 13px 15px; font-size: 13px; font-weight: 600;
  line-height: 1.45; box-shadow: 0 14px 34px rgba(0,0,0,.3); }
.spinner { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 80;
  display: flex; align-items: center; gap: 11px; background: var(--ink); color: #fff; font-size: 14px;
  font-weight: 600; padding: 14px 20px; border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.spinner span { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.25); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* PWA update toast */
.pwa-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff;
  border-radius: 14px; padding: 12px 12px 12px 18px; font-size: 14px; font-weight: 600;
  box-shadow: 0 14px 34px rgba(0,0,0,.34); max-width: calc(100vw - 28px); }
.pwa-toast button { border: none; cursor: pointer; font-family: var(--disp); border-radius: 10px; }
.pwa-toast #pwa-reload { background: var(--blue); color: #fff; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.pwa-toast #pwa-reload:hover { filter: brightness(1.08); }
.pwa-toast #pwa-dismiss { background: none; color: rgba(255,255,255,.6); font-size: 19px; line-height: 1; padding: 2px 6px; }
.pwa-toast #pwa-dismiss:hover { color: #fff; }

/* ---- Track entry link (on hero start screen) ---- */
.link-btn { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 44px); margin: 18px 22px 4px; padding: 13px; background: transparent;
  border: 1.5px solid var(--line-strong); border-radius: 14px; cursor: pointer;
  font-family: var(--body); font-weight: 700; font-size: 14px; color: var(--blue); }
.link-btn:active { background: #fff; }

/* Back control reused as a real button */
.back.as-btn { background: transparent; border: none; padding: 0; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; }

/* Secondary (ghost) button */
.ghost { display: flex; align-items: center; justify-content: center; width: 100%;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line-strong); cursor: pointer;
  font-family: var(--disp); font-weight: 600; font-size: 16px; padding: 16px; border-radius: 16px; }
.ghost:active { background: var(--bg); }

/* ---- Application status ---- */
.status-head { margin: 6px 0 22px; }
.status-pill { display: inline-block; padding: 7px 14px; border-radius: 999px;
  font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: .01em;
  color: #fff; background: var(--blue); }
.status-pill.info { background: var(--blue); }
.status-pill.good { background: var(--good); }
.status-pill.warn { background: var(--amber); color: #3a2a00; }
.status-pill.bad  { background: var(--bad); }
.status-no { margin-top: 14px; font-family: var(--disp); font-weight: 700; font-size: 26px;
  color: var(--ink); letter-spacing: .01em; }
.status-name { margin-top: 4px; color: var(--muted); font-weight: 600; font-size: 14px; }

.timeline { list-style: none; padding: 4px 0 6px; margin: 0 0 18px; }
.timeline li { position: relative; padding: 0 0 22px 30px; }
.timeline li:last-child { padding-bottom: 0; }
/* connector line */
.timeline li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: -4px;
  width: 2px; background: var(--line-strong); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); box-sizing: border-box; }
.timeline li.done .tl-dot { background: var(--good); border-color: var(--good); }
.timeline li.done::before { background: var(--good); }
.timeline li.active .tl-dot { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59,91,219,.16); }
.timeline li.good .tl-dot { background: var(--good); border-color: var(--good); }
.timeline li.bad  .tl-dot { background: var(--bad); border-color: var(--bad); }
.timeline .tl-body { display: flex; flex-direction: column; }
.timeline .tl-t { font-weight: 700; font-size: 15px; color: var(--ink-2); }
.timeline li.done .tl-t, .timeline li.active .tl-t { color: var(--ink); }
.timeline .tl-sub { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ---- Launch splash ---- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  opacity: 1;
  transition: opacity .5s ease;
}
.splash.hide {
  opacity: 0;
  pointer-events: none;
}
.splash-logo {
  height: 42px;
  width: auto;
  animation: splash-in .5s ease both;
}
.splash-tagline {
  margin: 0;
  font-family: var(--disp);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-2);
  animation: splash-in .5s ease .08s both;
}
.splash-dots {
  display: flex;
  gap: 7px;
}
.splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: splash-pulse 1s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splash-pulse {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-4px); }
}
@keyframes splash-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-tagline { animation: none; }
  .splash-dots span { animation: none; opacity: .7; }
}
