/* ==========================================================================
   Vault Card — Premium fintech UI
   Design language: deep-navy surfaces, indigo→violet accents, soft depth.
   ========================================================================== */

:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e6e9f2;
  --border-soft: #eef1f7;

  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-deep: #3730a3;
  --accent-soft: #eef0ff;
  --accent-ghost: rgba(79, 70, 229, .08);

  --ok: #10b981;
  --ok-soft: #d9f7e9;
  --ok-ink: #047857;
  --danger: #f43f5e;
  --danger-soft: #ffe3e9;
  --danger-ink: #be123c;
  --warn: #f59e0b;
  --warn-soft: #fef3d9;
  --warn-ink: #b45309;
  --info: #0ea5e9;
  --info-soft: #dcf2fe;
  --info-ink: #0369a1;

  --navy-950: #0b1120;
  --navy-900: #101a33;
  --navy-800: #1a2440;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -12px rgba(16, 24, 40, .14);
  --shadow-lg: 0 18px 50px -12px rgba(79, 70, 229, .28);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -8px rgba(16, 24, 40, .10);

  --grad-accent: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-dark: linear-gradient(135deg, #0b1120 0%, #1b2450 60%, #2b1a5e 100%);
  --grad-mesh:
    radial-gradient(900px 480px at 12% -8%, rgba(124, 58, 237, .42), transparent 60%),
    radial-gradient(760px 420px at 88% 8%, rgba(79, 70, 229, .38), transparent 60%),
    radial-gradient(620px 520px at 55% 110%, rgba(14, 165, 233, .22), transparent 60%),
    linear-gradient(180deg, #0b1120 0%, #0e1530 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .6em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; margin-top: 1.6em; }
h3 { font-size: 16px; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(79, 70, 229, .18); }

/* ---------- utilities ---------- */
.muted { color: var(--muted); font-size: 13.5px; }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em; }
.wrap { overflow-wrap: anywhere; word-break: break-all; }
.center { text-align: center; }
.neg { color: var(--danger-ink); font-weight: 600; }
.pos { color: var(--ok-ink); font-weight: 600; }
.ic { flex-shrink: 0; vertical-align: -3px; }
code { background: var(--surface-2); border: 1px solid var(--border-soft); padding: 1px 7px; border-radius: 6px; font-size: 12.5px; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
/* Public pages (logged out): no sidebar — stack topbar above content so
   header.topbar stays a full-width sticky top bar instead of a flex-row item. */
.app--public { display: block; }

/* ----- sidebar (dark, premium) ----- */
.sidebar {
  width: 268px; flex-shrink: 0;
  background: var(--grad-dark);
  color: #c7d2fe;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: #fff; text-decoration: none; font-weight: 750; font-size: 17px; letter-spacing: -.01em;
  padding: 2px 6px;
}
.brand:hover { text-decoration: none; }
.brand-tile {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: var(--grad-accent);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .65);
}
.brand-logo {
  height: 32px; width: auto; max-width: 140px; object-fit: contain;
  border-radius: 8px; flex-shrink: 0; background: #fff; padding: 3px;
}
.who { font-size: 13px; color: #a5b4fc; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
.role {
  background: rgba(129, 140, 248, .16); border: 1px solid rgba(129, 140, 248, .3);
  color: #c7d2fe; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.25) transparent; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 3px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 10px 12px 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  flex-shrink: 0; /* links never compress: overflow must trigger nav scroll */
  color: #aab6d8; text-decoration: none;
  padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .16s ease;
  border: 1px solid transparent;
}
.sidebar nav a .ic { opacity: .75; }
.sidebar nav a:hover { background: rgba(148, 163, 184, .10); color: #fff; text-decoration: none; }
.sidebar nav a:hover .ic { opacity: 1; }
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(79,70,229,.32), rgba(124,58,237,.22));
  border-color: rgba(129, 140, 248, .35);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -10px rgba(79,70,229,.55);
}
.sidebar nav a.active .ic { opacity: 1; color: #c7d2fe; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.lang-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #7d8bb0; padding: 0 4px; }
.lang-switch .ic { opacity: .7; }
.lang-pill { display: inline-flex; background: rgba(148,163,184,.12); border: 1px solid rgba(148,163,184,.2); border-radius: 999px; padding: 2px; }
.lang-pill a { color: #aab6d8; text-decoration: none; padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 15px; line-height: 1.2; }
.lang-pill a.active { background: var(--grad-accent); color: #fff; box-shadow: 0 4px 12px -4px rgba(79,70,229,.6); }
.logout button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(148,163,184,.10); color: #cbd5e1; border: 1px solid rgba(148,163,184,.18);
  border-radius: 10px; padding: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  transition: background .16s ease, color .16s ease;
}
.logout button:hover { background: rgba(244,63,94,.16); color: #fecdd3; border-color: rgba(244,63,94,.3); }

/* ----- public topbar ----- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s ease, box-shadow .25s ease;
}
/* once scrolled, go fully opaque so page content never shows through */
.topbar.is-scrolled { background: #fff; box-shadow: 0 10px 30px -12px rgba(15, 23, 60, .18); }
/* keep nav buttons flat — no glow halo on the light bar */
.topbar .btn { box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.topbar .btn:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.topbar .brand { color: var(--ink); }
.topbar .brand-tile { box-shadow: 0 6px 16px -6px rgba(79,70,229,.5); }
.topbar nav { display: flex; align-items: center; gap: 10px; }
.topbar .lang-pill { background: var(--surface-2); border-color: var(--border); }
.topbar .lang-pill a { color: var(--muted); }
.topbar .lang-pill a.active { color: #fff; }
/* small phones: keep the topbar to one row — hide the secondary Log in button */
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .topbar .top-actions .btn.secondary { display: none; }
}

/* ----- content ----- */
.content { flex: 1; min-width: 0; padding: 30px 34px 60px; max-width: 1240px; }
.content.public { max-width: 1240px; margin: 0 auto; width: 100%; padding: 0 28px 70px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head h1 .ic { color: var(--accent); }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- buttons ---------- */
button, .btn {
  appearance: none; font-family: var(--font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad-accent); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 18px; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .6), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  white-space: nowrap;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(79, 70, 229, .65), inset 0 1px 0 rgba(255,255,255,.18); }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
button.danger, .btn.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 6px 16px -8px rgba(244,63,94,.55), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.small, button.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.secondary, button.secondary {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover, button.secondary:hover { color: var(--ink); border-color: #c9d2e8; filter: none; box-shadow: var(--shadow-sm); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; border: 0; }
.btn.ghost:hover { background: var(--accent-ghost); filter: none; box-shadow: none; }
.btn.big { padding: 13px 28px; font-size: 15.5px; border-radius: 12px; }
.btn.sm, button.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block, button.block { width: 100%; }
form.inline { display: inline-flex; margin: 2px; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent-ghost); color: var(--accent); cursor: pointer; padding: 0;
  transition: background .14s ease, transform .14s ease;
}
.icon-btn:hover { background: #e2e6ff; transform: translateY(-1px); }

/* ---------- cards & stats ---------- */
.card, .card-box {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: 20px; margin: 14px 0;
  box-shadow: var(--shadow-card);
}
.card h3:first-child, .card-box h3:first-child { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-card);
  display: flex; gap: 14px; align-items: flex-start;
  transition: transform .16s ease, box-shadow .16s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-ic {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--grad-accent); box-shadow: 0 8px 16px -8px rgba(79,70,229,.6);
}
.stat-ic.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 16px -8px rgba(16,185,129,.55); }
.stat-ic.amber { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 16px -8px rgba(245,158,11,.55); }
.stat-ic.rose { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 8px 16px -8px rgba(244,63,94,.55); }
.stat-ic.sky { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 8px 16px -8px rgba(14,165,233,.55); }
.stat-body { min-width: 0; }
.stat-label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.stat-value { font-size: 25px; font-weight: 750; letter-spacing: -.02em; }
/* legacy .stat-cards support */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 22px; }
.stat-cards .stat { display: block; }

/* ---------- tables ---------- */
.table-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; margin: 12px 0 24px; }
.table-card table { margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--surface); margin: 12px 0 24px; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; white-space: nowrap; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.active, .badge.paid { background: var(--ok-soft); color: var(--ok-ink); border-color: #b9efdc; }
.badge.frozen { background: var(--warn-soft); color: var(--warn-ink); border-color: #f5e2b8; }
.badge.canceled, .badge.expired, .badge.rejected { background: var(--danger-soft); color: var(--danger-ink); border-color: #f9cdd8; }
.badge.pending { background: var(--accent-soft); color: var(--accent-deep); border-color: #d7dbff; }

/* ---------- forms ---------- */
.form { background: var(--surface); border: 1px solid var(--border-soft); padding: 22px; border-radius: var(--r-lg); margin: 14px 0; max-width: 680px; box-shadow: var(--shadow-card); }
.form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
/* Vertical rhythm inside forms: every field block gets bottom space so
   action buttons never stick to the field above ("dính" buttons). */
.form:not(.grid) > label { margin-bottom: 14px; }
.form .form-row { margin-bottom: 14px; }
.form input, .form select, .form textarea, .toolbar input, .toolbar select, .inline input {
  padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px;
  background: var(--surface); color: var(--ink); font-family: var(--font); font-weight: 400;
  transition: border-color .14s ease, box-shadow .14s ease;
  min-width: 0;
}
/* Fill the label exactly (border-box): immune to flex-stretch quirks in odd browsers. */
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea { width: 100%; }
.form input::placeholder, .toolbar input::placeholder { color: var(--faint); }
.form input:focus, .form select:focus, .form textarea:focus, .toolbar input:focus, .toolbar select:focus, .inline input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.form .form-hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.actions { margin: 14px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- flash ---------- */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--r-md); margin: 0 0 18px; font-size: 14px; font-weight: 500;
  border: 1px solid;
}
.flash.error { background: var(--danger-soft); color: var(--danger-ink); border-color: #f9cdd8; }
.flash.success { background: var(--ok-soft); color: var(--ok-ink); border-color: #b9efdc; }
.flash .ic { margin-top: 1px; }

/* ---------- empty state ---------- */
.empty-state {
  background: var(--surface); border: 1.5px dashed #d4dae8; border-radius: var(--r-lg);
  padding: 40px 24px; text-align: center; color: var(--muted); margin: 14px 0; font-size: 14px;
}
.empty-ic {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.empty-state p { margin: 6px 0 0; }
.empty-state a { font-weight: 600; }

/* ==========================================================================
   PUBLIC LANDING
   ========================================================================== */
.landing { margin: 0 -28px; }
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-mesh); color: #fff;
  padding: 96px 28px 88px; text-align: center;
}
.hero::after {
  content: ''; position: absolute; inset: auto -20% -1px -20%; height: 90px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(129, 140, 248, .14); border: 1px solid rgba(129, 140, 248, .35);
  color: #c7d2fe; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  margin-bottom: 22px; backdrop-filter: blur(6px);
}
.hero-badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.hero-title { font-size: clamp(34px, 5.4vw, 58px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 18px; line-height: 1.08; }
.hero-title .grad {
  background: linear-gradient(100deg, #a5b4fc 0%, #c4b5fd 45%, #f0abfc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: #b6c2e2; font-size: clamp(15px, 2vw, 18px); max-width: 660px; margin: 0 auto 32px; line-height: 1.65; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn.big { box-shadow: 0 14px 34px -10px rgba(124, 58, 237, .65); }
.hero-cta .btn.ghostlight {
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22);
  box-shadow: none; backdrop-filter: blur(6px);
}
.hero-cta .btn.ghostlight:hover { background: rgba(255,255,255,.15); filter: none; }
.hero-stats { display: flex; gap: 36px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .hs { text-align: center; }
.hero-stats .hs b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.hero-stats .hs span { font-size: 13px; color: #8ea0c9; }

.section { max-width: 1120px; margin: 0 auto; padding: 72px 28px 8px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 750; letter-spacing: -.025em; margin: 0 0 10px; }
.section-head p { color: var(--muted); margin: 0; font-size: 15.5px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 26px 22px; box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.f-ic {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--grad-accent); box-shadow: 0 10px 20px -8px rgba(79,70,229,.55);
}
.f-ic.teal { background: linear-gradient(135deg, #0ea5e9, #2563eb); box-shadow: 0 10px 20px -8px rgba(14,165,233,.55); }
.f-ic.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 20px -8px rgba(16,185,129,.55); }
.feature h3 { margin: 0 0 8px; font-size: 16.5px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
.steps li {
  position: relative; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: 22px 20px 22px 76px; box-shadow: var(--shadow-card); font-size: 14.5px;
}
.step-n {
  position: absolute; left: 20px; top: 22px;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 750; font-size: 16px; display: flex; align-items: center; justify-content: center;
}

.bin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin: 8px 0 12px; }
.bin-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-card); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.bin-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bin-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad-accent); }
.bin-card h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.bin-org { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; margin-bottom: 12px; }
.bin-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 2px; }
.bin-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
/* itemized cost breakdown on the buy-card page */
.cost-breakdown { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.cb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; font-size: 14px; }
.cb-row span { color: var(--muted); }
.cb-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; font-size: 15px; }
.cb-total b { color: var(--accent-deep); }
.cb-note { margin: 8px 0 0; font-size: 12.5px; }
.bin-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 7px 0; border-top: 1px solid var(--border-soft); }
.bin-meta b { color: var(--ink); }

.cta-band {
  margin: 64px 28px 0; border-radius: var(--r-xl); overflow: hidden;
  background: var(--grad-mesh); color: #fff; text-align: center; padding: 60px 28px;
  position: relative;
}
.cta-band h2 { color: #fff; margin: 0 0 10px; font-size: clamp(22px, 3.4vw, 32px); }
.cta-band p { color: #b6c2e2; margin: 0 0 26px; }
.footer {
  margin-top: 70px; border-top: 1px solid var(--border);
  padding: 36px 28px 30px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 1120px; margin-left: auto; margin-right: auto;
}
.footer .f-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 15.5px; margin-bottom: 8px; }
.footer p { color: var(--muted); font-size: 13px; margin: 0; max-width: 340px; }
.footer nav { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.footer nav a { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.footer nav a:hover { color: var(--accent); }
.footer-bottom { max-width: 1120px; margin: 0 auto; padding: 0 28px 8px; color: var(--faint); font-size: 12.5px; }

/* ==========================================================================
   AUTH PAGES
   ========================================================================== */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--grad-mesh); position: relative; overflow: hidden; }
/* Captcha row (register): image never squishes; input takes the rest. */
.captcha-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.captcha-row img {
  flex: none; width: 160px; height: 56px; border: 1px solid var(--border);
  border-radius: 8px; background: #f1f5f9; cursor: pointer;
}
.captcha-row input { flex: 1; min-width: 0; }
.auth-visual {
  flex: 1.15; display: flex; flex-direction: column; justify-content: center; padding: 60px;
  color: #fff; position: relative; z-index: 1; max-width: 620px;
}
.auth-visual h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 14px; line-height: 1.15; }
.auth-visual h2 .grad { background: linear-gradient(100deg, #a5b4fc, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-visual p { color: #b6c2e2; font-size: 15.5px; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #dbe4ff; font-size: 14.5px; }
.auth-points .tick {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: rgba(52, 211, 153, .16); border: 1px solid rgba(52, 211, 153, .4); color: #6ee7b7;
  display: flex; align-items: center; justify-content: center;
}
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 28px; position: relative; z-index: 1; min-width: 0; }
.auth-card {
  background: rgba(255, 255, 255, .97); border-radius: var(--r-xl);
  box-shadow: 0 30px 80px -20px rgba(2, 6, 23, .55);
  padding: 36px 34px; width: 100%; max-width: 430px; min-width: 0;
  border: 1px solid rgba(255,255,255,.5);
}
.auth-card .brand-row { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; margin-bottom: 22px; }
.auth-card h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-card .form { background: none; border: 0; box-shadow: none; padding: 0; margin: 18px 0 0; max-width: none; }
.auth-card-wide { max-width: 560px; } /* register: room for the 2-column form */
.auth-card .form label { margin-bottom: 12px; }
.auth-card button[type="submit"] { width: 100%; margin-top: 6px; padding: 12px; font-size: 15px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ==========================================================================
   CUSTOMER PORTAL
   ========================================================================== */
/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 4px 2px; }
.pager-btn, .pager-num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pager-btn:hover, .pager-num:hover { background: var(--surface-2); text-decoration: none; }
.pager-num.active { background: var(--grad-accent); color: #fff; border-color: transparent; }
.pager-btn.disabled { opacity: .45; cursor: default; }
.pager-ellipsis { color: var(--muted); padding: 0 2px; }
.pager-info { margin-left: auto; font-size: 13px; color: var(--muted); }

/* Warm reminder banner (top of customer dashboard) */
.warm-reminder { position: relative; overflow: hidden; background: #fff; border: 1px solid #f3e2bd; border-radius: 20px; padding: 22px 24px 20px; margin-bottom: 20px; box-shadow: 0 10px 28px -14px rgba(217, 119, 6, .35); }
.warm-reminder::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #f6b73c, #d97706); }
.warm-reminder .wr-title { color: #d97706; font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; margin-bottom: 10px; }
.warm-reminder .wr-body { font-size: 14.5px; line-height: 1.7; color: #334155; }
.warm-reminder .wr-body p { margin: 0 0 8px; color: #0f172a; }
.warm-reminder .wr-body ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: wr; }
.warm-reminder .wr-body ol li { counter-increment: wr; display: flex; gap: 10px; }
.warm-reminder .wr-body ol li::before { content: counter(wr); flex: none; width: 24px; height: 24px; border-radius: 50%; background: #fef3e2; color: #d97706; font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; margin-top: 3px; }
.warm-reminder .wr-more { margin-top: 14px; border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; font-weight: 600; font-size: 13.5px; padding: 7px 18px; border-radius: 999px; cursor: pointer; }
.warm-reminder .wr-more:hover { background: #f1f5f9; border-color: #cbd5e1; }
.warm-reminder.collapsed .wr-body ol li:nth-child(n+3) { display: none; }

.wallet-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(420px 220px at 85% 10%, rgba(240, 171, 252, .35), transparent 60%),
    radial-gradient(520px 260px at 10% 110%, rgba(14, 165, 233, .30), transparent 60%),
    linear-gradient(135deg, #312e81 0%, #4f46e5 48%, #7c3aed 100%);
  padding: 30px 30px 26px; margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.wallet-hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(115deg, transparent 30%, #000 75%);
  -webkit-mask-image: linear-gradient(115deg, transparent 30%, #000 75%);
}
.wallet-hero > * { position: relative; z-index: 1; }
.wh-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #c7d2fe; margin-bottom: 6px; }
.wh-balance { font-size: clamp(38px, 6vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 2px 0 18px; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.wh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wh-actions .btn { box-shadow: none; }
.btn.light { background: #fff; color: var(--accent-deep); box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); }
.btn.light:hover { color: var(--accent-deep); filter: none; background: #f4f2ff; }
.btn.outline-light { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); box-shadow: none; backdrop-filter: blur(4px); }
.btn.outline-light:hover { background: rgba(255,255,255,.22); filter: none; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.section-title h2 .ic { color: var(--accent); }

/* virtual credit-card visual */
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin: 6px 0 8px; }
.vcard {
  position: relative; overflow: hidden; border-radius: 20px; color: #fff;
  padding: 22px 22px 18px; min-height: 208px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  box-shadow: 0 20px 44px -14px rgba(15, 23, 42, .5);
  transition: transform .18s ease, box-shadow .18s ease;
}
.vcard:hover { transform: translateY(-3px); }
.vcard.v1 { background: linear-gradient(130deg, #0f172a 0%, #1e1b4b 55%, #4c1d95 130%); }
.vcard.v2 { background: linear-gradient(130deg, #1e1b4b 0%, #4f46e5 70%, #7c3aed 130%); }
.vcard.v3 { background: linear-gradient(130deg, #082f49 0%, #0c4a6e 55%, #4f46e5 130%); }
.vcard::before {
  content: ''; position: absolute; width: 300px; height: 300px; right: -90px; top: -110px;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
}
.vcard::after {
  content: ''; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(120deg, transparent 40%, #000 90%);
  -webkit-mask-image: linear-gradient(120deg, transparent 40%, #000 90%);
}
.vcard > * { position: relative; z-index: 1; }
.vc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.vc-chip { width: 44px; height: 34px; border-radius: 7px;
  background: linear-gradient(135deg, #fde68a, #d4a94e);
  display: flex; align-items: center; justify-content: center; color: #7c5a1e;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.5);
}
.vc-brand { font-weight: 800; font-style: italic; letter-spacing: .08em; font-size: 15px; opacity: .95; }
.vc-number { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 19px; letter-spacing: .12em; display: flex; align-items: center; gap: 10px; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.vc-number .icon-btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); }
.vc-number .icon-btn:hover { background: rgba(255,255,255,.28); }
.vc-meta { display: flex; justify-content: space-between; align-items: flex-end; font-size: 12.5px; color: #cbd5e1; }
.vc-meta b { display: block; color: #fff; font-size: 14.5px; font-weight: 650; }
.vc-balance { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.vc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; margin-top: 2px; }
.vc-foot .badge { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); color: #fff; }
.vc-foot .badge::before { background: #34d399; opacity: 1; }
.vc-recharge { display: flex; gap: 6px; align-items: center; }
.vc-recharge input {
  width: 92px; padding: 7px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-family: var(--font);
}
.vc-recharge input::placeholder { color: #aab6d8; }
.vc-recharge input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.vc-recharge button { padding: 7px 13px; font-size: 13px; background: #fff; color: var(--accent-deep); box-shadow: none; }
.vc-recharge button:hover { background: #eef0ff; filter: none; }

/* ---------- top-up flow ---------- */
.steps-ind { display: flex; align-items: center; gap: 0; margin: 6px 0 22px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--faint); }
.step .n {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.step.done { color: var(--ok-ink); }
.step.done .n { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.step.now { color: var(--accent-deep); }
.step.now .n { background: var(--grad-accent); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(79,70,229,.6); }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 12px; border-radius: 2px; min-width: 16px; }
.step-line.done { background: var(--ok); }

.topup-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.qr-card { text-align: center; }
.qr-frame { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; display: inline-block; box-shadow: var(--shadow-sm); }
.qr-frame img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.pay-amount {
  font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 2px;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.pay-amount .cur { font-size: 15px; font-weight: 600; color: var(--muted); }
.copy-row {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; margin: 10px 0; font-size: 13.5px;
}
.copy-row .mono { flex: 1; min-width: 0; }
.countdown-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--warn-soft); color: var(--warn-ink); border: 1px solid #f5e2b8;
  font-weight: 700; font-size: 15px; padding: 7px 16px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.pay-status { margin: 12px 0; }
.amount-pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.amount-pick button { background: var(--surface-2); color: var(--ink-2); border: 1.5px solid var(--border); box-shadow: none; border-radius: 10px; padding: 8px 16px; font-weight: 650; }
.amount-pick button:hover, .amount-pick button.sel { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); filter: none; transform: none; }

/* ==========================================================================
   ADMIN
   ========================================================================== */
.provider-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(480px 240px at 90% 0%, rgba(124, 58, 237, .4), transparent 60%),
    linear-gradient(135deg, #0b1120 0%, #1e1b4b 70%, #312e81 100%);
  padding: 26px 28px; margin-bottom: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.provider-hero .ph-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: #a5b4fc; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.provider-hero .ph-value { font-size: clamp(32px, 5vw, 44px); font-weight: 800; letter-spacing: -.025em; }
.provider-hero .ph-sub { color: #8ea0c9; font-size: 13px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 550; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; }
/* ---------- Settings page: sticky section nav + single-column sections ---------- */
.settings-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px;
  padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.settings-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; font-weight: 550; text-decoration: none; line-height: 1.35;
}
.settings-nav a span { min-width: 0; overflow-wrap: anywhere; }
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a.active { background: var(--accent-ghost); color: var(--accent-deep); }
.settings-nav a .ic { flex: none; opacity: .7; }
.settings-nav a.active .ic { opacity: 1; }
.settings-sections { display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 920px; }
.settings-section { scroll-margin-top: 84px; }
.ss-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.ss-icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-deep); display: flex; align-items: center; justify-content: center;
}
.ss-head h3 { margin: 3px 0 4px; font-size: 17px; }
.ss-head p { margin: 0; font-size: 13.5px; }
@media (max-width: 960px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .settings-nav a { flex: none; white-space: nowrap; }
  .settings-sections { max-width: none; }
}
.test-result { font-size: 13.5px; font-weight: 600; margin-left: 8px; }
.test-result.ok { color: var(--ok-ink); }
.test-result.err { color: var(--danger-ink); }

/* ---------- error page ---------- */
.error-wrap { max-width: 560px; margin: 70px auto; text-align: center; }
.error-code {
  font-size: 84px; font-weight: 800; letter-spacing: -.04em;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}

/* ---------- focus & motion ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .content { padding: 24px 22px 50px; }
  .topup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-visual { display: none; }
  .auth-form-side { padding: 28px 18px; }
}
@media (max-width: 640px) {
  /* 16px inputs stop iOS Safari zooming the page on focus. */
  .form input, .form select, .form textarea, .toolbar input, .toolbar select, .inline input { font-size: 16px; }
  .auth-card { padding: 28px 20px; }
  .captcha-row img { width: 132px; height: 46px; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 50;
    padding: 10px 12px; gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .brand { font-size: 16px; padding: 0 2px; }
  .brand-tile { width: 30px; height: 30px; border-radius: 9px; }
  .who { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 6px; padding: 2px 0 6px; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { white-space: nowrap; font-size: 13px; padding: 8px 12px; }
  .nav-label { display: none; }
  .side-foot { margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  .logout { flex-shrink: 0; }
  .logout button { width: auto; padding: 8px 14px; }
  .content { padding: 18px 14px 46px; max-width: none; }
  .content.public { padding: 0 0 50px; }
  .landing { margin: 0; }
  .hero { padding: 64px 18px 70px; }
  .section { padding: 52px 16px 4px; }
  .cta-band { margin: 48px 14px 0; padding: 44px 20px; }
  .footer { padding: 28px 16px 22px; }
  .form.grid { grid-template-columns: 1fr; }
  .form { padding: 18px; }
  .vcards { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  h1 { font-size: 22px; }
  th, td { padding: 9px 10px; font-size: 13.5px; }
  .table-scroll { margin: 0 -14px; padding: 0 14px; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive thead { display: none; }
  table.responsive { background: none; }
  table.responsive tr {
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md);
    margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm);
  }
  table.responsive td { border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.responsive td:last-child { border-bottom: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .wh-actions .btn { flex: 1; }
}

/* ==========================================================================
   CRAFT PASS — senior fintech polish
   Explicit 8pt spacing scale, type scale, tabular numerals, unified motion,
   toast flash, skeleton shimmer, FAQ, hero visual.
   ========================================================================== */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --text-display: clamp(34px, 5.4vw, 58px);
  --text-h1: 26px; --text-h2: 19px; --text-h3: 16px;
  --text-body: 15px; --text-small: 13.5px; --text-caption: 12.5px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 180ms;
}

/* tabular numerals for all money figures; mono already on card numbers */
.num, .wh-balance, .stat-value, .bin-price, .pay-amount, .vc-balance, .ph-value,
.countdown-pill, td b, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'cv05' 1;
}

/* unified motion: 150–200ms ease on every interactive element */
a, button, .btn, .icon-btn, .sidebar nav a, .feature, .bin-card, .stat, .vcard,
.amount-pick button, .lang-pill a, .faq summary, .faq summary .ic, .topbar {
  transition-duration: var(--dur);
  transition-timing-function: var(--ease);
}
button:active, .btn:active { transform: translateY(1px) scale(.99); }
.icon-btn:active { transform: scale(.9); }
.sidebar nav a:active { transform: translateX(2px); }
input:disabled, select:disabled, textarea:disabled {
  opacity: .6; background: var(--surface-2); cursor: not-allowed;
}
.faq summary:focus-visible, .lang-pill a:focus-visible, .vcard:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---- toast-style flash ---- */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.flash { animation: toast-in .28s var(--ease); box-shadow: var(--shadow-sm); }

/* ---- skeleton shimmer for loading states ---- */
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.skel {
  border-radius: 8px; color: transparent !important; user-select: none; pointer-events: none;
  background: linear-gradient(90deg, var(--surface-2) 25%, #e8edf7 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skel-line { height: 14px; margin: 8px 0; }
.skel-line.w60 { width: 60%; }
.skel-line.w40 { width: 40%; }
.skel-line.w80 { width: 80%; }

/* ---- FAQ (details/summary, no JS) ---- */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq details[open] { border-color: #c9d2f5; }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 650; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--accent); flex-shrink: 0; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq summary:hover { color: var(--accent-deep); }
.faq .faq-a { padding: 0 20px 18px; color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.65; }

/* ---- collapsible branding block (referrals page) ---- */
.brand-toggle summary {
  list-style: none; cursor: pointer; padding: 4px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px;
}
.brand-toggle summary::-webkit-details-marker { display: none; }
.brand-toggle summary::marker { content: ''; }
.brand-toggle summary .ic { color: var(--accent); flex-shrink: 0; transition: transform .18s ease; }
.brand-toggle[open] summary .ic { transform: rotate(180deg); }
.brand-toggle summary:hover { color: var(--accent-deep); }
.brand-toggle summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- hero visual: floating card + chips (decorative) ---- */
.hero-visual {
  position: relative; z-index: 2;
  max-width: 980px; margin: -64px auto 0; padding: 0 28px 8px;
  display: flex; justify-content: center; pointer-events: none;
}
.hero-visual .vcard { width: min(360px, 86vw); min-height: 200px; }
.hero-card-float { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(-2deg); }
}
.hero-chip {
  position: absolute; background: rgba(255, 255, 255, .96); color: var(--ink);
  border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 16px;
  font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg); animation: floaty 8s ease-in-out infinite; white-space: nowrap;
}
.hero-chip.c1 { left: 8%; top: 6%; animation-delay: -2s; }
.hero-chip.c2 { right: 7%; bottom: 10%; animation-delay: -5s; }
.hero-chip .ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(16, 185, 129, .16); flex-shrink: 0; }
.hero-chip .ic { color: var(--accent); }
@media (max-width: 860px) {
  .hero-visual { margin-top: -48px; padding: 0 16px 4px; }
  .hero-chip.c1 { left: 3%; }
  .hero-chip.c2 { right: 3%; }
  .hero-chip { font-size: 12px; padding: 8px 12px; }
}

/* ---- referral program ---- */
.form label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.form label.check input[type="checkbox"] { width: 18px; height: 18px; padding: 0; border-radius: 5px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > * { min-width: 0; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.ref-code-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--info-soft, #eef2ff); font-weight: 700; letter-spacing: .06em; }
.tier-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.tier-badge.starter { background: #eef2ff; color: #4f46e5; }
.tier-badge.partner { background: #fef3c7; color: #b45309; }
.tier-badge.vip { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.tier-progress { height: 10px; border-radius: 999px; background: var(--border-soft, #e5e7eb); overflow: hidden; margin-top: 8px; }
.tier-progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }

/* ---------- UI hygiene: classes replacing inline styles ---------- */
.form-plain { box-shadow: none; border: 0; padding: 0; margin: 14px 0 0; max-width: 420px; }
.form-plain.wide { max-width: 520px; margin-top: 10px; }
.input-lg { font-size: 18px; font-weight: 700; }
.ref-dash { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ref-dash .grow { flex: 1; min-width: 180px; }
.ref-dash .lead { font-weight: 700; font-size: 17px; }
.ref-dash .lead .muted { font-weight: 500; font-size: 13px; }
.ref-dash .sub { font-size: 13px; }
.qr-hint { margin: 12px 0 0; }
.mt12 { margin-top: 12px; }
.small-note { margin: 8px 0 0; font-size: 12.5px; }
.h3-row { display: flex; align-items: center; gap: 9px; }
.send-to { margin-top: -4px; }
.amount-label { margin-bottom: 2px; }
.pay-amount.start { justify-content: flex-start; }
.flash.info { background: var(--info-soft); border-color: #bde6fb; color: var(--info-ink); margin: 12px 0; }
.btn.big-lbl { font-size: 15px; }
.auto-note { margin-top: 10px; }
.auth-brand { margin-bottom: 34px; }
.back-home { margin-top: 22px; }
.tier-badge.sm { font-size: 12px; padding: 3px 10px; margin-left: 6px; }

/* ---------- public topbar center links (homepage) ---------- */
.top-links { display: flex; align-items: center; gap: 26px; }
.top-links a { color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.top-links a:hover { color: var(--ink); }
@media (max-width: 900px) { .top-links { display: none; } }
/* anchor offset under sticky topbar + smooth scroll */
.hp-sec[id] { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- fluid public main (full-bleed homepage) ---------- */
.content.public.fluid { max-width: none; padding: 0 0 70px; }

/* ---------- dark floating pill nav (homepage hero) ---------- */
.topbar-dark {
  position: fixed;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1220px, calc(100% - 28px));
  border-radius: 18px;
  background: rgba(10, 15, 38, .55);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55);
  padding: 12px 22px;
  z-index: 60;
}
.topbar-dark .brand { color: #fff; }
.topbar-dark .top-links a { color: rgba(226, 232, 255, .72); }
.topbar-dark .top-links a:hover { color: #fff; }
.topbar-dark .lang-pill { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.topbar-dark .lang-pill a { color: rgba(226,232,255,.65); }
.topbar-dark .lang-pill a.active { color: #fff; }
/* keep the dark pill dark once scrolled (override the light .is-scrolled) */
.topbar-dark.is-scrolled { background: rgba(10, 15, 38, .88); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .65); }
@media (max-width: 640px) {
  .topbar-dark { top: 10px; width: calc(100% - 20px); padding: 10px 16px; border-radius: 16px; }
}

/* ----- mobile app-like drawer nav (public header) ----- */
.mnav-btn { display: none; }
.mnav-drawer[hidden], .mnav-scrim[hidden] { display: none !important; }
@media (max-width: 720px) {
  .topbar .top-links,
  .topbar .top-actions { display: none; }
  .topbar { flex-wrap: nowrap; }
  .mnav-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: 0 0 auto;
    border-radius: 12px; border: 1px solid transparent;
    background: transparent; color: var(--ink); cursor: pointer; padding: 0;
    box-shadow: none;
  }
  .mnav-btn:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; filter: none; transform: none; }
  .topbar-dark .mnav-btn { color: #fff; }
  .topbar-dark .mnav-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .mnav-scrim {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(8, 12, 30, .5);
    opacity: 0; transition: opacity .25s ease;
  }
  .mnav-scrim.open { opacity: 1; }
  .mnav-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
    width: min(320px, 84vw); background: var(--surface);
    box-shadow: -18px 0 50px -20px rgba(8, 12, 30, .45);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.32, .72, .28, 1);
    display: flex; flex-direction: column;
    padding: 14px 18px 22px; overflow-y: auto;
  }
  .mnav-drawer.open { transform: none; }
  .mnav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .mnav-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; border: 0;
    background: transparent; color: var(--muted); cursor: pointer; padding: 0;
    box-shadow: none;
  }
  .mnav-close:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; filter: none; transform: none; }
  .mnav-links {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 0; margin: 6px 0 0;
    border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  }
  .mnav-links a {
    display: flex; align-items: center; gap: 14px;
    min-height: 54px; padding: 12px;
    border-radius: 12px; color: var(--ink);
    font-size: 16px; font-weight: 650; text-decoration: none;
  }
  .mnav-links a:hover { background: var(--surface-2); }
  .mnav-links a .ic { color: var(--accent); flex: 0 0 auto; }
  .mnav-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 18px; }
  .mnav-actions .btn { width: 100%; padding: 13px 18px; font-size: 15px; }
  .mnav-foot { display: flex; justify-content: center; padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mnav-scrim, .mnav-drawer { transition: none; }
}

/* Leaderboard ranks */
.rank-n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #eef2f7; color: #475569; }
.rank-3 { background: #ffedd5; color: #c2410c; }

/* Withdrawal status badges */
.wd-status { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.wd-status.pending { background: #fef3c7; color: #b45309; }
.wd-status.paid { background: #dcfce7; color: #15803d; }
.wd-status.rejected { background: #fee2e2; color: #b91c1c; }

/* Admin nav badge (pending counts) */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; }

/* Notification center */
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: #eef2ff; }
.notif-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.notif-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.notif-body small { font-size: 12px; }
.notif-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #4f46e5; }
