:root {
  --pine-900: #06231a;
  --pine-800: #0a3326;
  --pine-700: #0f4534;
  --pine-600: #145c44;
  --pine-500: #1a7555;
  --pine-400: #2a9d72;
  --pine-300: #57c39a;
  --pine-100: #d8f5ea;
  --grey-900: #0e0e0f;
  --grey-800: #17181a;
  --grey-700: #202226;
  --grey-600: #2b2e33;
  --grey-500: #3a3e45;
  --grey-400: #5c636e;
  --grey-300: #8b939f;
  --grey-200: #c3c9d0;
  --grey-100: #e9ebee;
  --bg: #0a0b0d;
  --surface: #121417;
  --surface-2: #1a1d21;
  --border: #262a30;
  --text: #eef1f4;
  --text-dim: #9aa1a9;
  --accent: #1a7555;
  --accent-bright: #57c39a;
  --danger: #e5484d;
  --warning: #e8902c;
  --ok: #46c68f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--pine-300); text-decoration: none; }
a:hover { color: var(--pine-100); }

/* Animated background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(26,117,85,0.25), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(87,195,154,0.12), transparent 55%),
    linear-gradient(180deg, #0a0b0d 0%, #0c0f11 100%);
}
.bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(87,195,154,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87,195,154,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 60px);
  background: rgba(10,12,14,0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: 0.3px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--pine-400), var(--pine-700));
  display: grid; place-items: center;
  color: white; font-size: 18px;
  box-shadow: 0 4px 14px rgba(42,157,114,0.4);
}
.brand .sub { color: var(--pine-300); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { color: var(--text-dim); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pine-500), var(--pine-700));
  display: grid; place-items: center; font-weight: 700; color: white; font-size: 15px;
}
.btn-link { background: none; border: none; color: var(--text-dim); cursor: pointer; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; }
.btn-link:hover { color: var(--danger); background: rgba(229,72,77,0.1); }

/* Hero / landing */
.hero {
  position: relative;
  padding: clamp(70px, 12vh, 130px) clamp(20px, 6vw, 90px) 60px;
  max-width: 1280px;
  margin: 0 auto;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--pine-300); background: rgba(26,117,85,0.15);
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(26,117,85,0.4);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1px;
  max-width: 850px;
  margin-bottom: 22px;
}
.hero h1 .grad,
.grad-text { background: linear-gradient(120deg, var(--pine-300), var(--accent-bright)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: clamp(16px, 2vw, 20px); color: var(--text-dim); max-width: 620px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px; font-weight: 700; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; font-family: inherit;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--pine-400), var(--pine-600)); color: white; box-shadow: 0 8px 24px rgba(26,117,85,0.4); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(26,117,85,0.55); }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--pine-500); }
.btn.ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--grey-400); }
.btn.danger { background: rgba(229,72,77,0.15); color: #ff9a9c; border-color: rgba(229,72,77,0.4); }
.btn.danger:hover { background: rgba(229,72,77,0.25); }
.btn.small { padding: 9px 16px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Rate cards */
.rates {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px;
  max-width: 1280px; margin: 40px auto; padding: 0 clamp(20px, 6vw, 90px);
}
.rate-card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.rate-card:hover { transform: translateY(-4px); border-color: var(--pine-600); }
.rate-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pine-500), var(--pine-300));
}
.rate-card .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); font-weight: 700; }
.rate-card .value { font-size: 38px; font-weight: 800; color: var(--pine-300); margin: 8px 0 4px; }
.rate-card .desc { font-size: 13px; color: var(--text-dim); }

/* Shell */
.shell { max-width: 1180px; margin: 0 auto; padding: 34px clamp(18px, 4vw, 60px); }
.view { display: none; }
.view.active { display: block; animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.view-head p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }

.card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card .hint { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }

.balance-big { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.balance-big .cur { font-size: 22px; color: var(--text-dim); margin-right: 4px; }
.balance-label { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }

/* American-style gradient debit card */
.debit-card {
  position: relative;
  border-radius: 18px; padding: 26px;
  background: linear-gradient(135deg, #164e38, #0a3326 55%, #071c14);
  border: 1px solid rgba(87,195,154,0.25);
  overflow: hidden; min-height: 200px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.debit-card::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(87,195,154,0.25), transparent 70%);
}
.debit-card .chip {
  width: 44px; height: 34px; border-radius: 6px; margin-bottom: 26px;
  background: linear-gradient(135deg, #e7c874, #b8933a, #e7c874);
  position: relative;
}
.debit-card .chip::after {
  content: ''; position: absolute; inset: 7px; border: 1px solid rgba(0,0,0,0.25); border-radius: 3px;
}
.debit-card .acct-type { font-size: 14px; text-transform: uppercase; letter-spacing: 2px; color: var(--pine-300); font-weight: 700; }
.debit-card .amount { font-size: 30px; font-weight: 800; color: white; margin-top: 6px; }
.debit-card .foot { margin-top: 22px; display: flex; justify-content: space-between; align-items: flex-end; }
.debit-card .holder { font-size: 13px; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 1px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 13px 15px; border-radius: 10px;
  background: var(--grey-900); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 15px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--pine-500); box-shadow: 0 0 0 3px rgba(26,117,85,0.2); }
.input-row { display: flex; gap: 12px; }
.input-row .field { flex: 1; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.pill.ok { background: rgba(70,198,143,0.15); color: var(--ok); }
.pill.warn { background: rgba(232,144,44,0.15); color: var(--warning); }
.pill.danger { background: rgba(229,72,77,0.15); color: #ff9a9c; }
.pill.neutral { background: rgba(139,147,159,0.15); color: var(--text-dim); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 13px 18px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.amount-pos { color: var(--ok); font-weight: 700; }
.amount-neg { color: #ff9a9c; font-weight: 700; }

/* Toast */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(120px);
  z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center;
  transition: transform 0.3s ease; pointer-events: none;
}
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 13px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  max-width: 90vw; pointer-events: auto;
}
.toast.success { border-color: var(--ok); }
.toast.error { border-color: var(--danger); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 480px; padding: 30px; box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  animation: fadein 0.2s ease;
}
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.hidden { display: none !important; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .between { justify-content: space-between; } .align-center { align-items: center; } .gap-10 { gap: 10px; } .wrap { flex-wrap: wrap; }

.url-box {
  background: var(--grey-900); border: 1px dashed var(--border);
  padding: 12px 16px; border-radius: 10px; font-size: 15px; font-weight: 600;
  color: var(--pine-300); word-break: break-all; user-select: all;
}

.countdown { font-size: 34px; font-weight: 800; color: var(--pine-300); }

.card.bubble {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  text-align: left; cursor: pointer; width: 100%;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
  font-family: inherit; color: inherit;
}
.card.bubble:hover {
  transform: translateY(-3px);
  border-color: var(--pine-400);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}
.card.bubble .value { font-size: 34px; font-weight: 800; color: var(--pine-300, #5cc9a0); }
.card.bubble .hint { margin-bottom: 6px; }

@media (max-width: 720px) {
  .nav-links a:not(.inline-keep) { display: none; }
  nav { flex-wrap: wrap; gap: 10px; }
  .hero h1 { font-size: 34px; }
  .input-row { flex-direction: column; }
}
