/* =========================================
   ROTH IRA CALCULATOR - MAIN STYLESHEET
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;
  --navy: #0F172A;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --white: #FFFFFF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(37, 99, 235, 0.1), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 40px rgba(37, 99, 235, 0.15), 0 8px 24px rgba(0,0,0,0.08);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- NAVBAR ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--slate-200);
  padding: 0 24px;
  transition: var(--transition);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  letter-spacing: -0.5px;
}
.nav-brand-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
  line-height: 1.2;
}
.nav-brand-text span { color: var(--blue-600); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--slate-600);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-links a:hover { background: var(--blue-50); color: var(--blue-600); }
.nav-links .btn-nav {
  background: var(--blue-600);
  color: white !important;
  padding: 8px 20px;
}
.nav-links .btn-nav:hover { background: var(--blue-700) !important; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-700) 50%, var(--blue-600) 100%);
  color: white;
  padding: 80px 24px 100px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--blue-100);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 20px;
  color: white;
}
.hero h1 em { font-style: italic; color: var(--blue-200); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--blue-100);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--blue-700);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

/* ---- STATS BAR ---- */
.stats-bar {
  background: white;
  border-bottom: 1px solid var(--slate-200);
  padding: 0 24px;
}
.stats-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
}
.stat-item {
  padding: 20px 40px;
  text-align: center;
  border-right: 1px solid var(--slate-200);
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-700);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ---- LAYOUT ---- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 24px; }
.section-sm { padding: 48px 24px; }

/* ---- CALCULATOR ---- */
.calculator-section {
  background: var(--slate-50);
  padding: 80px 24px;
}
.calc-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.section-header { margin-bottom: 40px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.25;
}
.section-header p { color: var(--slate-500); font-size: 1rem; max-width: 540px; }

.calc-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--slate-200);
  padding: 36px;
}
.calc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.calc-card h3 .icon {
  width: 28px; height: 28px;
  background: var(--blue-50);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-600); font-size: 14px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input-wrap { position: relative; }
.input-prefix, .input-suffix {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--slate-800);
  background: white;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 28px; }
.warning-msg {
  display: none;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #92400E;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}
.warning-msg.show { display: block; }
.error-msg {
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  display: none;
}
.error-msg.show { display: block; }
.input-error input, .input-error select {
  border-color: var(--danger);
}

.btn-group { display: flex; gap: 12px; margin-top: 8px; }
.btn {
  flex: 1;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: var(--blue-600);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-600);
}
.btn-secondary:hover { background: var(--slate-200); }

/* ---- RESULTS ---- */
.results-panel { display: none; }
.results-panel.show { display: block; }
.result-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.result-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.result-card.primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
}
.result-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
}
.result-card.primary .result-card-label { color: var(--blue-200); }
.result-card-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
}
.result-card.primary .result-card-value { color: white; font-size: 1.6rem; }
.chart-wrap {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 20px;
}
.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-600);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Loading spinner */
.spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.show { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- HOW IT WORKS ---- */
.how-section { background: white; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}
.step-card {
  text-align: center;
  padding: 36px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  transition: var(--transition);
}
.step-card:hover { border-color: var(--blue-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.step-num {
  width: 52px; height: 52px;
  background: var(--blue-600);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.step-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.step-card p { color: var(--slate-500); font-size: 0.9rem; line-height: 1.65; }

/* ---- FAQ ---- */
.faq-section { background: var(--slate-50); }
.faq-grid {
  max-width: 800px;
  margin: 48px auto 0;
}
.faq-item {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 24px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.faq-question:hover { background: var(--blue-50); }
.faq-icon {
  width: 24px; height: 24px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-600);
  font-size: 16px;
  font-weight: 400;
  flex-shrink: 0;
  transition: var(--transition);
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--blue-600); color: white; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--slate-600);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- BLOG ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.blog-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue-200); }
.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.blog-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-tag {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.blog-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.4;
}
.blog-card p {
  font-size: 13.5px;
  color: var(--slate-500);
  line-height: 1.6;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--slate-100);
  font-size: 12px;
  color: var(--slate-400);
  font-weight: 500;
}
.read-more { color: var(--blue-600); font-weight: 700; }

/* ---- CTA BANNER ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: white;
  padding: 72px 24px;
  text-align: center;
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 16px;
}
.cta-banner p { color: var(--blue-100); margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }
.btn-white {
  background: white;
  color: var(--blue-700);
  padding: 14px 32px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* ---- FOOTER ---- */
footer {
  background: var(--navy);
  color: var(--slate-400);
  padding: 60px 24px 32px;
}
.footer-grid {
  max-width: 1140px;
  margin: 0 auto 48px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .nav-logo { margin-bottom: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.7; color: var(--slate-400); max-width: 280px; margin-top: 12px; }
.footer-col h4 {
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--slate-400);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--blue-400); }
.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.footer-bottom a { color: var(--slate-400); text-decoration: none; }
.footer-bottom a:hover { color: var(--blue-400); }

/* ---- BLOG PAGE ---- */
.page-hero {
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  color: white;
  padding: 60px 24px;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}
.page-hero p { color: var(--blue-100); font-size: 1.05rem; }

/* ---- ARTICLE ---- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 60px 24px; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.article-tag {
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.article-date, .article-read { color: var(--slate-400); font-size: 13px; font-weight: 500; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 24px;
}
.article-lead {
  font-size: 1.1rem;
  color: var(--slate-600);
  line-height: 1.75;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--slate-200);
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy);
  margin: 40px 0 16px;
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 12px;
}
.article-body p { color: var(--slate-600); line-height: 1.8; margin-bottom: 18px; }
.article-body ul, .article-body ol {
  margin: 0 0 18px 24px;
  color: var(--slate-600);
  line-height: 1.8;
}
.article-body li { margin-bottom: 8px; }
.article-body .callout {
  background: var(--blue-50);
  border-left: 3px solid var(--blue-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
  color: var(--blue-900);
  font-size: 14px;
  line-height: 1.7;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.article-body th {
  background: var(--blue-600);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-600);
}
.article-body tr:nth-child(even) td { background: var(--slate-50); }

/* ---- LEGAL PAGES ---- */
.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px;
}
.legal-wrap h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.legal-updated { color: var(--slate-400); font-size: 13px; margin-bottom: 40px; }
.legal-wrap h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin: 32px 0 12px;
}
.legal-wrap p, .legal-wrap li {
  color: var(--slate-600);
  line-height: 1.8;
  margin-bottom: 14px;
  font-size: 15px;
}
.legal-wrap ul { margin: 0 0 14px 24px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .calc-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: white; border-bottom: 1px solid var(--slate-200); padding: 16px; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .stats-bar-inner { flex-wrap: wrap; }
  .stat-item { flex: 1; min-width: 140px; padding: 16px 20px; }
}
@media (max-width: 480px) {
  .hero { padding: 56px 16px 72px; }
  .calc-card { padding: 24px 20px; }
  .btn-group { flex-direction: column; }
}
