/* ============================================================
   ChiMortgageCalc — Complete Stylesheet
   Professional responsive design optimized for AdSense
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #1a365d;
  --primary-light: #2d4a7a;
  --secondary: #3498db;
  --accent: #2ecc71;
  --accent-dark: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;

  --text-dark: #1a202c;
  --text-medium: #4a5568;
  --text-light: #718096;
  --text-white: #ffffff;

  --bg-white: #ffffff;
  --bg-light: #f7fafc;
  --bg-dark: #1a202c;
  --bg-card: #ffffff;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e0;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--text-dark);
  font-weight: 700;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

ul { list-style: none; }

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Utility ---------- */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-light); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.logo:hover { color: var(--primary); }
.logo-icon {
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #27ae60);
  border-radius: var(--radius-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links li a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-medium);
  transition: all var(--transition);
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--primary);
  background: var(--bg-light);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--text-white) !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
}
.nav-cta:hover {
  background: var(--accent-dark) !important;
  color: var(--text-white) !important;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition);
}
.mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO (Homepage)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #34495e 100%);
  color: var(--text-white);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(46,204,113,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: rgba(46,204,113,0.2);
  border: 1px solid rgba(46,204,113,0.35);
  color: #a3f7bf;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 20px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
  position: relative;
  z-index: 1;
}
.stat-item { text-align: center; }
.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* ============================================================
   PAGE HERO (Sub-pages)
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-white);
  padding: 48px 0 40px;
}
.page-hero h1 {
  color: var(--text-white);
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.page-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 1.05rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.6);
}
.breadcrumb a {
  color: rgba(255,255,255,0.75);
}
.breadcrumb a:hover { color: var(--text-white); }
.breadcrumb .current { color: var(--accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.5;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-white);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,204,113,0.35);
}
.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--text-white);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  color: var(--text-white);
}

/* On white backgrounds */
main .btn-secondary,
.results-panel .btn-secondary,
.calculator-section .btn-secondary,
.amortization-controls .btn-secondary {
  background: var(--bg-light);
  color: var(--text-medium);
  border: 1px solid var(--border-light);
}
main .btn-secondary:hover,
.results-panel .btn-secondary:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.btn-large {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.features-section {
  padding: 80px 0;
  background: var(--bg-light);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--text-light); font-size: 1.05rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-white);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.feature-icon.blue   { background: rgba(52,152,219,0.12); color: var(--secondary); }
.feature-icon.green  { background: rgba(46,204,113,0.12); color: var(--accent); }
.feature-icon.purple { background: rgba(155,89,182,0.12); color: #9b59b6; }
.feature-icon.orange { background: rgba(243,156,18,0.12); color: var(--warning); }
.feature-icon.red    { background: rgba(231,76,60,0.12);  color: var(--danger); }
.feature-icon.teal   { background: rgba(26,188,156,0.12); color: #1abc9c; }

/* ============================================================
   SECTION PADDING & CTA BANNER
   ============================================================ */
.section-padding {
  padding: 60px 0;
}

.cta-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-white);
  padding: 56px 48px;
  border-radius: var(--radius-xl);
  text-align: center;
}
.cta-banner h2 {
  color: var(--text-white);
  margin-bottom: 12px;
  font-size: 2rem;
}
.cta-banner p {
  color: rgba(255,255,255,0.85);
  max-width: 540px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq-section {
  padding: 80px 0;
  background: var(--bg-light);
}

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

.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color var(--transition);
}
.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-question::after {
  content: '−';
  color: var(--accent);
}
.faq-question:hover { color: var(--secondary); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 0 24px 20px;
}
.faq-answer p {
  color: var(--text-medium);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ============================================================
   AD SLOTS (AdSense-Ready)
   ============================================================ */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-slot-horizontal {
  min-height: 100px;
  margin: 24px 0;
}

.ad-slot-in-article {
  min-height: 120px;
  margin: 32px 0;
}

.ad-slot-sidebar {
  min-height: 260px;
  margin-bottom: 24px;
}

.ad-slot-large {
  min-height: 280px;
  margin: 40px 0;
}

/* ============================================================
   CONTENT LAYOUT (Calculator & Amortization)
   ============================================================ */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.content-main { min-width: 0; }

.content-sidebar {
  position: sticky;
  top: 92px;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h4 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.sidebar-list {
  list-style: none;
}
.sidebar-list li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-medium);
  border-bottom: 1px solid var(--border-light);
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list li a {
  color: var(--secondary);
  font-weight: 500;
}
.sidebar-list li a:hover { color: var(--primary); }

/* ============================================================
   CALCULATOR FORM
   ============================================================ */
.calculator-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.calculator-section h2 {
  margin-bottom: 6px;
  font-size: 1.4rem;
}
.calculator-section > p {
  color: var(--text-light);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.calc-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
}
.label-hint {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.82rem;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-with-prefix:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
}
.input-prefix,
.input-suffix {
  padding: 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-light);
  flex-shrink: 0;
}
.input-with-prefix input {
  flex: 1;
  border: none;
  background: var(--bg-white);
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  min-width: 0;
}

.form-group select,
.form-group input[type="month"] {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--bg-white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group select:focus,
.form-group input[type="month"]:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
}

.calc-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ============================================================
   RESULTS PANEL
   ============================================================ */
.results-panel {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 28px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.monthly-payment .label {
  font-size: 0.88rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}
.monthly-payment .amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.result-card {
  background: var(--bg-light);
  padding: 18px 16px;
  border-radius: var(--radius-md);
  text-align: center;
}
.result-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.result-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}
.result-value.highlight {
  color: var(--accent);
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
  margin-top: 28px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chart-tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-medium);
  cursor: pointer;
  transition: all var(--transition);
}
.chart-tab:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}
.chart-tab.active {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}

.chart-wrapper {
  display: none;
  max-height: 380px;
  position: relative;
}
.chart-wrapper.active {
  display: block;
}
.chart-wrapper canvas {
  max-height: 360px;
}

/* ============================================================
   AMORTIZATION TABLE
   ============================================================ */
.amort-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.amortization-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.amortization-table-wrapper {
  margin-top: 16px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.amortization-table thead {
  background: var(--primary);
  color: var(--text-white);
}
.amortization-table th {
  padding: 14px 16px;
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.amortization-table th:first-child { text-align: left; }

.amortization-table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-medium);
}
.amortization-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
}
.amortization-table tbody tr:hover {
  background: rgba(52,152,219,0.04);
}
.amortization-table tbody tr:nth-child(even) {
  background: var(--bg-light);
}
.amortization-table tbody tr:nth-child(even):hover {
  background: rgba(52,152,219,0.06);
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-page {
  padding: 60px 0;
}

.legal-content {
  max-width: 780px;
  margin: 0 auto;
}
.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.legal-content .last-updated {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.legal-content h2 {
  font-size: 1.3rem;
  margin: 36px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.legal-content h2:first-of-type { border-top: none; }
.legal-content p {
  color: var(--text-medium);
  margin-bottom: 16px;
  line-height: 1.8;
}
.legal-content ul {
  margin: 12px 0 20px 24px;
  list-style: disc;
}
.legal-content ul li {
  color: var(--text-medium);
  margin-bottom: 8px;
  line-height: 1.7;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-form-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-form .form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.contact-form input,
.contact-form select {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--bg-light);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
  background: var(--bg-white);
}

.contact-form textarea {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--bg-light);
  outline: none;
  resize: vertical;
  min-height: 140px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-info-card {
  display: flex;
  gap: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  align-items: flex-start;
  transition: box-shadow var(--transition);
}
.contact-info-card:hover {
  box-shadow: var(--shadow-sm);
}

.info-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.contact-info-card h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.contact-info-card p {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.75);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo {
  margin-bottom: 14px;
  color: var(--text-white);
}
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer-col h4 {
  color: var(--text-white);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}
.footer-legal {
  display: flex;
  gap: 20px;
}
.footer-legal a {
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
}
.footer-legal a:hover { color: rgba(255,255,255,0.7); }

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablet: 1024px */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .content-sidebar { position: static; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .amort-summary-cards { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Mobile: 768px */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .mobile-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { padding: 12px 16px; display: block; }

  .hero { padding: 52px 0 44px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { flex-direction: column; gap: 20px; }
  .hero-buttons { flex-direction: column; }

  .page-hero h1 { font-size: 1.75rem; }

  .calc-form { grid-template-columns: 1fr; }

  .cta-banner { padding: 36px 24px; }
  .cta-banner h2 { font-size: 1.5rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* Small Mobile: 480px */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.65rem; }

  .header-inner { height: 60px; }
  .logo { font-size: 1.1rem; }
  .logo-icon { width: 34px; height: 34px; font-size: 1.3rem; }

  .results-grid { grid-template-columns: 1fr 1fr; }
  .amort-summary-cards { grid-template-columns: 1fr 1fr; }

  .monthly-payment .amount { font-size: 1.8rem; }

  .calculator-section,
  .results-panel,
  .contact-form-wrapper { padding: 20px; }

  .chart-tabs { gap: 6px; }
  .chart-tab { padding: 6px 12px; font-size: 0.78rem; }
}

/* ============================================================
   PRINT STYLESHEET
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .mobile-toggle,
  .nav-cta,
  .hero-buttons,
  .btn,
  .chart-tabs,
  .calc-actions { display: none !important; }

  body { font-size: 12pt; color: #000; }
  .container { max-width: 100%; padding: 0; }
  .content-layout { grid-template-columns: 1fr; }
  .results-panel { border: 1px solid #ccc; }
  .amortization-table { font-size: 9pt; }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* ============================================================
   UX ENHANCEMENTS (skip-link, inline errors, dual inputs, live hint)
   ============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  color: #fff;
}

.input-error {
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.4;
  min-height: 1.2em;
}
.input-error:empty { min-height: 0; }

.form-group .input-with-prefix.has-error,
.form-group select.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.12);
}

.dual-input {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
}

.live-calc-hint {
  flex: 1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.results-panel {
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0.4;
  transform: translateY(6px);
}
.results-panel--ready {
  opacity: 1;
  transform: none;
}

.hidden-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .dual-input { grid-template-columns: 1fr; }
  .calc-actions { flex-direction: column; align-items: stretch; }
  .live-calc-hint { text-align: center; justify-content: center; }
}
