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

:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --red-light: #fff0f0;
  --navy: #1d2d44;
  --navy-light: #2c3e5c;
  --gold: #f4a261;
  --green: #2a9d8f;
  --text: #1a1a2e;
  --text-muted: #5a6477;
  --border: #e2e8f0;
  --bg: #f8f9fc;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
  --radius: 12px;
  --radius-lg: 20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
}

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */
.site-header {
  background: var(--navy);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.4rem; }
.logo-tld { color: var(--gold); }

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover { color: #fff; text-decoration: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1a3a5c 100%);
  color: white;
  padding: 64px 0 56px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: rgba(244,162,97,0.18);
  border: 1px solid rgba(244,162,97,0.4);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.88;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 20px 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 16px;
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.72rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

.cta-btn {
  display: inline-block;
  background: var(--red);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(230,57,70,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(230,57,70,0.5);
  text-decoration: none;
  color: white;
}

/* ===== CALCULATOR SECTION ===== */
.calculator-section {
  padding: 56px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-row:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.08);
}

.cat-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.cat-info {
  flex: 1;
  min-width: 0;
}

.cat-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-info small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-wrap {
  position: relative;
  flex-shrink: 0;
}

.input-wrap .currency {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-wrap input[type="number"] {
  width: 90px;
  padding: 8px 8px 8px 22px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.input-wrap input[type="number"]::-webkit-outer-spin-button,
.input-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.input-wrap input[type="number"]:focus { border-color: var(--red); }

.input-wrap select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: white;
  outline: none;
  cursor: pointer;
}

.household-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.household-row label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.household-row label strong { display: block; font-size: 0.9rem; }
.household-row label small { font-size: 0.75rem; color: var(--text-muted); }

.calc-btn {
  width: 100%;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(230,57,70,0.3);
}

.calc-btn:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230,57,70,0.4);
}

/* ===== RESULTS ===== */
.results-section {
  padding: 0 0 56px;
}

.results-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}

.results-header {
  text-align: center;
  margin-bottom: 28px;
}

.results-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.results-header p { color: var(--text-muted); }

.big-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  color: white;
}

.big-number {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.big-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 4px;
}

.big-value {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.03em;
  line-height: 1;
}

.big-range {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 4px;
}

.big-divider {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.15);
}

.comparison-row {
  text-align: center;
  margin-bottom: 28px;
}

.comparison-chip {
  display: inline-block;
  background: var(--red-light);
  border: 1px solid rgba(230,57,70,0.2);
  color: var(--red-dark);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
}

/* Breakdown bars */
.breakdown-section {
  margin-bottom: 32px;
}

.breakdown-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.breakdown-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 5px;
  transition: width 0.6s ease;
}

.bar-amount {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red-dark);
  text-align: right;
}

/* Share section */
.share-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
}

.share-card {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 14px;
  color: white;
}

.share-logo {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.share-text {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.share-cta {
  font-size: 0.8rem;
  opacity: 0.6;
}

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.share-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.share-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.share-btn.twitter { background: #000; color: white; }
.share-btn.reddit { background: #ff4500; color: white; }
.share-btn.copy { background: var(--border); color: var(--text); }

.methodology-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.recalc-btn {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.recalc-btn:hover { border-color: var(--navy); color: var(--navy); }

/* ===== HOW IT WORKS ===== */
.how-section {
  background: var(--navy);
  color: white;
  padding: 64px 0;
}

.how-section h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 36px;
  letter-spacing: -0.02em;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.how-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 24px;
}

.how-num {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 12px;
}

.how-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gold);
}

.how-card p {
  font-size: 0.84rem;
  opacity: 0.8;
  line-height: 1.55;
}

.source-box {
  background: rgba(255,255,255,0.07);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  font-size: 0.88rem;
  opacity: 0.85;
  line-height: 1.55;
}

.source-box a { color: var(--gold); }

/* ===== EMAIL ===== */
.email-section {
  padding: 56px 0;
  background: var(--bg);
}

.email-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.email-icon { font-size: 2.5rem; margin-bottom: 14px; }

.email-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.email-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
  line-height: 1.6;
}

.email-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.email-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.email-form input:focus { border-color: var(--red); }

.email-form button {
  background: var(--red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.email-form button:hover { background: var(--red-dark); }

.email-fine-print { font-size: 0.75rem; color: var(--text-muted); }

/* EmailOctopus embed overrides */
.emailoctopus-form-wrapper { margin: 0 auto 10px; }
.emailoctopus-form-wrapper form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.emailoctopus-form-wrapper input[type="email"] {
  flex: 1; min-width: 200px; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; outline: none;
}
.emailoctopus-form-wrapper input[type="email"]:focus { border-color: var(--red); }
.emailoctopus-form-wrapper input[type="submit"],
.emailoctopus-form-wrapper button[type="submit"] {
  background: var(--red); color: white; border: none;
  border-radius: 8px; padding: 12px 20px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background 0.2s;
}
.emailoctopus-form-wrapper input[type="submit"]:hover,
.emailoctopus-form-wrapper button[type="submit"]:hover { background: var(--red-dark); }

/* ===== FAQ ===== */
.faq-section {
  padding: 56px 0;
}

.faq-section h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.faq-list { max-width: 700px; margin: 0 auto; }

.faq-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] { border-color: var(--red); }

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--navy);
}

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--red);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 24px;
}

.footer-top {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 2;
  min-width: 200px;
}

.footer-brand .logo-icon { font-size: 1.2rem; margin-right: 6px; }
.footer-brand strong { color: white; font-size: 1rem; }
.footer-brand p { font-size: 0.82rem; margin-top: 8px; line-height: 1.5; max-width: 280px; }

.footer-links {
  display: flex;
  gap: 40px;
  flex-shrink: 0;
}

.footer-links > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links strong { color: white; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.footer-links a { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: white; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 0.78rem;
  line-height: 1.6;
}

.footer-bottom a { color: rgba(255,255,255,0.55); }
.footer-bottom a:hover { color: white; }

/* ===== AD UNITS ===== */
.ad-unit {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  text-align: center;
  min-height: 90px;
}

.ad-unit--hero     { background: #f0f2f7; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ad-unit--post-results { background: var(--bg); padding: 20px; }
.ad-unit--mid      { background: var(--bg); padding: 20px 20px 0; }
.ad-unit--prefooter { background: #f0f2f7; padding: 20px; border-top: 1px solid var(--border); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .calculator-card { padding: 20px; }
  .results-card { padding: 20px; }
  .email-card { padding: 24px; }
  .categories-grid { grid-template-columns: 1fr; }
  .big-number-row { flex-direction: column; gap: 16px; padding: 20px; }
  .big-divider { width: 60px; height: 1px; }
  .header-nav { display: none; }
  .hero-stats { padding: 16px; }
  .how-grid { grid-template-columns: 1fr 1fr; }
  .email-form { flex-direction: column; }
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
  .breakdown-bar-row { grid-template-columns: 100px 1fr 60px; }
}
