/* =========================================================
   RBNW WALLET — Design System
   Matches PDF reference: deep blue + green brand, rounded
   cards, soft shadows, bottom tab navigation, mobile-first.
   ========================================================= */

:root {
  --rbnw-blue-dark: #0b3d7a;
  --rbnw-blue: #0f4c92;
  --rbnw-blue-light: #1a63b8;
  --rbnw-green: #4caf50;
  --rbnw-green-light: #7fc242;
  --rbnw-gradient: linear-gradient(135deg, var(--rbnw-blue-dark) 0%, var(--rbnw-blue) 55%, var(--rbnw-green) 130%);
  --bg: #f4f7fb;
  --card: #ffffff;
  --text-dark: #16233d;
  --text-muted: #6b7787;
  --border: #e6eaf1;
  --danger: #e0453f;
  --success: #2fa84f;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 8px 24px rgba(15, 76, 146, 0.08);
  --shadow-soft: 0 2px 10px rgba(15, 76, 146, 0.06);
  --max-w: 460px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-dark);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------------------------------------------------------
   App shell — centers a phone-width column on desktop,
   goes full width on actual mobile devices.
   --------------------------------------------------------- */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 500px) {
  body {
    background: #dfe6f0;
  }
  .app-shell {
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(11, 61, 122, 0.15);
  }
}

.app-main {
  flex: 1;
  padding: 16px 16px 90px;
}

/* ---------------------------------------------------------
   Auth screens (login / register)
   --------------------------------------------------------- */
.auth-screen {
  background: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.auth-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-decor svg {
  position: absolute;
}

.auth-decor .decor-top-right {
  top: -30px;
  right: -60px;
  width: 250px;
  height: 250px;
  opacity: 1;
}

.auth-decor .decor-left-blob {
  top: 190px;
  left: -55px;
  width: 150px;
  height: 150px;
}

.auth-decor .decor-bottom {
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 190px;
  z-index: 0;
}

.auth-brand {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 54px 24px 10px;
  color: var(--text-dark);
}

.auth-brand .logo-img {
  width: 150px;
  height: auto;
  margin: 0 auto 4px;
  display: block;
}

.auth-brand .tagline {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 26px;
  margin: 4px 14px 46px;
  padding: 22px 22px 26px;
  box-shadow: 0 16px 34px rgba(11, 61, 122, 0.14);
}

.auth-card h2 {
  margin: 0 0 4px;
  font-size: 21px;
  color: var(--rbnw-blue-dark);
  font-weight: 800;
}

.auth-card p.subtitle {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #fbfcfe;
  transition: border-color .15s;
}

.input-wrap:focus-within {
  border-color: var(--rbnw-blue-light);
  background: #fff;
}

.input-wrap input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 15px;
  color: var(--text-dark);
}

.input-wrap .icon { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.input-wrap .toggle-visibility { color: var(--text-muted); font-size: 15px; background:none; border:none; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
}

.row-between a { color: var(--rbnw-blue); font-weight: 600; }

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  transition: filter .15s, transform .05s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--rbnw-gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 76, 146, 0.28);
}

.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }

.btn-blue {
  background: linear-gradient(180deg, #1a63c4 0%, #0f4c92 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 76, 146, 0.3);
}
.btn-blue:hover { filter: brightness(1.05); }
.btn-blue:disabled { opacity: 0.55; box-shadow: none; }

.btn-outline {
  background: #fff;
  color: var(--rbnw-blue);
  border: 1.5px solid var(--border);
}

.btn-biometric {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 700;
}

.btn-biometric .fp-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--rbnw-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.btn-ghost {
  background: transparent;
  color: var(--rbnw-blue);
}

.btn-sm { padding: 9px 14px; font-size: 13px; }

.divider-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 18px 0;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.footer-link {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 20px;
}
.footer-link a { color: var(--rbnw-blue); font-weight: 700; }

/* ---------------------------------------------------------
   Top bar (dashboard header)
   --------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 6px;
}

.topbar .greet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--rbnw-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.greet .name { font-weight: 700; font-size: 15.5px; }
.greet .verified { font-size: 11.5px; color: var(--success); display:flex; align-items:center; gap:4px; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--text-dark);
}

.badge-dot {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
}

/* ---------------------------------------------------------
   Balance card
   --------------------------------------------------------- */
.balance-card {
  background: var(--rbnw-gradient);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  margin: 12px 0 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.balance-card::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  top: -80px; right: -60px;
}

.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.wallet-level-chip {
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 11px;
}

.balance-amount {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.balance-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
  z-index: 1;
}

.balance-actions button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}

.balance-actions button.primary-action {
  background: var(--rbnw-green);
}

/* ---------------------------------------------------------
   Quick services grid
   --------------------------------------------------------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 10px;
}
.section-head h3 { margin: 0; font-size: 15px; }
.section-head a { font-size: 12.5px; color: var(--rbnw-blue); font-weight: 700; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 6px;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.service-item .icon-tile {
  width: 50px; height: 50px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  color: var(--rbnw-blue);
}

.service-item span { font-size: 11px; color: var(--text-dark); font-weight: 600; line-height: 1.2; }

/* ---------------------------------------------------------
   Cards / list rows
   --------------------------------------------------------- */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}

.promo-banner {
  background: var(--rbnw-gradient);
  border-radius: var(--radius-md);
  padding: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.promo-banner .txt strong { display: block; font-size: 13.5px; }
.promo-banner .txt span { font-size: 11.5px; opacity: 0.85; }
.promo-banner .shield { font-size: 26px; opacity: 0.9; }

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.tx-row:last-child { border-bottom: none; }

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.tx-icon.tx-in { background: #e6f7ea; color: var(--success); }
.tx-icon.tx-out { background: #fdeceb; color: var(--danger); }

.tx-info { flex: 1; min-width: 0; }
.tx-info .tx-title { font-size: 13.5px; font-weight: 700; }
.tx-info .tx-time { font-size: 11.5px; color: var(--text-muted); }

.tx-amount { font-size: 13.5px; font-weight: 700; }
.tx-amount.tx-in { color: var(--success); }
.tx-amount.tx-out { color: var(--danger); }

/* ---------------------------------------------------------
   Bottom navigation
   --------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.bottom-nav .nav-item.active { color: var(--rbnw-blue); }
.bottom-nav .nav-item i { font-size: 18px; }

.bottom-nav .scan-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--rbnw-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin: -26px auto 0;
  box-shadow: 0 6px 16px rgba(15,76,146,0.35);
  border: 4px solid var(--bg);
}

/* ---------------------------------------------------------
   Flow / step screens (Send Money, Top Up, etc.)
   --------------------------------------------------------- */
.flow-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.flow-header h2 { margin: 0; font-size: 16px; }
.flow-header .back-btn { font-size: 18px; color: var(--text-dark); }

.flow-body { padding: 18px 16px 100px; }

.amount-display {
  text-align: center;
  padding: 20px 0 10px;
}
.amount-display input {
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  color: var(--rbnw-blue);
  width: 100%;
}
.amount-display .avail { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.quick-amounts {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0 20px;
  flex-wrap: wrap;
}
.quick-amounts button {
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rbnw-blue);
}
.quick-amounts button.active { background: var(--rbnw-blue); color: #fff; border-color: var(--rbnw-blue); }

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.contact-item .avatar { width: 40px; height: 40px; font-size: 13px; }
.contact-item .info .cname { font-size: 13.5px; font-weight: 700; }
.contact-item .info .cmobile { font-size: 11.5px; color: var(--text-muted); }

.review-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.review-row:last-child { border-bottom: none; font-weight: 800; }
.review-row .label { color: var(--text-muted); }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 30px 0;
}
.pin-dots .dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--rbnw-blue);
  background: transparent;
}
.pin-dots .dot.filled { background: var(--rbnw-blue); }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 280px;
  margin: 0 auto;
}
.pin-keypad button {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: var(--shadow-soft);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}
.pin-keypad button.empty { background: transparent; box-shadow: none; }

.success-screen {
  text-align: center;
  padding: 40px 16px;
}
.success-check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: #e6f7ea;
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 18px;
}
.success-screen h2 { margin: 0 0 4px; font-size: 19px; }
.success-screen .amt { font-size: 26px; font-weight: 800; color: var(--rbnw-blue); margin: 14px 0; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error { background: #fdeceb; color: var(--danger); }
.alert-success { background: #e6f7ea; color: var(--success); }
.alert-info { background: #eaf2ff; color: var(--rbnw-blue); }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
