/* ==========================================================================
   DebtFlow FinTech Design System - 1099 vs. W-2 Tax & Compensation 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;
  --indigo-950: #0f172a;

  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-300: #6ee7b7;
  --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 {
  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;
}

.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.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--slate-900);
  text-decoration: none;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--emerald-600), var(--indigo-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

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

.brand-badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--emerald-500);
  border-radius: 50%;
}

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

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

.nav-link {
  color: var(--slate-600);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

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

/* 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: 780px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Common Settings Toolbar */
.settings-toolbar {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.settings-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-700);
}

.pill-group {
  display: inline-flex;
  background: var(--slate-100);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.pill-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

/* Checkbox Toggle UI */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--indigo-600);
  cursor: pointer;
}

/* Dual Input Scenarios Grid */
.dual-scenarios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

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

.scenario-card {
  background: #ffffff;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.scenario-card.w2-border {
  border-top: 4px solid var(--indigo-600);
}

.scenario-card.contractor-border {
  border-top: 4px solid var(--emerald-600);
}

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

.scenario-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-w2 {
  background: var(--indigo-50);
  color: var(--indigo-700);
  border: 1px solid var(--indigo-200);
}

.badge-1099 {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-200);
}

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

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

.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.35rem;
}

.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);
}

.mini-notice-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.825rem;
  color: var(--slate-600);
  margin-top: 0.5rem;
}

/* Breakeven Banner Card (High-Contrast Dark Theme) */
.breakeven-banner-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-xl);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.breakeven-banner-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.breakeven-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.breakeven-eyebrow svg {
  color: #38bdf8;
  flex-shrink: 0;
}

.breakeven-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 600;
  line-height: 1.45;
  color: #ffffff;
  margin-bottom: 1.5rem;
  max-width: 900px;
}

.breakeven-title strong {
  color: #38bdf8;
  font-weight: 700;
}

.breakeven-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
}

@media (max-width: 768px) {
  .breakeven-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.breakeven-stat-item {
  display: flex;
  flex-direction: column;
}

.be-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: block;
}

.be-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #38bdf8 !important;
  line-height: 1.2;
}

.be-value span,
.be-value strong {
  color: inherit;
  font-weight: inherit;
}

/* Comparison Table Card */
.comparison-matrix-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.matrix-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--slate-900);
}

.comparison-table-wrapper,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.comparison-table th {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--slate-200);
  white-space: nowrap;
}

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

.comparison-table td {
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  text-align: right;
  white-space: nowrap;
}

.comparison-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--slate-900);
}

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

.highlight-row {
  background: var(--emerald-50) !important;
}

.highlight-row td {
  font-weight: 700;
  color: var(--emerald-900) !important;
  font-size: 1.05rem !important;
  border-top: 1.5px solid var(--emerald-200);
  border-bottom: 1.5px solid var(--emerald-200);
}

.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.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* 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;
}

.diff-positive {
  color: var(--emerald-600) !important;
  font-weight: 700;
}

.diff-negative {
  color: var(--rose-600) !important;
  font-weight: 700;
}

.diff-neutral {
  color: var(--slate-400) !important;
  font-weight: 500;
}

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

@media (max-width: 640px) {
  .scenario-card,
  .comparison-matrix-card,
  .breakeven-banner-card {
    padding: 1.25rem 1rem;
    min-width: 0;
  }
  .input-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .btn-submit,
  .btn-export {
    min-height: 44px;
    width: 100%;
  }
  .form-input {
    min-height: 44px;
  }
}
