/* ===== Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1e2642;
  --bg-input: #0f1629;
  --border-color: #2a3352;
  --border-hover: #3b4b80;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-primary-light: #818cf8;
  --accent-primary-dark: #4f46e5;
  --accent-green: #10b981;
  --accent-green-light: #34d399;
  --accent-blue: #3b82f6;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-card: linear-gradient(145deg, #1a2035, #151c30);
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img { max-width: 100%; }
ul { list-style: none; }

/* ===== Header ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Calculator Cards Grid ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 2rem 4rem;
}

.calc-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.calc-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.calc-card:hover::before {
  opacity: 1;
}

.calc-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.calc-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.calc-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-primary-light);
  font-weight: 600;
  font-size: 0.875rem;
}

.calc-card:hover .calc-card-link {
  gap: 10px;
}

/* Card icon colors */
.icon-emi { background: rgba(99,102,241,0.15); color: var(--accent-primary-light); }
.icon-sip { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.icon-loan { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.icon-interest { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.icon-fd { background: rgba(236,72,153,0.15); color: var(--accent-pink); }

/* ===== Calculator Page Layout ===== */
.calculator-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.calculator-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.calculator-page .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

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

/* ===== Input Panel ===== */
.input-panel {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

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

.input-group:last-child {
  margin-bottom: 0;
}

.input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.input-label label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.input-label .value-display {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 120px;
  text-align: right;
}

.input-label input[type="number"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  width: 140px;
  text-align: right;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}

.input-label input[type="number"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Remove number input arrows */
.input-label input[type="number"]::-webkit-outer-spin-button,
.input-label input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-label input[type="number"] { -moz-appearance: textfield; }

/* ===== Range Slider ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 10px rgba(99,102,241,0.4);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 10px rgba(99,102,241,0.4);
}

/* ===== Toggle Buttons ===== */
.toggle-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-top: 0.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* ===== Result Panel ===== */
.result-panel {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.result-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.result-item:last-of-type {
  border-bottom: none;
}

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

.result-item .result-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-value.highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2rem;
}

.chart-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  max-height: 280px;
}

.chart-container canvas {
  max-width: 250px;
  max-height: 250px;
}

/* ===== Early Closure Section ===== */
.early-closure {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.early-closure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.early-closure-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: 0.3s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .switch-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
  background: white;
}

.early-closure-content {
  display: none;
}

.early-closure-content.visible {
  display: block;
}

.early-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.early-result-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.early-result-card .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.early-result-card .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* ===== Amortization Table ===== */
.amort-section {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.amort-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.table-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.table-tab {
  padding: 8px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.table-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.amort-table th {
  background: var(--bg-input);
  padding: 12px 16px;
  text-align: right;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

.amort-table th:first-child {
  text-align: left;
}

.amort-table td {
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid rgba(42,51,82,0.5);
  white-space: nowrap;
}

.amort-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.amort-table tbody tr:hover {
  background: rgba(99,102,241,0.05);
}

.amort-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary-light);
}

.share-btn-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* ===== Ad Placeholder ===== */
.ad-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 2rem 0;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand .logo {
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.footer-col a:hover {
  color: var(--accent-primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Content Pages ===== */
.content-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content-page h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-page h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-page p, .content-page li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.content-page ul {
  margin-left: 1.5rem;
  list-style: disc;
  margin-bottom: 1rem;
}

/* ===== Contact Form ===== */
.contact-form {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== Select Input ===== */
.select-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.select-input:focus {
  border-color: var(--accent-primary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Nav — hamburger menu */
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
  }
  .nav-links a:last-child { border-bottom: none; }
  .mobile-menu-btn { display: block; }
  nav { padding: 0 1.25rem; }

  /* Hero */
  .hero h1 { font-size: 2rem; }
  .hero { padding: 2.5rem 1.5rem 1.5rem; }

  /* Calculator cards */
  .calc-grid { padding: 0 1.25rem 3rem; gap: 1rem; }

  /* Calculator page */
  .calculator-page { padding: 1.25rem; }
  .calculator-page h1 { font-size: 1.4rem; line-height: 1.3; }
  .calculator-page .subtitle { font-size: 0.88rem; }
  .input-panel, .result-panel { padding: 1.25rem; }
  .amort-section { padding: 1.25rem; }
  .early-closure { padding: 1.25rem; }

  /* Loan type buttons — wrap and fill */
  .loan-type-bar {
    gap: 0.4rem;
    justify-content: flex-start;
  }
  .loan-type-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
    flex: 0 0 auto;
  }

  /* Share buttons */
  .share-btn-container {
    gap: 0.5rem;
  }
  .share-btn-container .btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* Early closure */
  .early-results { grid-template-columns: 1fr 1fr; }
  .early-result-card .value { font-size: 1rem; }

  /* Comparison cards */
  .comparison-grid { grid-template-columns: 1fr; gap: 1rem; }
  .comparison-section { padding: 1.25rem; }

  /* Loan compare cards */
  .loan-compare-section { padding: 1.25rem; }
  .loan-compare-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  /* Bar chart */
  .bar-chart-section { padding: 1.25rem; }
  .bar-chart-container { height: 280px; }

  /* Interest saved banner */
  .interest-saved-banner {
    flex-direction: column;
    text-align: center;
    padding: 1rem 1.25rem;
  }
  .interest-saved-banner .saved-amount { font-size: 1.25rem; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .site-footer { padding: 2rem 1.25rem 1.5rem; }

  /* SEO content */
  .seo-content { padding: 1.5rem; margin-top: 2rem; }
  .seo-content h2 { font-size: 1.15rem; }

  /* FAQ */
  .faq-question { padding: 1rem 1.25rem; font-size: 0.88rem; }
  .faq-answer { font-size: 0.85rem; }
  .faq-item.open .faq-answer { padding: 0 1.25rem 1rem; }

  /* Content pages (about, privacy, contact) */
  .content-page { padding: 2rem 1.25rem; }
  .content-page h1 { font-size: 1.75rem; }
  .content-page h2 { font-size: 1.15rem; }

  /* Internal links */
  .internal-links-grid { grid-template-columns: 1fr; }

  /* Download bar */
  .download-bar { gap: 0.5rem; }
  .download-bar .btn { padding: 8px 12px; font-size: 0.78rem; }

  /* Ad placeholder */
  .ad-placeholder { padding: 1.25rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
  .hero p { font-size: 0.95rem; }
  .calc-grid { grid-template-columns: 1fr; padding: 0 1rem 2.5rem; }
  .calculator-page { padding: 1rem; }
  .calculator-page h1 { font-size: 1.25rem; }

  .input-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .input-label input[type="number"] { width: 100%; }
  .result-value.highlight { font-size: 1.5rem; }
  .result-item .result-value { font-size: 1.2rem; }

  /* Loan type — scroll horizontally on very small screens */
  .loan-type-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .loan-type-bar::-webkit-scrollbar { display: none; }
  .loan-type-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Share buttons — stack */
  .share-btn-container {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .share-btn-container .btn { font-size: 0.75rem; padding: 6px 10px; }

  /* Early results — 1 column */
  .early-results { grid-template-columns: 1fr; }

  /* Loan compare — 1 column */
  .loan-compare-grid { grid-template-columns: 1fr; }
  .loan-compare-card { padding: 1rem; }
  .loan-compare-card h3 { font-size: 0.88rem; }

  /* Content page */
  .content-page h1 { font-size: 1.5rem; }
  .content-page { padding: 1.5rem 1rem; }

  /* Table text smaller */
  .amort-table { font-size: 0.78rem; }
  .amort-table th, .amort-table td { padding: 8px 10px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.calc-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.calc-card:nth-child(1) { animation-delay: 0.1s; }
.calc-card:nth-child(2) { animation-delay: 0.2s; }
.calc-card:nth-child(3) { animation-delay: 0.3s; }
.calc-card:nth-child(4) { animation-delay: 0.4s; }
.calc-card:nth-child(5) { animation-delay: 0.5s; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ===== FAQ Section ===== */
.faq-section {
  margin-top: 3rem;
}

.faq-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.faq-item {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover { border-color: var(--border-hover); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  user-select: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent-primary-light);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.25rem;
}

/* ===== SEO Content Section ===== */
.seo-content {
  margin-top: 3rem;
  padding: 2.5rem;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.seo-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.seo-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.seo-content ul {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  list-style: disc;
}

.seo-content .formula-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  color: var(--accent-primary-light);
  margin: 1rem 0;
  overflow-x: auto;
}

/* ===== Internal Cross-Links ===== */
.internal-links-section {
  margin-top: 3rem;
}

.internal-links-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.internal-link-card {
  display: block;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.internal-link-card:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary-light);
  transform: translateY(-2px);
}
