:root {
  --bg: #0f1114;
  --bg-card: #191c21;
  --bg-card-2: #21252c;
  --accent: #ffdd2d;
  --accent-dark: #e0c000;
  --text: #f5f6f7;
  --text-dim: #9aa0a8;
  --border: #2a2e35;
  --danger: #ff5c5c;
  --success: #34c77b;
  --radius: 18px;
  --radius-sm: 12px;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-card-2: #eef0f3;
  --text: #16181c;
  --text-dim: #6b7078;
  --border: #e2e4e8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Manrope', 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background .2s, color .2s;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--text-dim); font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--text); }

.header-actions { display: flex; gap: 10px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #14161a; }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: rgba(255,92,92,0.12); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 70px 0;
}
.hero h1 { font-size: 46px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-bottom: 18px; }
.hero p { color: var(--text-dim); font-size: 17px; margin-bottom: 28px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; }

/* Card visual */
.bank-card {
  width: 340px;
  aspect-ratio: 1.586;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.card-worldcard { background: linear-gradient(135deg, #7a1030, #c41e3a 45%, #f2a900 100%); }
.card-metrolis { background: linear-gradient(135deg, #14224d, #1a3e8c 55%, #2e5bc7 100%); }
.card-primecard { background: linear-gradient(135deg, #1c1f26, #33383f 60%, #4a5058 100%); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-brand { font-weight: 800; font-size: 17px; letter-spacing: 0.5px; }
.card-logo-badge {
  height: 26px; max-width: 120px; object-fit: contain;
  background: rgba(255,255,255,0.9); border-radius: 6px; padding: 3px 6px;
}
.card-chip {
  width: 42px; height: 32px; border-radius: 6px;
  background: linear-gradient(135deg, #e9d38a, #c9a94d);
}
.card-number { font-size: 20px; letter-spacing: 3px; font-weight: 600; font-family: 'Courier New', monospace; }
.card-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; }
.card-holder { text-transform: uppercase; letter-spacing: 0.5px; }
.card-holder-label, .card-expiry-label { display: block; font-size: 9px; opacity: 0.7; text-transform: uppercase; margin-bottom: 2px; }
.card-frozen-badge {
  position: absolute; inset: 0; background: rgba(10,12,15,0.72);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; backdrop-filter: blur(2px);
}

/* Cards small in lists */
.mini-card { width: 100%; max-width: 300px; }

/* Sections */
.section { padding: 60px 0; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.section-subtitle { color: var(--text-dim); margin-bottom: 32px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Product card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.product-card h3 { font-size: 19px; margin-bottom: 6px; }
.product-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }
.product-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: var(--bg-card-2); padding: 4px 10px; border-radius: 20px;
  color: var(--accent-dark); margin-bottom: 14px;
}

/* Steps */
.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--bg-card-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  color: var(--accent-dark); flex-shrink: 0;
}
.step h4 { font-size: 15px; margin-bottom: 3px; }
.step p { color: var(--text-dim); font-size: 14px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}
.disclaimer {
  max-width: 640px;
  margin: 10px auto 0;
  font-size: 12px;
  opacity: 0.7;
}

/* Auth forms */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field-error.show { display: block; }

.auth-switch { margin-top: 18px; text-align: center; font-size: 14px; color: var(--text-dim); }
.auth-switch a { color: var(--accent-dark); font-weight: 700; }

.alert {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
}
.alert-error { background: rgba(255,92,92,0.12); color: var(--danger); }
.alert-success { background: rgba(52,199,123,0.12); color: var(--success); }

/* App shell (after login) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
}
.sidebar .logo { padding: 0 10px 24px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 600; font-size: 14px;
}
.side-link:hover { background: var(--bg-card-2); color: var(--text); }
.side-link.active { background: var(--bg-card-2); color: var(--accent-dark); }
.side-link .ic { width: 20px; text-align: center; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

.main-area { flex: 1; padding: 28px 36px; max-width: 980px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px;
}
.topbar h1 { font-size: 24px; font-weight: 800; }
.balance-hero {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 30px; margin-bottom: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
}
.balance-hero .amount { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.balance-hero .label { color: var(--text-dim); font-size: 13px; margin-bottom: 4px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 20px;
}
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.panel-title a { font-size: 13px; color: var(--accent-dark); font-weight: 600; }

.tx-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.tx-row:last-child { border-bottom: none; }
.tx-left { display: flex; align-items: center; gap: 12px; }
.tx-ic {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg-card-2);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.tx-name { font-weight: 600; font-size: 14px; }
.tx-date { color: var(--text-dim); font-size: 12px; }
.tx-amount { font-weight: 700; font-size: 14px; }
.tx-amount.plus { color: var(--success); }
.tx-amount.minus { color: var(--text); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .ic { font-size: 34px; margin-bottom: 10px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--text-dim); font-size: 12px; font-weight: 700; padding: 8px 10px; text-transform: uppercase; }
td { padding: 12px 10px; border-top: 1px solid var(--border); font-size: 14px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-success { background: rgba(52,199,123,0.12); color: var(--success); }
.badge-frozen { background: rgba(255,92,92,0.12); color: var(--danger); }

.tabs { display: flex; gap: 4px; background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; width: fit-content; }
.tab { padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-dim); border: none; background: transparent; }
.tab.active { background: var(--bg-card); color: var(--text); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: var(--radius); padding: 28px;
  width: 100%; max-width: 400px; border: 1px solid var(--border);
}
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; font-size: 14px; min-width: 240px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--border);
  border-radius: 24px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .2s;
}
input:checked + .slider { background: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.deposit-progress {
  width: 100%; height: 8px; background: var(--bg-card-2); border-radius: 10px; overflow: hidden; margin: 10px 0;
}
.deposit-progress-fill { height: 100%; background: var(--accent); }

.notif-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notif-item.read .notif-dot { background: var(--border); }

#atm-map { height: 380px; border-radius: var(--radius-sm); overflow: hidden; }

.error-page {
  min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.error-page .code { font-size: 90px; font-weight: 800; color: var(--accent); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar .logo, .sidebar-footer { display: none; }
  .main-area { padding: 20px; }
  .nav { display: none; }
}
