
:root{
  --bg:#0b1220;
  --panel:#111a2e;
  --card:#0f1930;
  --text:#e7eefc;
  --muted:#9bb0d1;
  --accent:#6ee7ff;
  --accent2:#a78bfa;
  --border:rgba(231,238,252,0.12);
  --shadow:0 10px 30px rgba(0,0,0,0.35);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial,sans-serif;background:radial-gradient(1200px 800px at 20% 10%, rgba(110,231,255,0.12), transparent 60%), radial-gradient(900px 700px at 90% 20%, rgba(167,139,250,0.10), transparent 55%), var(--bg); color:var(--text);}
a{color:inherit;text-decoration:none}
.container{max-width:1080px;margin:0 auto;padding:24px}
.nav{
  position:sticky;top:0;z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,0.65);
  border-bottom:1px solid var(--border);
}
.nav-inner{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 24px;max-width:1080px;margin:0 auto;}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:0.2px}
.logo{
  width:32px;height:32px;border-radius:10px;
  background: linear-gradient(135deg, rgba(110,231,255,0.9), rgba(167,139,250,0.9));
  box-shadow:0 8px 24px rgba(110,231,255,0.15);
}
.nav-links{display:flex;gap:14px;flex-wrap:wrap;align-items:center}
.nav-links a{
  padding:8px 10px;border-radius:12px;
  color:var(--muted);
}
.nav-links a.active, .nav-links a:hover{
  color:var(--text);
  background:rgba(231,238,252,0.06);
  border:1px solid rgba(231,238,252,0.10);
}
.hero{
  display:grid;grid-template-columns:1.25fr 0.75fr;gap:22px;align-items:stretch;
  margin-top:18px;
}
@media (max-width: 860px){
  .hero{grid-template-columns:1fr}
}
.h-card{
  background: linear-gradient(180deg, rgba(17,26,46,0.82), rgba(15,25,48,0.72));
  border:1px solid var(--border);
  border-radius:22px;
  padding:22px;
  box-shadow: var(--shadow);
}
.kicker{color:var(--accent);font-weight:650;letter-spacing:0.3px;font-size:13px}
h1{margin:10px 0 8px;font-size:40px;line-height:1.06}
@media (max-width: 500px){h1{font-size:34px}}
p{margin:8px 0;color:var(--muted);line-height:1.55}
.cta-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  padding:11px 14px;border-radius:14px;border:1px solid rgba(231,238,252,0.12);
  background: rgba(231,238,252,0.06);
  color:var(--text);
  font-weight:650;
}
.btn.primary{
  border:none;
  background: linear-gradient(135deg, rgba(110,231,255,0.95), rgba(167,139,250,0.95));
  color:#0b1220;
}
.btn:hover{transform: translateY(-1px); transition: 150ms ease;}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
@media (max-width: 860px){.grid-3{grid-template-columns:1fr}}
.card{
  background: rgba(17,26,46,0.55);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
}
.card h3{margin:0 0 6px;font-size:16px}
.card p{margin:0;color:var(--muted)}
.section{margin-top:26px}
.section h2{margin:0 0 12px;font-size:22px}
.split{
  display:grid;grid-template-columns:1fr 1fr;gap:14px;
}
@media (max-width: 860px){.split{grid-template-columns:1fr}}
.notice{
  background: rgba(110,231,255,0.08);
  border:1px solid rgba(110,231,255,0.22);
  color: var(--text);
  border-radius:16px;padding:14px;
}
.small{font-size:13px;color:var(--muted)}
.footer{
  margin-top:32px;padding:18px 0;border-top:1px solid var(--border);color:var(--muted);
}
.badge{
  display:inline-flex;gap:8px;align-items:center;
  padding:7px 10px;border-radius:999px;border:1px solid rgba(231,238,252,0.10);
  background:rgba(231,238,252,0.06);color:var(--muted);font-size:12px;
}
.hr{height:1px;background:var(--border);margin:14px 0}
.form{
  display:grid;grid-template-columns:repeat(2,1fr);gap:12px;
}

/* spinner animation */
.spinner{
  display:inline-block;
  width:16px;
  height:16px;
  border:2px solid var(--text);
  border-top-color:transparent;
  border-radius:50%;
  animation: spin 0.8s linear infinite;
  vertical-align:middle;
  margin-left:6px;
}
@keyframes spin{
  to{transform:rotate(360deg);}
}

/* simulation results spacing */
.simulation-blurb{margin-bottom:12px;}
#simulationResults table th, #simulationResults table td{padding:8px;}
@media (max-width: 860px){.form{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:6px}
label{font-size:12px;color:var(--muted)}
input, select{
  padding:10px 12px;border-radius:14px;
  background:rgba(11,18,32,0.6);
  border:1px solid rgba(231,238,252,0.12);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{border-color: rgba(110,231,255,0.45); box-shadow:0 0 0 3px rgba(110,231,255,0.12)}
.results{
  display:grid;grid-template-columns:1fr;gap:10px;
}
.metric{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px;border-radius:16px;border:1px solid var(--border);background:rgba(17,26,46,0.55)}
.metric b{font-size:14px}
.metric span{color:var(--muted);font-size:13px;line-height:1.4;text-align:right;max-width:60%}
.table-wrap{overflow:auto;border-radius:18px;border:1px solid var(--border);background:rgba(17,26,46,0.45)}
table{border-collapse:collapse;width:100%;min-width:720px}
th,td{padding:10px 10px;border-bottom:1px solid rgba(231,238,252,0.08);font-size:13px}
th{position:sticky;top:0;background:rgba(11,18,32,0.9);text-align:left;color:var(--muted);font-weight:650}
td.num{text-align:right;font-variant-numeric:tabular-nums}
.pill{display:inline-flex;align-items:center;gap:8px}
.pill .dot{width:8px;height:8px;border-radius:999px;background:var(--accent)}
.disclosure{
  font-size:12px;color:var(--muted);line-height:1.45;
  border:1px dashed rgba(231,238,252,0.18);
  padding:12px;border-radius:16px;background:rgba(17,26,46,0.35)
}

.article{
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(17,26,46,0.55);
  padding:16px;
  margin-top:14px;
}
.article-meta{
  display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;
  color:var(--muted);font-size:12px;margin-bottom:8px;
}
.article-date{
  padding:6px 10px;border-radius:999px;border:1px solid rgba(231,238,252,0.10);
  background:rgba(231,238,252,0.05);
}
.article + .article{margin-top:14px}

/* Premium tweaks */
.h-card{ box-shadow: 0 14px 40px rgba(0,0,0,0.38); }
.btn.primary{ box-shadow: 0 14px 32px rgba(110,231,255,0.18); }
.nav-inner{ padding: 16px 24px; }
.hero-tight{ margin-top: 22px; }
.subtle{ color: var(--muted); font-size: 14px; }

/* Flow steps with arrows */
.flow{ display:flex; flex-direction:column; gap:12px; margin-top:14px; }
.flow-step{
  position:relative;
  border:1px solid var(--border);
  border-radius:20px;
  background: rgba(17,26,46,0.58);
  padding:16px;
}
.flow-step .step-title{
  font-size:16px;
  font-weight:800;
  letter-spacing:0.2px;
  margin:0 0 6px;
  display:flex; align-items:center; gap:10px;
}
.flow-step .step-badge{
  display:inline-flex;
  align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:10px;
  background: linear-gradient(135deg, rgba(110,231,255,0.95), rgba(167,139,250,0.95));
  color:#0b1220;
  font-weight:900;
  font-size:12px;
}
.flow-step:after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-14px;
  width:2px;
  height:22px;
  background: rgba(231,238,252,0.14);
  transform:translateX(-50%);
}
.flow-step:before{
  content:"";
  position:absolute;
  left:50%;
  bottom:-20px;
  width:0;height:0;
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-top:10px solid rgba(231,238,252,0.20);
  transform:translateX(-50%);
}
.flow-step:last-child:after,.flow-step:last-child:before{ display:none; }


/* Flow arrow emphasis */
.flow-step:after{
  width:3px;
  height:30px;
  bottom:-18px;
  background: rgba(231,238,252,0.22);
}
.flow-step:before{
  bottom:-28px;
  border-left:9px solid transparent;
  border-right:9px solid transparent;
  border-top:14px solid rgba(231,238,252,0.30);
}
/* White utility panel for embedded calculators */
.white-panel{
  background:#ffffff;
  color:#0b1220;
  border:1px solid rgba(15,25,48,0.18);
}
.white-panel label{ color: rgba(15,25,48,0.65); }
.white-panel input{
  background:#ffffff;
  color:#0b1220;
  border:1px solid rgba(15,25,48,0.22);
}
.white-panel .small{ color: rgba(15,25,48,0.65); }

/* Flow arrows outside boxes */
.flow-step:after, .flow-step:before { display:none !important; }
.flow-arrow{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  height:34px;
  margin:0;
}
.flow-arrow .line{
  width:3px;
  height:18px;
  background: rgba(231,238,252,0.22);
  border-radius:999px;
}
.flow-arrow .tip{
  width:0;height:0;
  border-left:9px solid transparent;
  border-right:9px solid transparent;
  border-top:14px solid rgba(231,238,252,0.30);
  margin-top:4px;
}

/* Flow width tweak */
.flow{ max-width: 920px; margin-left:auto; margin-right:auto; }

/* Arrow color to match primary button gradient */
.flow-arrow .line{
  background: linear-gradient(180deg, rgba(110,231,255,0.70), rgba(167,139,250,0.70));
}
.flow-arrow .tip{
  border-top-color: rgba(167,139,250,0.55);
}

/* Arrow size tweak */
.flow-arrow{ height:40px; }
.flow-arrow .line{ height:20px; }

/* Arrow stem width override */
.flow-arrow .line{ width:5px; }

/* Brand initials */
.logo{ position:relative; display:inline-flex; align-items:center; justify-content:center; }
.logo:after{
  content:"FS";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:14px;
  color:#0b1220;
  letter-spacing:0.5px;
}

/* Make secondary buttons look more obviously clickable */
.btn.accent{
  border:1px solid rgba(231,238,252,0.35);
  background: rgba(231,238,252,0.08);
  box-shadow:0 10px 28px rgba(0,0,0,0.18);
}
.btn.accent:hover{ transform: translateY(-1px); }

/* Donation link emphasis */
a.donate-link{
  font-weight:800;
  text-decoration:underline;
}

/* Flow arrow size */
.flow-arrow .line{ width:10px; }
.flow-arrow .tip{
  border-left:18px solid transparent;
  border-right:18px solid transparent;
  border-top:28px solid rgba(167,139,250,0.55);
}

textarea{ width:100%; padding:12px 12px; border-radius:14px; background: rgba(255,255,255,0.06); border:1px solid rgba(231,238,252,0.18); color: rgba(231,238,252,0.92); outline:none; }

/* v18: longer flow arrows */
.flow-arrow{ height:110px; }
.flow-arrow .line{ height:72px; }

/* v19 arrow adjustments */
.flow-arrow{ height:70px; }
.flow-arrow .line{ height:36px; }
.flow-arrow .tip{ border-left:14px solid transparent; border-right:14px solid transparent; }
/* v19 white card */
.card.white{ background:#ffffff; color:#0b1220; border:1px solid rgba(0,0,0,0.06); }
.card.white .small{ color: rgba(11,18,32,0.75); }
.card.white .metric span{ color:#0b1220; }

/* v20: connect arrow stem + head */
.flow-arrow{ display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:0; }
.flow-arrow .line{ margin:0; }
.flow-arrow .tip{ margin-top:0; }

/* v20: favicon as header logo */
.logo-img{
  width:34px;
  height:34px;
  border-radius:10px;
  box-shadow:0 10px 26px rgba(0,0,0,0.22);
}

.cards-grid{ display:grid; gap:14px; }

/* v21: stack budget list items vertically (override .form grid) */
#incomeList, #expenseList{
  display:flex !important;
  flex-direction:column !important;
  gap:10px !important;
}

/* v22 back link */
.back-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color: rgba(231,238,252,0.85);
  text-decoration:none;
  font-weight:700;
  margin-bottom:10px;
}
.back-link:hover{ text-decoration:underline; }
.back-link .icon{
  width:28px; height:28px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:10px;
  background: rgba(231,238,252,0.08);
  border:1px solid rgba(231,238,252,0.18);
}
/* negative highlight */
.neg{ color:#ef4444 !important; }

/* v28 radio buttons */
.radio-group{
  display:flex;
  gap:16px;
  margin-top:6px;
}
.radio-group label{
  display:flex;
  align-items:center;
  gap:6px;
}

/* v31: white inputs inside EF simple calculator */
.card .field input{
  background:#ffffff;
  color:#111827;
}


/* v40: result emphasis + transitions */
.result-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.result-animate {
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.result-animate.updated {
  transform: scale(1.02);
}


/* Simulation toggle compact layout */
.simulation-controls {
  max-width: 520px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
}

.simulation-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.simulation-options label {
  cursor: pointer;
}

.privacy-note {
  margin-top: 8px;
  opacity: 0.8;
}

.simulation-controls.compact {
  max-width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Advanced simulation add-on */
.simulation-addon {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(120, 180, 255, 0.45);
}

.simulation-addon .simulation-blurb {
  color: #b9c7dc;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Yes/No toggle (v47) */
.toggle{position:relative;display:inline-block;width:52px;height:28px}
.toggle input{display:none}
.slider{position:absolute;cursor:pointer;background:#999;border-radius:34px;top:0;left:0;right:0;bottom:0;transition:.3s}
.slider:before{content:"";position:absolute;height:22px;width:22px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.3s}
.toggle input:checked + .slider{background:#3fb6a8}
.toggle input:checked + .slider:before{transform:translateX(24px)}


/* === EF TOGGLE STYLES — LOCKED v50 === */
.toggle-group{display:flex;gap:10px;margin-top:6px}
.toggle-btn{padding:8px 14px;border-radius:8px;border:1px solid rgba(255,255,255,0.25);background:transparent;color:#cfd8dc;cursor:pointer}
.toggle-btn.active{background:#1ec7a6;border-color:#1ec7a6;color:#042f2e;font-weight:600}
