/* ===========================
   SE TAX CALCULATOR – STYLES
   =========================== */

:root {
  --ink: #0f1117;
  --ink-soft: #3d4352;
  --ink-muted: #6b7280;
  --surface: #f8f7f4;
  --white: #ffffff;
  --card: #ffffff;
  --border: #e5e3de;
  --accent: #1a472a;          /* deep forest green */
  --accent-mid: #2d6a4f;
  --accent-light: #52b788;
  --accent-pale: #d8f3dc;
  --red: #c0392b;
  --red-pale: #fde8e6;
  --gold: #b8860b;
  --gold-pale: #fef9e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(15,17,23,.08);
  --shadow-lg: 0 12px 48px rgba(15,17,23,.14);
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

*, *::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(--surface);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,247,244,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 700; font-size: 1.1rem;
  color: var(--ink); text-decoration: none;
}
.logo-icon { font-size: 1.4rem; color: var(--accent); }
.nav-links { display: flex; gap: 8px; list-style: none; }
.nav-link {
  padding: 6px 16px; border-radius: 100px;
  font-weight: 500; color: var(--ink-soft);
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  background: var(--accent); color: var(--white);
  text-decoration: none;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 80px 0 72px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(160deg, #0f1117 0%, #1a472a 60%, #2d6a4f 100%);
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 120%, rgba(82,183,136,.18) 0%, transparent 70%);
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #a7f3c7;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 100px;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.1;
  color: #fff;
  margin-bottom: 20px;
}
.hero-title em { color: #52b788; font-style: italic; }
.hero-sub {
  max-width: 600px; margin: 0 auto 40px;
  color: rgba(255,255,255,.75);
  font-size: 1.05rem; line-height: 1.7;
}
.hero-stats {
  display: flex; align-items: center;
  justify-content: center; gap: 0;
  flex-wrap: wrap;
}
.stat { padding: 8px 32px; text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.9rem;
  color: #52b788;
}
.stat-lbl {
  display: block;
  font-size: .78rem; font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-top: 2px;
}
.stat-div { width: 1px; height: 40px; background: rgba(255,255,255,.2); }

/* ===== CALC SECTION ===== */
.calc-section { padding: 64px 0 80px; }
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media(max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } }

/* ===== CARDS ===== */
.calc-card, .results-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.card-header h2 {
  font-family: var(--font-head);
  font-size: 1.4rem; color: var(--ink);
}
.year-badge {
  background: var(--accent-pale);
  color: var(--accent);
  font-size: .75rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .85rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 7px;
}
.input-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  font-weight: 600; color: var(--ink-muted);
  pointer-events: none;
}
.input-wrap input {
  width: 100%; padding: 12px 14px 12px 30px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .98rem; color: var(--ink);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input-wrap input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
  background: #fff;
}
select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .98rem; color: var(--ink);
  background: var(--surface);
  cursor: pointer; outline: none;
  transition: border-color .2s;
}
select:focus { border-color: var(--accent-mid); }
.field-help { font-size: .78rem; color: var(--ink-muted); margin-top: 5px; }

/* ===== BUTTON ===== */
.btn-calc {
  width: 100%; padding: 15px 28px;
  background: var(--accent);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(26,71,42,.25);
  margin-top: 8px;
}
.btn-calc:hover {
  background: var(--accent-mid);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26,71,42,.35);
}
.btn-calc:active { transform: translateY(0); }

/* ===== RESULTS ===== */
.results-placeholder {
  text-align: center; padding: 60px 20px;
  color: var(--ink-muted);
}
.placeholder-icon { font-size: 3rem; margin-bottom: 16px; }
.results-placeholder p { font-size: .98rem; line-height: 1.7; }
.hidden { display: none !important; }

.result-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px; margin-bottom: 16px;
}
.primary-block {
  background: var(--accent);
  border-color: var(--accent);
  text-align: center;
}
.primary-block .result-label { color: rgba(255,255,255,.8); font-size: .82rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.primary-block .result-value { font-family: var(--font-head); font-size: 2.8rem; color: #fff; line-height: 1.1; margin: 8px 0 4px; }
.primary-block .result-sub { color: rgba(255,255,255,.65); font-size: .8rem; }

.result-label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; display: block; }
.result-value { font-family: var(--font-head); font-size: 1.8rem; color: var(--ink); }
.result-value.sm { font-size: 1.4rem; }
.result-sub { font-size: .78rem; color: var(--ink-muted); margin-top: 3px; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media(max-width: 500px) { .result-grid { grid-template-columns: 1fr; } }

.result-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  background: #fff; border-radius: 8px;
  border: 1px solid var(--border);
}
.ri-label { font-size: .76rem; font-weight: 600; color: var(--ink-muted); }
.ri-value { font-family: var(--font-head); font-size: 1.05rem; color: var(--ink); }
.accent-green { color: var(--accent-mid) !important; }
.accent-red { color: var(--red) !important; }
.strong-row { grid-column: 1/-1; }
.strong-row .ri-value { font-size: 1.2rem; }

.deduct-block { background: var(--gold-pale); border-color: #f0d060; }
.deduct-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.deduct-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(184,134,11,.12); padding: 3px 10px; border-radius: 100px;
}

/* Quarterly */
.quarterly-block { background: var(--accent-pale); border-color: #b7e4c7; }
.quarterly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quarter { background: #fff; border-radius: 8px; padding: 10px 12px; border: 1px solid rgba(82,183,136,.3); }
.q-label { display: block; font-size: .72rem; font-weight: 600; color: var(--accent-mid); }
.q-value { font-family: var(--font-head); font-size: 1.05rem; color: var(--ink); display: block; margin-top: 2px; }
.quarterly-note { font-size: .76rem; color: var(--ink-muted); margin-top: 10px; }

/* Effective rate */
.effective-block {
  display: flex; align-items: center;
  justify-content: space-around;
  flex-wrap: wrap; gap: 12px;
  background: var(--ink); color: #fff;
  border-color: var(--ink);
}
.eff-item { text-align: center; }
.eff-item span { display: block; font-size: .75rem; color: rgba(255,255,255,.6); font-weight: 500; }
.eff-item strong { font-family: var(--font-head); font-size: 1.35rem; color: #fff; }
.eff-item.highlight strong { color: #52b788; font-size: 1.55rem; }
.eff-divider { width: 1px; height: 36px; background: rgba(255,255,255,.2); }

.disclaimer-text {
  font-size: .75rem; color: var(--ink-muted);
  line-height: 1.5; margin-top: 8px;
  padding: 12px; background: var(--surface);
  border-radius: 8px; border: 1px solid var(--border);
}

/* ===== HOW IT WORKS ===== */
.how-section { margin-top: 80px; }
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  color: var(--ink); margin-bottom: 12px;
}
.section-sub { color: var(--ink-muted); margin-bottom: 40px; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px; margin-top: 36px;
}
.step {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s, box-shadow .2s;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-num {
  font-family: var(--font-head);
  font-size: 2.2rem; color: var(--accent-pale);
  line-height: 1; margin-bottom: 12px;
  -webkit-text-stroke: 2px var(--accent-mid);
  color: transparent;
}
.step h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--ink); }
.step p { font-size: .88rem; color: var(--ink-soft); line-height: 1.65; }

/* ===== FAQ ===== */
.faq-section { margin-top: 72px; }
.faq-list { max-width: 760px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 24px;
  font-weight: 600; font-size: .97rem;
  color: var(--ink); cursor: pointer;
  list-style: none;
  display: flex; align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 1.3rem;
  color: var(--accent); transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--surface); }
.faq-item p {
  padding: 0 24px 18px;
  font-size: .9rem; color: var(--ink-soft); line-height: 1.7;
}

/* ===== BLOG TEASER ===== */
.blog-teaser { padding: 72px 0; background: var(--white); border-top: 1px solid var(--border); }
.blog-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 36px; }
.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--surface);
  transition: transform .2s, box-shadow .2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-cat {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-pale); display: inline-block;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 14px;
}
.blog-card h3 { font-size: 1.1rem; margin-bottom: 10px; line-height: 1.4; }
.blog-card h3 a { color: var(--ink); }
.blog-card h3 a:hover { color: var(--accent); text-decoration: none; }
.blog-card p { font-size: .88rem; color: var(--ink-soft); line-height: 1.65; margin-bottom: 16px; }
.read-more { font-size: .85rem; font-weight: 700; color: var(--accent); }

/* ===== FOOTER ===== */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 56px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; padding-bottom: 48px;
}
@media(max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: #fff; margin-bottom: 14px; display: inline-flex; }
.footer-brand p { font-size: .84rem; line-height: 1.7; max-width: 340px; }
.footer-links h4 { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 14px; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,.75); font-size: .88rem; transition: color .15s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 18px 0;
}
.footer-bottom p { font-size: .8rem; color: rgba(255,255,255,.45); }
.footer-bottom a { color: rgba(255,255,255,.55); }

/* ===== BLOG PAGE ===== */
.blog-hero {
  background: linear-gradient(160deg, #0f1117 0%, #1a472a 100%);
  padding: 64px 0;
  text-align: center;
}
.blog-hero h1 { font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 3rem); color: #fff; margin-bottom: 12px; }
.blog-hero p { color: rgba(255,255,255,.7); max-width: 560px; margin: 0 auto; }

.blog-grid-section { padding: 56px 0 80px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* ===== POST PAGE ===== */
.post-header { background: linear-gradient(160deg, #0f1117 0%, #1a472a 100%); padding: 72px 0; }
.post-header .post-cat {
  display: inline-block;
  background: rgba(255,255,255,.12); color: #a7f3c7;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 100px; margin-bottom: 18px;
}
.post-header h1 { font-family: var(--font-head); font-size: clamp(1.9rem, 4.5vw, 3.2rem); color: #fff; line-height: 1.2; max-width: 780px; margin-bottom: 18px; }
.post-meta { color: rgba(255,255,255,.65); font-size: .85rem; }
.post-meta span { margin-right: 20px; }

.post-body-wrap { padding: 56px 0 80px; }
.post-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
@media(max-width: 860px) { .post-layout { grid-template-columns: 1fr; } }

.post-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
.post-content h2 { font-family: var(--font-head); font-size: 1.6rem; margin: 32px 0 14px; color: var(--ink); }
.post-content h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 10px; color: var(--ink-soft); }
.post-content p { font-size: .97rem; color: var(--ink-soft); line-height: 1.78; margin-bottom: 16px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 16px; }
.post-content li { font-size: .97rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: 6px; }
.post-content a { color: var(--accent); }
.post-content strong { color: var(--ink); font-weight: 700; }
.placeholder-block {
  background: repeating-linear-gradient(
    -45deg,
    var(--surface),
    var(--surface) 8px,
    #eae8e3 8px,
    #eae8e3 16px
  );
  border: 2px dashed var(--border);
  border-radius: 10px; padding: 28px; margin: 20px 0;
  color: var(--ink-muted); font-size: .88rem; line-height: 1.7;
}
.placeholder-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display: block;
}

.post-sidebar { position: sticky; top: 80px; }
.sidebar-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.sidebar-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.sidebar-card p { font-size: .85rem; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.6; }
.btn-sidebar {
  display: block; text-align: center;
  background: var(--accent); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9rem;
  transition: background .2s;
}
.btn-sidebar:hover { background: var(--accent-mid); text-decoration: none; }
.toc-list { list-style: none; }
.toc-list li { border-bottom: 1px solid var(--border); }
.toc-list a { display: block; padding: 9px 0; font-size: .85rem; color: var(--ink-soft); transition: color .15s; }
.toc-list a:hover { color: var(--accent); text-decoration: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

/* ===== RESPONSIVE ===== */
@media(max-width: 640px) {
  .hero { padding: 56px 0 52px; }
  .hero-stats { flex-direction: column; gap: 4px; }
  .stat-div { display: none; }
  .calc-card, .results-card { padding: 22px 18px; }
  .quarterly-grid { grid-template-columns: 1fr; }
  .effective-block { flex-direction: column; }
  .eff-divider { width: 60%; height: 1px; }
}
