/* ==========================================================================
   DebtFlow FinTech Design System - Overtime & Bonus Pay Calculator
   Module: css/styles.css
   ========================================================================== */

:root {
  /* Color Palette - Slate / Indigo / Emerald */
  --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;
  --indigo-900: #312e81;

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

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

  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
}

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

.header-left {
  display: flex;
  align-items: center;
  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, #4f46e5 0%, #10b981 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);
  flex-shrink: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  color: #4338ca;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.brand-badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: #10b981;
  border-radius: 50%;
}

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

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-link {
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.nav-link.active {
  color: #4338ca;
  background: #eef2ff;
  font-weight: 600;
}

/* Polished Multi-Column Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: #4f46e5;
  border: 1px solid #4338ca;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: all 0.15s ease;
}

.nav-dropdown-btn:hover {
  background: #4338ca;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 520px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 1rem;
  z-index: 1001;
}

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

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

.dropdown-sector {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dropdown-sector-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.25rem;
}

.dropdown-item {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.825rem;
  color: #334155;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #4f46e5;
  font-weight: 500;
}

.dropdown-item.active {
  font-weight: 600;
  color: #4338ca;
  background: #eef2ff;
}

@media (max-width: 768px) {
  .brand-badge {
    display: none;
  }
  .nav-dropdown-menu {
    width: 320px;
    right: 0;
  }
  .dropdown-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.25rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--indigo-700);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero-title .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: 1.1rem;
  color: var(--slate-600);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Dual-Mode Tab Bar */
.mode-tabs-nav {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}

.mode-tabs-wrapper {
  display: inline-flex;
  background: #ffffff;
  padding: 0.35rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  gap: 0.35rem;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-600);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

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

.tab-btn.active {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Calculator Layout */
.calculator-section {
  padding: 0.5rem 0 4.5rem;
}

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

@media (max-width: 980px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

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

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

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

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

/* Form Styles */
.form-group {
  margin-bottom: 1.35rem;
}

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

.field-hint {
  font-size: 0.775rem;
  color: var(--slate-500);
  font-weight: normal;
}

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

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

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

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

.text-input {
  width: 100%;
  height: 2.75rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  background: var(--slate-50);
  transition: all var(--transition-fast);
}

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

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

.text-input:focus {
  outline: none;
  border-color: var(--indigo-600);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Sliders */
.slider-group {
  margin-top: 0.5rem;
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--indigo-600);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-marks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--slate-400);
  margin-top: 0.25rem;
}

/* Selection Pills (Multipliers, Cycles, Methods) */
.pill-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}

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

.select-pill {
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.select-pill:hover {
  border-color: var(--indigo-300);
  color: var(--indigo-700);
}

.select-pill.active {
  background: var(--indigo-50);
  border-color: var(--indigo-600);
  color: var(--indigo-700);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* 2-Column Inline Grid */
.input-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Results Wrapper */
.results-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero Output Card */
.hero-output-card {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--indigo-900) 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.hero-output-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-output-eyebrow {
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--indigo-200);
  margin-bottom: 0.5rem;
}

.hero-output-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hero-output-amount {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4.5vw, 3.25rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.hero-output-unit {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--indigo-200);
}

.hero-output-subrow {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--slate-200);
}

/* Stat Grid Cards */
.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-metric-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-metric-label {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.stat-metric-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate-900);
}

.stat-metric-subtext {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}

/* Tax Distribution Bar */
.tax-dist-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

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

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

.stacked-bar-track {
  height: 20px;
  border-radius: 10px;
  background: var(--slate-100);
  display: flex;
  overflow: hidden;
  margin-bottom: 1rem;
}

.stacked-bar-fill {
  height: 100%;
  transition: width var(--transition-normal);
}

.bar-net { background: var(--emerald-500); }
.bar-fed { background: var(--indigo-600); }
.bar-state { background: var(--amber-500); }
.bar-fica { background: var(--rose-500); }

.stacked-bar-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  font-size: 0.85rem;
}

@media (min-width: 600px) {
  .stacked-bar-legend {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Callout Box */
.info-callout {
  background: var(--indigo-50);
  border-left: 4px solid var(--indigo-600);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--indigo-900);
  line-height: 1.55;
}

.info-callout p {
  margin-bottom: 0;
}

.info-callout strong {
  color: var(--indigo-950);
}

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

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

/* Amortization / Breakdown Table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.breakdown-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  padding: 0.65rem 0.75rem;
  border-bottom: 1.5px solid var(--slate-200);
}

.breakdown-table td {
  padding: 0.75rem;
  font-size: 0.925rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
}

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

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

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

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

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.75rem;
}

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

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

.faq-item[open] {
  border-color: var(--indigo-300);
  background: #ffffff;
  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;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

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

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

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

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

/* 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-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
}

/* Responsive Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 1rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.breakdown-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.breakdown-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  font-family: var(--font-heading);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--slate-200);
  text-align: left;
  white-space: nowrap;
}

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

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

@media (max-width: 640px) {
  .calc-card, .tax-dist-card, .hero-output-card {
    padding: 1.25rem 1rem;
    min-width: 0;
  }
  .input-row-grid, .stats-grid-2 {
    grid-template-columns: 1fr;
  }
  .tab-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
  .btn-submit {
    min-height: 44px;
    width: 100%;
  }
  .form-input {
    min-height: 44px;
  }
}
