/* ==========================================================================
   DebtFlow - High-Yield Savings & Compound Interest Calculator
   Module: css/styles.css
   Modern FinTech Design System (Inter + Plus Jakarta Sans)
   ========================================================================== */

:root {
  --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-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;

  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

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

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Header & Navigation styles provided centrally by /css/navbar.css */

/* Hero Section */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--slate-50) 100%);
  border-bottom: 1px solid var(--slate-200);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--emerald-700);
  background-color: var(--emerald-50);
  border: 1px solid var(--emerald-200);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

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

.hero-subtitle {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
  color: var(--slate-600);
  line-height: 1.6;
}

/* Main Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: start;
  margin: 2.5rem 0 3.5rem;
}

/* Cards */
.calc-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--slate-100);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

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

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

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

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}

.field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--slate-400);
}

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

.input-affix {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-400);
  pointer-events: none;
  user-select: none;
}

.input-affix.prefix {
  left: 0.85rem;
}

.input-affix.suffix {
  right: 0.85rem;
}

.text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--slate-800);
  background-color: #ffffff;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}

.text-input.has-prefix {
  padding-left: 1.9rem;
}

.text-input.has-suffix {
  padding-right: 2rem;
}

.text-input:focus {
  border-color: var(--emerald-600);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* Pill Selectors */
.pill-grid {
  display: grid;
  gap: 0.4rem;
  background-color: var(--slate-100);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}

.pill-grid.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

.pill-grid.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.pill-btn {
  padding: 0.5rem 0.25rem;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  color: var(--slate-900);
}

.pill-btn.active {
  background-color: #ffffff;
  color: var(--emerald-700);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* Output Dashboard Card */
.results-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.future-balance-hero {
  background: linear-gradient(135deg, var(--slate-900), var(--slate-800));
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  color: #ffffff;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.future-balance-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.future-balance-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--emerald-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.future-balance-amount {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.future-balance-sub {
  font-size: 0.85rem;
  color: var(--slate-300);
}

/* Stacked Visual Growth Bar */
.visual-growth-container {
  margin-bottom: 1.5rem;
}

.visual-bar-track {
  height: 22px;
  background-color: var(--slate-100);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--slate-200);
  margin-bottom: 0.75rem;
}

.bar-segment {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-principal {
  background: #334155; /* Slate 700 */
}

.segment-contributions {
  background: var(--indigo-600);
}

.segment-interest {
  background: var(--emerald-500);
}

.visual-bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--slate-600);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Stat Grid */
.stat-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.stat-box-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.stat-box-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
}

.stat-box-sub {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 0.2rem;
}

/* Benchmark Delta Card */
.benchmark-card {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(79, 70, 229, 0.05));
  border: 1.5px solid var(--emerald-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.benchmark-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--emerald-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-700);
  flex-shrink: 0;
}

.benchmark-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--emerald-900);
}

.benchmark-desc {
  font-size: 0.82rem;
  color: var(--emerald-800);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Schedule Section */
.schedule-section {
  margin-top: 3.5rem;
  margin-bottom: 4rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
}

.btn-export-csv {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background-color: #ffffff;
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-export-csv:hover {
  background-color: var(--slate-50);
  color: var(--slate-900);
  border-color: var(--slate-400);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th {
  background-color: var(--slate-50);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--slate-600);
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background-color: var(--slate-50);
}

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

/* FAQ Section */
.faq-section {
  padding: 4rem 0;
  background-color: #ffffff;
  border-top: 1px solid var(--slate-200);
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

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

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.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: var(--radius-md);
  background-color: #ffffff;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item[open] {
  border-color: var(--emerald-200);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.06);
}

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

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

.faq-chevron {
  color: var(--slate-400);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

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

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  color: var(--slate-600);
  line-height: 1.6;
}

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

/* Responsive */
@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .brand-badge {
    display: none;
  }

  .pill-grid.grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }

  .calc-card,
  .results-panel-wrapper,
  .benchmark-card {
    padding: 1.25rem 1rem;
    min-width: 0;
  }

  .pill-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pill-grid.grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .pill-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .input-control {
    min-height: 44px;
  }

  .btn-export-csv {
    min-height: 44px;
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .btn-export-csv,
  .faq-section,
  .site-footer {
    display: none !important;
  }

  body {
    background-color: #ffffff;
    color: #000000;
  }

  .calc-card,
  .results-card {
    box-shadow: none;
    border: 1px solid #cccccc;
  }
}
