/* TrueCostCalc — Inter Font, Tightened Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0e1a;
  --surface: #141b2d;
  --surface-light: #1e293b;
  --text: #f8fafc;
  --text-muted: #64748b;
  --text-secondary: #94a3b8;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.1);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --border: rgba(100, 116, 139, 0.2);
  --radius: 12px;
  --max-width: 900px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(12px);
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.2rem;
  letter-spacing: -0.03em;
}

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

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(96, 165, 250, 0.35);
}

/* Calculator Cards */
.calculators {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.calculators h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.calc-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.calc-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.calc-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.calc-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.calc-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Features */
.why-use {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.why-use h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.feature h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-weight: 600;
}

.feature p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
}

.disclaimer {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* ===== CALCULATOR PAGES ===== */
.calc-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.calc-page h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.calc-page .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.calc-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .calc-container {
    grid-template-columns: 1fr 1fr;
  }
}

/* Input Panel */
.input-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Results Panel */
.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.results-panel h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.result-big {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.result-row:last-child {
  border-bottom: none;
}

.result-row .value {
  font-weight: 600;
  color: var(--text);
}

/* Savings Highlight */
.savings-box {
  background: var(--accent-soft);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
  text-align: center;
}

.savings-box .amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.savings-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* Affiliate Box */
.affiliate-box {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.affiliate-box h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.affiliate-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.affiliate-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success);
  color: #064e3b;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.affiliate-cta:hover {
  transform: translateY(-1px);
}

.affiliate-cta[href="#"] { pointer-events: none; }
.affiliate-cta[href="#"]::after { content: " · no offer linked here"; font-weight: 400; }

/* Related-reading box (editorial; no affiliate content) */
.reading-box {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.reading-box h4 { font-size: 1rem; margin-bottom: 0.5rem; font-weight: 600; }

.reading-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.reading-box a { color: var(--accent); font-weight: 600; }

/* Chart Area */
.chart-container {
  margin-top: 1.5rem;
  height: 200px;
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
}

/* Article/Blog Styles */
article.container {
  max-width: 700px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

article h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

article h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

article p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

article ul {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

article ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

article table th {
  background: var(--surface);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

article table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

article ol {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

article ol li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Fix for inline styled elements that might use old colors */
[style*="background"] {
  color: var(--text) !important;
}

[style*="color: #fbbf24"],
[style*="color:rgb(251, 191, 36)"],
[style*="color:rgba(251, 191, 36"] {
  color: var(--warning) !important;
  background: var(--surface) !important;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 3rem 1.5rem 2rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
  }
  
  article h1 {
    font-size: 1.8rem;
  }
}

/* --- Real Estate Bundle merchandising (added 2026-09-01) --- */
.nav-bundle { color: var(--warning) !important; font-weight: 600; }

.bundle-box {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.bundle-box h4 { margin-bottom: 0.5rem; font-size: 1.05rem; }

.bundle-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.bundle-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success);
  color: #064e3b;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.bundle-cta:hover { transform: translateY(-1px); }

.bundle-feature {
  background: linear-gradient(135deg, var(--surface) 0%, #0d2620 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0;
}

.bundle-feature h2 { font-size: 1.4rem; }

.bundle-feature .price { color: var(--success); }

.bundle-feature ul {
  margin: 1rem 0 1.5rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.bundle-feature .note { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.9rem; }

.btn-bundle {
  background: var(--success);
  color: #064e3b;
}

.btn-bundle:hover { box-shadow: 0 8px 30px rgba(52, 211, 153, 0.3); }
