/* ─── RESET & BASE ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #070b14;
  --bg-card:   #0d1526;
  --bg-card2:  #111e35;
  --border:    rgba(255,255,255,.08);
  --accent:    #3b82f6;
  --accent2:   #8b5cf6;
  --green:     #10b981;
  --text:      #e2e8f0;
  --text-muted:#7a8fa8;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 20px 60px rgba(0,0,0,.5);
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ─── NAV ───────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 32px;
  padding: 18px 40px;
  background: rgba(7,11,20,.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav.scrolled { padding: 12px 40px; }
.nav-logo { font-size: 1.25rem; font-weight: 700; letter-spacing: -.5px; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0 auto; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .9rem; transition: color var(--transition); }
.nav-links a:hover { color: var(--text); }

/* ─── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 100px;
  font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer;
  border: none; transition: all var(--transition);
}
.btn-sm { padding: 8px 18px; font-size: .82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 24px rgba(59,130,246,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(59,130,246,.5); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }

/* ─── BADGE ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 100px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(59,130,246,.12); color: var(--accent); border: 1px solid rgba(59,130,246,.25);
}

/* ─── GRADIENT TEXT ─────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ─── SECTION HEADER ────────────────────────────── */
.section-header {
  text-align: center; max-width: 620px; margin: 0 auto 64px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.section-header h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.2; }
.section-header p { color: var(--text-muted); font-size: .95rem; }

/* ─── NAV AUTH ──────────────────────────────────── */
.nav-auth { display: flex; align-items: center; gap: 8px; }
.nav-user { font-size: .84rem; color: var(--text-muted); padding-right: 4px; }

/* ─── HERO ──────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: .18;
}
.hero-orb-1 {
  width: 600px; height: 600px; top: -150px; left: -100px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
}
.hero-orb-2 {
  width: 500px; height: 500px; bottom: -100px; right: -80px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}
.hero-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
  max-width: 720px;
}
.hero-content h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.12; }
.hero-sub { font-size: 1.05rem; color: var(--text-muted); max-width: 520px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: flex; align-items: center; gap: 24px;
  margin-top: 16px; padding-top: 32px; border-top: 1px solid var(--border);
  width: 100%; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .78rem; color: var(--text-muted); max-width: 140px; line-height: 1.4; }
.stat-divider { width: 1px; height: 48px; background: var(--border); }

/* ─── FEATURES ──────────────────────────────────── */
.features { padding: 100px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 28px; display: flex; flex-direction: column; gap: 16px;
  transition: transform var(--transition), border-color var(--transition);
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,.3); }
.feature-card--highlight {
  background: linear-gradient(160deg, rgba(59,130,246,.12), rgba(139,92,246,.08));
  border-color: rgba(59,130,246,.3);
}
.feature-icon { font-size: 2rem; }
.feature-card h3 { font-size: 1.15rem; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.feature-list li { font-size: .85rem; color: var(--text-muted); padding-left: 18px; position: relative; }
.feature-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ─── CALCULATOR ────────────────────────────────── */
.calculator-section { padding: 100px 0; background: linear-gradient(180deg, transparent, rgba(59,130,246,.04), transparent); }
.calc-wrapper {
  display: grid; grid-template-columns: 340px 1fr; gap: 32px;
  align-items: start;
}
.calc-inputs {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px;
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 100px;
}
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: .82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.input-row {
  display: flex; align-items: center;
  background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.input-row:focus-within { border-color: var(--accent); }
.input-prefix, .input-suffix {
  padding: 0 12px; font-weight: 600; color: var(--text-muted); font-size: .9rem;
  background: rgba(255,255,255,.03);
}
.input-row input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 1rem; font-weight: 600; padding: 12px 8px;
  min-width: 0;
}
.rate-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: .75rem; cursor: pointer;
  transition: all var(--transition);
}
.preset:hover, .preset.active { background: rgba(59,130,246,.15); border-color: var(--accent); color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] {
  flex: 1; -webkit-appearance: none; height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 50%, var(--border) 50%);
  outline: none;
}
.range-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
.range-val { font-weight: 700; font-size: .9rem; white-space: nowrap; min-width: 72px; text-align: right; }

/* ─── RESULTS ───────────────────────────────────── */
.calc-results { display: flex; flex-direction: column; gap: 24px; }
.results-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.result-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px 18px; display: flex; flex-direction: column; gap: 6px;
}
.result-card--main {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(139,92,246,.1));
  border-color: rgba(59,130,246,.35); padding: 28px 24px;
}
.result-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.result-value { font-size: 2.4rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.result-value--sm { font-size: 1.5rem; }
.result-value--green { background: linear-gradient(135deg, var(--green), #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.result-sub { font-size: .8rem; color: var(--text-muted); }
.chart-container {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; min-height: 300px;
}

/* ─── BREAKDOWN TABLE ───────────────────────────── */
.breakdown-toggle { text-align: center; }
.breakdown-table {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-height: 320px; overflow-y: auto;
}
.breakdown-table table { width: 100%; border-collapse: collapse; }
.breakdown-table th {
  padding: 12px 16px; text-align: right; font-size: .78rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg-card2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.breakdown-table th:first-child { text-align: left; }
.breakdown-table td { padding: 10px 16px; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.03); text-align: right; }
.breakdown-table td:first-child { text-align: left; font-weight: 600; }
.breakdown-table tr:hover td { background: rgba(255,255,255,.02); }
.td-green { color: var(--green); }

/* ─── GOALS ─────────────────────────────────────── */
.goals-section { padding: 100px 0; }
.goals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.goal-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 22px; display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--transition), border-color var(--transition);
}
.goal-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,.3); }
.goal-card--featured {
  background: linear-gradient(160deg, rgba(59,130,246,.15), rgba(139,92,246,.1));
  border-color: rgba(59,130,246,.4);
}
.goal-icon { font-size: 2rem; }
.goal-card h3 { font-size: 1rem; font-weight: 700; }
.goal-card p { font-size: .83rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.goal-target { font-size: .85rem; font-weight: 700; color: var(--accent); }

/* ─── CTA ───────────────────────────────────────── */
.cta-section { padding: 80px 0; }
.cta-box {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.1));
  border: 1px solid rgba(59,130,246,.3); border-radius: 24px;
  padding: 72px 48px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.cta-orb {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.15), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
.cta-box h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.25; position: relative; }
.cta-box p { color: var(--text-muted); max-width: 440px; position: relative; }

/* ─── FOOTER ────────────────────────────────────── */
.footer { padding: 32px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-disclaimer { font-size: .75rem; color: var(--text-muted); max-width: 600px; line-height: 1.6; }

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .goals-grid { grid-template-columns: 1fr 1fr; }
  .calc-wrapper { grid-template-columns: 1fr; }
  .calc-inputs { position: static; }
}
@media (max-width: 700px) {
  .nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .goals-grid { grid-template-columns: 1fr; }
  .results-cards { grid-template-columns: 1fr 1fr; }
  .result-card--main { grid-column: 1 / -1; }
  .hero-stats { gap: 16px; }
  .stat-divider { display: none; }
  .cta-box { padding: 48px 24px; }
}

/* ─── ANIMATIONS ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * {
  animation: fadeUp .6s ease both;
}
.hero-content > *:nth-child(1) { animation-delay: .05s; }
.hero-content > *:nth-child(2) { animation-delay: .15s; }
.hero-content > *:nth-child(3) { animation-delay: .25s; }
.hero-content > *:nth-child(4) { animation-delay: .35s; }
.hero-content > *:nth-child(5) { animation-delay: .45s; }
