:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e8edf5;
  --blue: #1d4ed8;
  --blue-soft: #eff4ff;
  --navy: #0b1f4d;
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --nav-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #f7f8fa;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { max-width: 100%; display: block; }

.app-shell {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 18px calc(var(--nav-h) + 24px + var(--safe-bottom));
  position: relative;
}

.auth-shell {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pin-input {
  letter-spacing: 0.45em;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1d4ed8, #0b1f4d);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand span { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #7c3aed, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border: 0;
}

.balance-block { text-align: center; margin: 8px 0 22px; }
.balance-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.balance-amount {
  font-size: clamp(2.2rem, 8vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eye-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 24px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
}
.action-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: var(--blue);
}
.action span { font-size: 0.82rem; font-weight: 600; }

.wallet-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.wallet-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.wallet-card .flag { font-size: 1.1rem; margin-bottom: 6px; }
.wallet-card .label { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.wallet-card .amt { font-size: 1.2rem; font-weight: 800; margin: 6px 0; letter-spacing: -0.03em; }
.wallet-card .acct {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.promo {
  background: linear-gradient(120deg, #1d4ed8, #0b1f4d 70%);
  color: #fff;
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.promo h3 { font-size: 1.05rem; max-width: 70%; line-height: 1.35; }
.promo .cta {
  display: inline-flex;
  margin-top: 14px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
}
.promo::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 12px;
}
.section-head h2,
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.link { color: var(--blue); font-weight: 700; font-size: 0.85rem; }

.list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tx-item, .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.tx-item:last-child, .menu-item:last-child { border-bottom: 0; }
.tx-icon, .menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tx-body { flex: 1; min-width: 0; }
.tx-body strong, .menu-item strong { display: block; font-size: 0.95rem; }
.tx-body small, .menu-item small { color: var(--muted); }
.tx-amt { font-weight: 800; white-space: nowrap; }
.tx-amt.credit { color: var(--success); }
.tx-amt.debit { color: var(--text); }

.visa-card {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12), transparent 40%),
    linear-gradient(145deg, #132a66, #3b1d7a 55%, #1d4ed8);
  color: #fff;
  border-radius: 22px;
  padding: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 40px rgba(29, 78, 216, 0.28);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.visa-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -35deg,
    transparent,
    transparent 12px,
    rgba(255,255,255,0.03) 12px,
    rgba(255,255,255,0.03) 24px
  );
  pointer-events: none;
}
.visa-top, .visa-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
.visa-brand { font-weight: 800; letter-spacing: -0.03em; }
.visa-meta { font-size: 0.85rem; opacity: 0.9; }
.visa-num { letter-spacing: 0.18em; font-weight: 600; }

.card-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 8px 0 20px;
}
.card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.card-action .circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--navy);
}
.card-action .circle.filled {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.card-action span { font-size: 0.8rem; font-weight: 600; }

.wallet-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.wallet-banner strong { display: block; }
.wallet-banner small { color: var(--muted); }

.lifestyle-hero {
  background: radial-gradient(circle at 70% 20%, #1e3a8a, #020617 65%);
  color: #fff;
  border-radius: 28px;
  padding: 28px 20px 24px;
  text-align: center;
  margin: -4px 0 22px;
  box-shadow: var(--shadow);
}
.lifestyle-hero .orb {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 28px;
  background: linear-gradient(160deg, #94a3b8, #e2e8f0 40%, #64748b);
  display: grid;
  place-items: center;
  font-size: 2rem;
  box-shadow: inset 0 0 20px rgba(255,255,255,0.35);
}
.pts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.service-card:active { transform: scale(0.98); }
.service-card .art {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(160deg, #cbd5e1, #f8fafc);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.service-card h3 { font-size: 1rem; margin-bottom: 6px; }
.service-card p { color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin: 0 0 auto; }
.service-card .go {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  display: grid;
  place-items: center;
  margin-top: 14px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
}
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line);
}
.btn-row { display: grid; gap: 10px; margin-top: 8px; }

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-info { background: var(--blue-soft); color: var(--blue); border: 1px solid #bfdbfe; }

.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  z-index: 50;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--blue); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 22px 22px 18px 18px;
  padding: 20px;
  max-height: 85vh;
  overflow: auto;
}
.modal h3 { margin-bottom: 8px; }
.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
}
.copy-row code { font-family: ui-monospace, monospace; font-weight: 700; }

.skeleton {
  background: linear-gradient(90deg, #eef2ff, #f8fafc, #eef2ff);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: 12px;
  height: 16px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (min-width: 768px) {
  body { background: #dbe4f5; }
  .app-shell, .auth-shell {
    margin-top: 24px;
    margin-bottom: 24px;
    background: transparent;
  }
  .bottom-nav {
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(15,23,42,0.08);
  }
}
