/**
 * Credit Card Payoff Calculator - Stylesheet
 * Architecture: Modular CSS with Design Tokens & Modern FinTech Aesthetic
 * Palette: Slate / Indigo / Emerald
 */

/* ==========================================================================
   1. Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Slate Neutrals */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Indigo Accent (Primary Brand) */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;

  /* Emerald Accent (Success / Principal) */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  /* Amber & Rose (Warnings & Errors) */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-200: #fecdd3;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;

  /* Surface & Shadows */
  --bg-surface: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: #6366f1;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-body);

  /* Micro-Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--slate-700);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container, main, section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   3. Header & Brand Navigation
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  transition: all var(--transition-fast);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  height: auto;
  padding: 0.5rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--slate-900);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--emerald-500) 100%);
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  color: var(--emerald-700);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.brand-badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--emerald-500);
  border-radius: 50%;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: var(--slate-600);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--indigo-600);
  background: var(--slate-100);
}

.nav-link.active {
  color: var(--indigo-600);
  background: var(--indigo-50);
  font-weight: 600;
}

/* Structured Tools Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background-color: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-dropdown-btn:hover {
  background-color: var(--slate-200);
  color: var(--slate-900);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.4rem;
  width: 320px;
  background-color: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.75rem;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.dropdown-sector {
  margin-bottom: 0.65rem;
}

.dropdown-sector:last-child {
  margin-bottom: 0;
}

.dropdown-sector-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  padding: 0.2rem 0.5rem;
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: var(--slate-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--slate-50);
  color: var(--indigo-600);
}

.dropdown-item.active {
  font-weight: 600;
  color: var(--indigo-600);
  background-color: var(--indigo-50);
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  color: var(--indigo-700);
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title span.highlight {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--emerald-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.15rem);
  color: var(--slate-600);
  max-width: 680px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.trust-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-top: 0.5rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trust-icon {
  color: var(--emerald-500);
}

/* ==========================================================================
   5. Calculator Layout Grid & Cards
   ========================================================================== */
.calculator-section {
  padding: 1.5rem 0 3.5rem;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 992px) {
  .calc-layout {
    grid-template-columns: 460px 1fr;
  }
}

.calc-card {
  background: var(--bg-surface);
  border-radius: 1.25rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
  position: relative;
}

@media (min-width: 640px) {
  .calc-card {
    padding: 2.25rem;
  }
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}

/* Preset Chips */
.presets-container {
  margin-bottom: 1.5rem;
}

.presets-label {
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--slate-400);
  margin-bottom: 0.5rem;
  display: block;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.preset-chip:hover {
  background: var(--indigo-50);
  border-color: var(--indigo-200);
  color: var(--indigo-700);
  transform: translateY(-1px);
}

/* ==========================================================================
   6. Form Inputs, Affixes & Validation
   ========================================================================== */
.input-group-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-bottom: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-helper {
  font-size: 0.775rem;
  color: var(--slate-400);
}

.input-affix-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix, .input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-weight: 600;
  font-size: 1.05rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-prefix {
  left: 1rem;
}

.input-suffix {
  right: 1rem;
}

.form-input {
  width: 100%;
  height: 3.25rem;
  background: #ffffff;
  border: 1.5px solid var(--slate-200);
  border-radius: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-900);
  padding: 0 1rem;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.form-input.has-prefix {
  padding-left: 2.25rem;
}

.form-input.has-suffix {
  padding-right: 2.25rem;
}

.form-input:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.input-affix-container:focus-within .input-prefix,
.input-affix-container:focus-within .input-suffix {
  color: var(--indigo-600);
}

.input-error-msg {
  color: var(--rose-600);
  font-size: 0.775rem;
  font-weight: 500;
  display: none;
  margin-top: 0.2rem;
}

.input-error-msg.active {
  display: block;
}

/* Live Benchmark Hint */
.live-interest-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--slate-600);
  margin-top: 0.25rem;
  transition: all var(--transition-fast);
}

.live-interest-hint strong {
  color: var(--slate-800);
}

/* Primary CTA Button */
.btn-submit {
  width: 100%;
  height: 3.5rem;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all var(--transition-base);
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-600) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ==========================================================================
   7. Warning Alert Banner
   ========================================================================== */
.warning-alert-box {
  background: var(--rose-50);
  border: 1.5px solid var(--rose-500);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: none;
  animation: alert-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.warning-alert-box.visible {
  display: block;
}

@keyframes alert-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

.warning-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.warning-icon {
  color: var(--rose-600);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.warning-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rose-700);
  margin-bottom: 0.25rem;
}

.warning-text {
  font-size: 0.925rem;
  color: var(--rose-700);
  line-height: 1.5;
  font-weight: 500;
}

.warning-recommendation {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--rose-200);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--slate-700);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   8. Results & Metric Cards
   ========================================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card.highlight-emerald {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: var(--emerald-200);
}

.metric-card.highlight-indigo {
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  border-color: var(--indigo-200);
}

.metric-card.highlight-slate {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: var(--slate-200);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
}

.metric-icon-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-emerald {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.badge-indigo {
  background: var(--indigo-100);
  color: var(--indigo-700);
}

.badge-slate {
  background: var(--slate-200);
  color: var(--slate-700);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.metric-subtext {
  font-size: 0.825rem;
  color: var(--slate-500);
  font-weight: 500;
}

.metric-subtext strong {
  color: var(--slate-800);
}

/* ==========================================================================
   9. Progress Bar & Visual Breakdown
   ========================================================================== */
.breakdown-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.breakdown-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800);
}

.stacked-bar-container {
  height: 1rem;
  background: var(--slate-100);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.bar-principal {
  background: linear-gradient(90deg, var(--emerald-500) 0%, var(--emerald-600) 100%);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px 0 0 9999px;
}

.bar-interest {
  background: linear-gradient(90deg, var(--indigo-500) 0%, var(--indigo-600) 100%);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 9999px 9999px 0;
}

.breakdown-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--slate-200);
  font-size: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.dot-emerald { background: var(--emerald-500); }
.dot-indigo { background: var(--indigo-500); }

/* ==========================================================================
   10. Payoff Accelerator / Booster Card
   ========================================================================== */
.booster-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid var(--indigo-100);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.booster-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.booster-badge {
  background: var(--indigo-600);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.booster-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-900);
}

.booster-description {
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: 1.5;
}

.booster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.booster-btn {
  background: #ffffff;
  border: 1px solid var(--indigo-200);
  color: var(--indigo-700);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.booster-btn:hover {
  background: var(--indigo-600);
  color: #ffffff;
  border-color: var(--indigo-600);
}

/* ==========================================================================
   11. Amortization Schedule Table & Controls
   ========================================================================== */
.schedule-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .schedule-card {
    padding: 2rem;
  }
}

.schedule-topbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .schedule-topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-export {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-export:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.table-container,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  border: 1px solid var(--slate-200);
  max-height: 420px;
  overflow-y: auto;
}

.amortization-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.amortization-table th {
  background: var(--slate-50);
  color: var(--slate-700);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1.5px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.amortization-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-600);
  white-space: nowrap;
}

.amortization-table tr:hover td {
  background: var(--slate-50);
}

.amortization-table td.principal-cell {
  color: var(--emerald-700);
  font-weight: 600;
}

.amortization-table td.interest-cell {
  color: var(--indigo-700);
  font-weight: 500;
}

.amortization-table td.balance-cell {
  font-weight: 700;
  color: var(--slate-900);
}

.table-footer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.825rem;
  color: var(--slate-500);
}

.btn-expand-table {
  background: none;
  border: none;
  color: var(--indigo-600);
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.btn-expand-table:hover {
  text-decoration: underline;
}

/* ==========================================================================
   12. Repayment Strategies Section
   ========================================================================== */
.strategies-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--slate-200);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.section-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--indigo-600);
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.section-lead {
  color: var(--slate-600);
  font-size: 1.05rem;
}

.strategies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .strategies-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.strategy-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.strategy-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
}

.strategy-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--indigo-50);
  color: var(--indigo-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.strategy-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-900);
}

.strategy-desc {
  font-size: 0.9rem;
  color: var(--slate-600);
  line-height: 1.55;
}

/* ==========================================================================
   13. FAQ Accordion Component
   ========================================================================== */
.faq-section {
  padding: 3.5rem 0 5rem;
  border-top: 1px solid var(--slate-200);
  background: #ffffff;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--slate-200);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--slate-50);
  transition: all var(--transition-fast);
}

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

.faq-item[open] {
  background: #ffffff;
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  color: var(--indigo-600);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.5rem 1.35rem;
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ==========================================================================
   14. Site Footer
   ========================================================================== */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--slate-800);
  font-size: 0.875rem;
}

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

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

.footer-brand h3 {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-disclaimer {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--slate-500);
}

.footer-col h4 {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--slate-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--slate-800);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .calc-card,
  .results-card,
  .payoff-summary-card {
    padding: 1.25rem 1rem;
    min-width: 0;
  }
  .strategy-toggle-wrapper {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .btn-submit,
  .btn-export {
    min-height: 44px;
    width: 100%;
  }
  .form-input {
    min-height: 44px;
  }
  .preset-chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
