/* ===========================================================================
   e-Shilling
   One stylesheet, no framework. Around 9 KB before compression, which is the
   whole point: on a 2G connection in Mogadishu a 200 KB CSS bundle is several
   seconds of blank screen before the balance appears.

   Mobile-first throughout. The layouts are designed at 360px and allowed to
   grow; the desktop rule at the bottom simply centres the same column.
   =========================================================================== */

:root {
  --blue:        #1267E8;
  --blue-2:      #2F80ED;
  --blue-dark:   #0B4FBA;
  --bg:          #F5F8FD;
  --white:       #FFFFFF;
  --ink:         #101828;
  --muted:       #667085;
  --line:        #E4E9F2;
  --success:     #12B76A;
  --success-bg:  #E7F8F0;
  --error:       #F04438;
  --error-bg:    #FEECEB;
  --warn:        #F59E0B;
  --warn-bg:     #FEF5E7;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --pad: 20px;
  --shadow:    0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-blue: 0 8px 24px rgba(18, 103, 232, .28);

  /* Safe area for iPhone home indicator and Android gesture bar. */
  --nav-h: calc(62px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* System fonts only — no webfont request, no layout shift, and Somali
     diacritics render correctly from the device's own font. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p  { margin: 0 0 12px; }
a  { color: var(--blue); text-decoration: none; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor;
        stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 24px; height: 24px; }
.icon-sm { width: 16px; height: 16px; }

/* --------------------------------------------------------------- structure */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
       background: var(--bg); position: relative; }
.page { padding: var(--pad) var(--pad) calc(var(--nav-h) + 24px); }
.page-flat { padding-bottom: 32px; }

.muted { color: var(--muted); }
.tiny  { font-size: 12px; }
.small { font-size: 13px; }
.center { text-align: center; }
.mt  { margin-top: 16px; }
.mt-lg { margin-top: 26px; }
.mb  { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ header */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px var(--pad); background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; flex: 1; text-align: center; }
.topbar .back, .topbar .act {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink); background: transparent; border: 0;
  cursor: pointer; flex: none;
}
.topbar .back:active, .topbar .act:active { background: var(--bg); }

/* -------------------------------------------------------------- home header */
.home-head {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--pad) 76px;
  color: #fff;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: rgba(255,255,255,.22); color: #fff;
}
.avatar-ink { background: #EEF4FE; color: var(--blue); }
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%;
        display: grid; place-items: center; background: rgba(255,255,255,.16);
        color: #fff; border: 0; }
.bell .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px;
             border-radius: 50%; background: var(--error);
             border: 2px solid var(--blue-dark); }

/* --------------------------------------------------------------- wallet card */
.wallet-card {
  margin: -60px var(--pad) 0;
  background: linear-gradient(140deg, #1B72F0 0%, #0B4FBA 100%);
  color: #fff; border-radius: var(--r-xl); padding: 20px;
  box-shadow: var(--shadow-blue); position: relative; overflow: hidden;
}
/* A single soft highlight, drawn in CSS. No image, no HTTP request. */
.wallet-card::after {
  content: ""; position: absolute; width: 200px; height: 200px;
  right: -70px; top: -90px; border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.wallet-card .label { font-size: 13px; opacity: .82; }
.wallet-card .amount { font-size: 32px; font-weight: 700; letter-spacing: -.5px;
                       margin: 4px 0 2px; }
.wallet-card .amount .cur { font-size: 17px; font-weight: 600; opacity: .85;
                            margin-right: 5px; }
.wallet-card .wnum { font-size: 13px; opacity: .8; letter-spacing: .8px;
                     font-variant-numeric: tabular-nums; }
.eye { width: 36px; height: 36px; border-radius: 50%; border: 0; color: #fff;
       background: rgba(255,255,255,.18); display: grid; place-items: center; }
.chip {
  background: rgba(255,255,255,.2); border: 0; color: #fff; font-weight: 600;
  font-size: 13px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}

/* ------------------------------------------------------------ quick actions */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
           margin: 22px var(--pad) 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px;
          padding: 4px; color: var(--ink); }
.action .bubble {
  width: 52px; height: 52px; border-radius: 18px; display: grid;
  place-items: center; background: var(--white); color: var(--blue);
  box-shadow: var(--shadow); transition: transform .12s;
}
.action:active .bubble { transform: scale(.94); }
.action span { font-size: 12px; font-weight: 500; }

/* -------------------------------------------------------------------- cards */
.card { background: var(--white); border-radius: var(--r-lg); padding: 16px;
        box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.section { margin: 26px var(--pad) 0; }
.section-head { display: flex; align-items: center; justify-content: space-between;
                margin-bottom: 12px; }
.section-head h2 { font-size: 16px; }
.section-head a { font-size: 13px; font-weight: 600; }

/* The promotional strip on the dashboard. */
.promo {
  margin: 22px var(--pad) 0; border-radius: var(--r-lg); padding: 16px 18px;
  background: linear-gradient(120deg, #EAF1FE, #F5F8FD);
  border: 1px solid #DCE7FB; display: flex; align-items: center; gap: 14px;
}
.promo .txt { flex: 1; }
.promo h3 { font-size: 15px; }
.promo p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.promo .qr { width: 46px; height: 46px; border-radius: 14px; flex: none;
             display: grid; place-items: center; background: var(--blue); color: #fff; }

/* ------------------------------------------------------------- list rows */
.list { background: var(--white); border-radius: var(--r-lg); overflow: hidden;
        box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 13px; padding: 14px 16px;
        color: var(--ink); border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item:active { background: #FAFCFF; }
.item .ico {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: #EEF4FE; color: var(--blue);
}
.item .ico.in   { background: var(--success-bg); color: var(--success); }
.item .ico.out  { background: var(--error-bg);   color: var(--error); }
.item .ico.warn { background: var(--warn-bg);    color: var(--warn); }
.item .body { flex: 1; min-width: 0; }
.item .body strong { display: block; font-size: 14.5px; font-weight: 600;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .body span { font-size: 12.5px; color: var(--muted); }
.item .amt { font-size: 14.5px; font-weight: 700; white-space: nowrap;
             font-variant-numeric: tabular-nums; }
.item .amt.in  { color: var(--success); }
.item .amt.out { color: var(--ink); }
.item .chev { color: #C4CDDB; flex: none; }

/* ------------------------------------------------------------------- forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted);
        margin: 0 0 7px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=password], select, textarea {
  width: 100%; padding: 14px 15px; font-size: 16px; /* 16px stops iOS zooming */
  color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r);
  font-family: inherit; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 82px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,103,232,.13);
}
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 42px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Phone number: fixed +252 prefix, so nobody has to type it. */
.phone { display: flex; gap: 8px; }
.phone .cc { flex: none; width: 74px; display: grid; place-items: center;
             border: 1.5px solid var(--line); border-radius: var(--r);
             background: var(--white); font-weight: 600; font-size: 15px; }
.phone input { flex: 1; }

/* Amount entry, sized so the figure is unmistakable. */
.amount-field { display: flex; align-items: center; gap: 10px;
                border: 1.5px solid var(--line); border-radius: var(--r);
                background: var(--white); padding: 4px 15px; }
.amount-field .cur { font-weight: 700; color: var(--muted); font-size: 16px; }
.amount-field input { border: 0; padding: 12px 0; font-size: 26px;
                      font-weight: 700; letter-spacing: -.5px; }
.amount-field input:focus { box-shadow: none; }
.amount-field:focus-within { border-color: var(--blue);
                             box-shadow: 0 0 0 3px rgba(18,103,232,.13); }

.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quick-amounts button {
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.quick-amounts button:active { border-color: var(--blue); color: var(--blue); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; font-size: 16px; font-weight: 600;
  border-radius: var(--r); border: 0; cursor: pointer; font-family: inherit;
  background: var(--blue); color: #fff; box-shadow: var(--shadow-blue);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--blue-dark); transform: translateY(1px); }
.btn[disabled] { opacity: .55; box-shadow: none; pointer-events: none; }
.btn-ghost { background: var(--white); color: var(--blue);
             box-shadow: none; border: 1.5px solid var(--line); }
.btn-quiet { background: transparent; color: var(--muted); box-shadow: none; }
.btn-danger { background: var(--error); box-shadow: none; }
.btn-sm { padding: 11px 16px; font-size: 14px; width: auto; }

/* ------------------------------------------------------------------- alerts */
.alert { border-radius: var(--r); padding: 13px 15px; font-size: 14px;
         margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error   { background: var(--error-bg);   color: #A6271C; }
.alert-success { background: var(--success-bg); color: #05643A; }
.alert-info    { background: #EAF1FE;           color: #0B4FBA; }
.alert .icon { flex: none; margin-top: 1px; }

/* --------------------------------------------------------------- PIN entry */
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 6px 0 4px; }
.pin-dots i {
  width: 54px; height: 58px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--white);
  display: grid; place-items: center;
}
.pin-dots i.filled { border-color: var(--blue); }
.pin-dots i.filled::after { content: ""; width: 13px; height: 13px;
                            border-radius: 50%; background: var(--blue); }
.pin-dots i.active { border-color: var(--blue);
                     box-shadow: 0 0 0 3px rgba(18,103,232,.13); }
/* The real input sits invisibly over the dots so the phone keypad opens. */
.pin-wrap { position: relative; }
.pin-wrap input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  border: 0; font-size: 16px; letter-spacing: 40px; padding: 0;
}

/* ------------------------------------------------------------------ review */
.review-amount { text-align: center; padding: 26px 0 20px; }
.review-amount .lead { font-size: 14px; color: var(--muted); }
.review-amount .big  { font-size: 34px; font-weight: 700; letter-spacing: -.8px;
                       margin-top: 6px; }
.kv { display: flex; justify-content: space-between; gap: 16px;
      padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.kv.total .v { font-size: 17px; }

/* ------------------------------------------------------------------ receipt */
.receipt-head { text-align: center; padding: 12px 0 20px; }
.receipt-head .seal {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; background: var(--success-bg);
  color: var(--success);
}
.receipt-head .seal.pending { background: var(--warn-bg);  color: var(--warn); }
.receipt-head .seal.failed  { background: var(--error-bg); color: var(--error); }
.receipt-head .big { font-size: 28px; font-weight: 700; letter-spacing: -.6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
         font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.badge-completed { background: var(--success-bg); color: #05643A; }
.badge-pending, .badge-processing { background: var(--warn-bg); color: #92400E; }
.badge-failed, .badge-cancelled   { background: var(--error-bg); color: #A6271C; }
.badge-reversed { background: #EEF2F6; color: var(--muted); }

/* -------------------------------------------------------------- tabs/filter */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a {
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--white); color: var(--muted); border: 1px solid var(--line);
}
.tabs a.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ------------------------------------------------------------ service grid */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px;
        padding: 14px 4px; background: var(--white); border-radius: var(--r);
        color: var(--ink); box-shadow: var(--shadow); text-align: center; }
.tile .bubble { width: 42px; height: 42px; border-radius: 14px;
                display: grid; place-items: center; }
.tile span { font-size: 11.5px; font-weight: 500; line-height: 1.25; }
.tile.soon { opacity: .55; }
.tile.soon::after { content: "Soon"; font-size: 9px; font-weight: 700;
                    color: var(--warn); letter-spacing: .4px; }

/* ----------------------------------------------------------------- bank row */
.bank-mono { width: 40px; height: 40px; border-radius: 12px; flex: none;
             display: grid; place-items: center; color: #fff;
             font-weight: 700; font-size: 13px; }

/* --------------------------------------------------------------- bottom nav */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  background: var(--white); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px;
         padding: 9px 0 7px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.nav a.on { color: var(--blue); }
.nav a.scan .ring {
  width: 44px; height: 44px; border-radius: 50%; margin-top: -18px;
  display: grid; place-items: center; background: var(--blue); color: #fff;
  box-shadow: var(--shadow-blue); border: 4px solid var(--white);
}
.nav a.scan span { margin-top: 1px; }

/* -------------------------------------------------------------- empty state */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .bubble { width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 14px;
                 display: grid; place-items: center; background: #EEF4FE; color: var(--blue); }

/* --------------------------------------------------------------- splash page */
.splash { min-height: 100vh; min-height: 100dvh; display: flex;
          flex-direction: column; background: var(--white); }
.splash .top { flex: 1; display: flex; flex-direction: column;
               align-items: center; justify-content: center; padding: 40px 28px;
               background: linear-gradient(180deg, #F5F8FD 0%, #E8F0FE 100%); }
.splash .foot { padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px)); }
.brand { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; color: var(--blue); }
.tagline { color: var(--muted); font-size: 14px; letter-spacing: 1.5px;
           text-transform: uppercase; margin-top: 8px; font-weight: 600; }

/* The logo is drawn as an SVG, so there is no image file and no request. */
.logo-mark { width: 84px; height: 84px; }

.dots { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #C9D8F5; }
.dots i.on { width: 20px; border-radius: 999px; background: var(--blue); }

/* ------------------------------------------------------------------ desktop */
@media (min-width: 560px) {
  body { background: #E9EEF6; }
  .app { box-shadow: 0 0 60px rgba(16,24,40,.10); }
  .nav { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* Users who ask for less motion get none. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
