/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --crimson:       #9E1B32;
  --crimson-dark:  #7d1528;
  --crimson-light: #fdf2f4;
  --crimson-mid:   #e8c4cb;
  --bg:            #ffffff;
  --surface:       #f8f8f8;
  --border:        #e5e7eb;
  --text:          #1a1a1a;
  --muted:         #6b7280;
  --muted-light:   #9ca3af;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07);
  --shadow:        0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.10);
  --max-w:         1100px;
  --font:          system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}
.logo span { color: var(--crimson); }
.logo:hover { text-decoration: none; }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color .15s; }
.site-nav a:hover { color: var(--crimson); text-decoration: none; }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--crimson) 0%, #7d1528 100%);
  color: white;
  padding: 64px 0 56px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}
.hero p {
  font-size: 17px;
  color: rgba(255,255,255,.85);
  max-width: 560px;
  margin: 0 auto 28px;
}
.hero-search {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
  gap: 0;
}
.hero-search input {
  flex: 1;
  padding: 13px 18px;
  font-size: 15px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  font-family: var(--font);
}
.hero-search button {
  padding: 13px 20px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
  white-space: nowrap;
}
.hero-search button:hover { background: #333; }

/* ─── Calculator grid ────────────────────────────────────────────────────────── */
.calc-grid-section { padding: 56px 0; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -.2px;
}
.section-sub {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 32px;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.calc-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-decoration: none;
  color: var(--text);
}
.calc-card:hover {
  border-color: var(--crimson);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}
.calc-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1;
}
.calc-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.calc-card-desc {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  margin-bottom: 14px;
  line-height: 1.5;
}
.calc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.calc-card-arrow {
  color: var(--crimson);
  font-size: 16px;
  font-weight: 700;
}

/* ─── Why section (homepage) ─────────────────────────────────────────────────── */
.why-section {
  background: var(--surface);
  padding: 56px 0;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.why-item { display: flex; flex-direction: column; gap: 8px; }
.why-icon { font-size: 24px; }
.why-title { font-size: 15px; font-weight: 700; }
.why-text { font-size: 14px; color: var(--muted); }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: #111;
  color: #9ca3af;
  padding: 40px 0 24px;
  font-size: 13px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  margin-bottom: 32px;
}
.footer-brand .logo { color: white; font-size: 18px; margin-bottom: 10px; display: block; }
.footer-brand p { font-size: 13px; color: #9ca3af; max-width: 260px; }
.footer-links h4 { color: white; font-size: 13px; font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .05em; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer-links a { color: #9ca3af; font-size: 13px; transition: color .15s; }
.footer-links a:hover { color: white; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}
.footer-disclaimer {
  border-top: 1px solid #1f1f1f;
  margin-top: 20px;
  padding-top: 16px;
  font-size: 11px;
  color: #555;
  line-height: 1.6;
}

/* ─── Breadcrumb ──────────────────────────────────────────────────────────────── */
.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--crimson); text-decoration: none; }
.breadcrumb span { margin: 0 6px; }

/* ─── Calculator page hero ───────────────────────────────────────────────────── */
.calc-hero {
  background: linear-gradient(135deg, var(--crimson) 0%, #7d1528 100%);
  color: white;
  padding: 44px 0 40px;
}
.calc-hero-tag {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.calc-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 10px;
}
.calc-hero p {
  font-size: 16px;
  color: rgba(255,255,255,.85);
  max-width: 520px;
}

/* ─── Calculator widget ──────────────────────────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  padding: 40px 0;
  align-items: start;
}
.calc-widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc-widget-header {
  background: var(--surface);
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}
.calc-widget-body { padding: 24px 22px; }
.calc-field { margin-bottom: 18px; }
.calc-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.calc-field input,
.calc-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.calc-field input:focus,
.calc-field select:focus { border-color: var(--crimson); }
.calc-field .field-hint { font-size: 12px; color: var(--muted-light); margin-top: 4px; }
.calc-btn {
  width: 100%;
  padding: 14px;
  background: var(--crimson);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
  margin-top: 4px;
}
.calc-btn:hover { background: var(--crimson-dark); }
.calc-result {
  margin-top: 20px;
  background: var(--crimson-light);
  border: 1px solid var(--crimson-mid);
  border-radius: var(--radius);
  padding: 20px;
  display: none;
}
.calc-result.show { display: block; }
.calc-result-label { font-size: 12px; font-weight: 600; color: var(--crimson); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.calc-result-value { font-size: 32px; font-weight: 800; color: var(--crimson); letter-spacing: -.5px; }
.calc-result-breakdown { margin-top: 14px; border-top: 1px solid var(--crimson-mid); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.result-row { display: flex; justify-content: space-between; font-size: 14px; }
.result-row .label { color: var(--muted); }
.result-row .value { font-weight: 600; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.calc-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.quick-fact { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.quick-fact:last-child { border-bottom: none; }
.quick-fact .label { color: var(--muted); }
.quick-fact .value { font-weight: 700; color: var(--text); }
.related-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.related-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color .15s, color .15s;
}
.related-list a:hover { border-color: var(--crimson); color: var(--crimson); text-decoration: none; }
.sidebar-links { list-style: disc; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sidebar-links li { font-size: 14px; color: var(--text); line-height: 1.5; }
.sidebar-links a { color: var(--crimson); }
.sidebar-links a:hover { text-decoration: underline; }

/* ─── Content sections ───────────────────────────────────────────────────────── */
.content-section { padding: 48px 0; border-top: 1px solid var(--border); }
.content-section h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; letter-spacing: -.2px; }
.content-section h3 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; }
.content-section p { font-size: 15px; color: #374151; line-height: 1.75; margin-bottom: 14px; }
.content-section ul { padding-left: 20px; margin-bottom: 14px; }
.content-section li { font-size: 15px; color: #374151; line-height: 1.75; margin-bottom: 6px; }

/* ─── Data table ─────────────────────────────────────────────────────────────── */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 20px 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
  background: var(--surface);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface); }

/* ─── FAQ ────────────────────────────────────────────────────────────────────── */
.faq-section { padding: 48px 0; border-top: 1px solid var(--border); }
.faq-section h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; letter-spacing: -.2px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq-q {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: var(--bg);
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
  transition: background .15s;
}
.faq-q:hover { background: var(--surface); }
.faq-q .faq-icon { color: var(--crimson); font-size: 20px; font-weight: 300; transition: transform .2s; flex-shrink: 0; margin-left: 12px; }
.faq-item.open .faq-q { background: var(--crimson-light); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  color: #374151;
  line-height: 1.75;
  background: var(--crimson-light);
  border-top: 1px solid var(--crimson-mid);
}
.faq-item.open .faq-a { display: block; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  font-family: var(--font);
  text-decoration: none;
}
.btn-primary { background: var(--crimson); color: white; }
.btn-primary:hover { background: var(--crimson-dark); text-decoration: none; color: white; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--crimson); color: var(--crimson); text-decoration: none; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .calc-layout { grid-template-columns: 1fr; padding: 24px 0; gap: 20px; }
  .site-nav { display: none; }
  .hero { padding: 36px 0 32px; }
  .calc-hero { padding: 32px 0 28px; }
  .section { padding: 36px 0; }
  .content-section { padding: 32px 0; }
  .faq-section { padding: 32px 0; }
  .footer-inner { flex-direction: column; gap: 28px; }
  .calc-widget-body { padding: 18px 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hero-search { flex-direction: column; }
  .hero-search input { border-radius: var(--radius); }
  .hero-search button { border-radius: var(--radius); }
  .calc-field input,
  .calc-field select { font-size: 16px; } /* prevents iOS zoom on focus */
  .calc-btn { font-size: 17px; padding: 16px; }
}
