/* ==========================================================================
   S Corp Tax & Salary Calculator — Industrial Fintech Design System
   Aesthetic: Premium Fintech / Modern Wealth SaaS (Deep Navy + Emerald + Indigo)
   Compliance: Zero Cumulative Layout Shift (CLS) for Google AdSense
   ========================================================================== */

:root {
  /* Colors - Modern Fintech Palette */
  --primary: #059669; /* Emerald Green (Tax Savings / Prosperity) */
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.25);

  --accent: #3b82f6; /* Trust Blue */
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;

  --navy: #0f172a;
  --navy-light: #1e293b;

  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;

  /* Neutrals & Surfaces (Light Theme) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #10b981;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  /* Elevations */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Ad Slot Placeholders */
  --ad-bg: rgba(148, 163, 184, 0.06);
  --ad-border: rgba(148, 163, 184, 0.18);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1e293b;
  --border-color: #1f293d;
  --border-focus: #34d399;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary-light: rgba(5, 150, 105, 0.15);
  --accent-light: rgba(59, 130, 246, 0.15);

  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);

  --ad-bg: rgba(30, 41, 59, 0.4);
  --ad-border: rgba(51, 65, 85, 0.4);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.85);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

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

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(15deg);
}

/* ==========================================================================
   Zero-CLS Ad Slot Containers
   ========================================================================== */
.ad-slot-leaderboard {
  min-height: 90px;
  width: 100%;
  max-width: 728px;
  margin: 1.5rem auto;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-slot-rectangle {
  min-height: 250px;
  width: 300px;
  margin: 1.5rem auto;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

/* Main Calculator Card */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Two-Column Tool Layout */
.calc-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 880px) {
  .calc-layout-grid {
    grid-template-columns: 1.1fr 1.2fr;
  }
}

/* Input Controls */
.calc-inputs-pane {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.input-card-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

.input-group,
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label,
.form-group label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.input-label {
  justify-content: space-between;
}

.input-helper {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: normal;
}

/* Tooltip badge */
.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-left: 0.4rem;
  cursor: help;
  transition: all 0.2s ease;
  vertical-align: middle;
  flex-shrink: 0;
}

.tooltip:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Currency Wrapper & Prefix */
.currency-input-wrapper,
.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.currency-prefix,
.currency-symbol {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

/* Unified Modern Fintech Input Styles */
.styled-input,
.form-input,
.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* Left padding when inside a currency wrapper with prefix */
.currency-input-wrapper .styled-input,
.currency-input-wrapper .form-input,
.input-currency-wrapper .styled-input,
.input-currency-wrapper .form-input {
  padding-left: 2.25rem;
}

/* Dropdown Select Styling with SVG Chevron */
.form-select,
select.styled-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.15rem;
  padding-right: 2.75rem;
  cursor: pointer;
}

select option {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

/* Focus States */
.styled-input:focus,
.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Form Grid for side-by-side inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Interactive Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.styled-slider {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.slider-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Preset Buttons */
.preset-buttons-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.btn-preset {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover, .btn-preset.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Results Display Pane */
.calc-results-pane {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Primary Savings Hero Banner */
.savings-hero-banner {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(59, 130, 246, 0.08));
  border: 1.5px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.savings-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.savings-amount-main {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.savings-subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Comparison Cards Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.compare-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compare-card.winner {
  border-color: rgba(5, 150, 105, 0.4);
  background: var(--primary-light);
}

.compare-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.compare-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.compare-tax-breakdown {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Subpages Callout Hero Banner */
.savings-callout-card {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(59, 130, 246, 0.08));
  border: 1.5px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.callout-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.callout-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
  line-height: 1.2;
  word-break: break-word;
  color: var(--text-main);
}

.callout-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Alert Callout Boxes */
.alert-box {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Metrics Grid & Cells */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.metric-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.metric-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  word-break: break-word;
}

/* Utility Colors */
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

/* Unified Buttons */
.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  box-sizing: border-box;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #047857);
  color: #ffffff !important;
  border: 1px solid var(--primary-hover);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #065f46);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

/* Report Slip Code Box (Mobile Responsive / Zero Overflow) */
.report-code-block {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  box-sizing: border-box;
  margin-top: 1rem;
}

/* Split Visualizer Bar */
.split-visualizer-container {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.split-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.split-bar-track {
  height: 14px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.split-bar-salary {
  background: var(--accent);
  transition: width 0.25s ease;
}

.split-bar-dist {
  background: var(--primary);
  transition: width 0.25s ease;
}

.split-legend-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Report Slip & Actions */
.report-slip-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.report-snippet-text {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.6;
  margin-top: 0.75rem;
}

/* Copy & Print Buttons */
.action-buttons-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-action:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Content Article */
.content-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.content-article {
  max-width: 860px;
  margin: 0 auto;
}

.content-article h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 2rem 0 1rem;
}

.content-article p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.content-article ul, .content-article ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.content-article li {
  margin-bottom: 0.5rem;
}

.callout-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  color: var(--text-main);
}

[data-theme="dark"] .callout-box {
  background: rgba(5, 150, 105, 0.12);
}

/* FAQ Accordion */
.faq-accordion {
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-icon {
  transition: transform 0.2s ease;
  color: var(--text-light);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  color: var(--text-muted);
}

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

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

.footer-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

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

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Print Slip Optimization: Clean 1-Page Dedicated Tax Assessment Slip
   Prints ONLY the summary slip box without website UI clutter
   ========================================================================== */
@media print {
  /* Hide all website chrome, hero, inputs, FAQs, headers, cookie banner, etc. */
  .site-header,
  .site-footer,
  .hero-section,
  .calc-inputs-pane,
  .savings-hero-banner,
  .savings-callout-card,
  .comparison-grid,
  .metrics-grid,
  .metric-cell,
  .split-visualizer-container,
  .action-buttons-row,
  .preset-buttons-row,
  .content-section,
  .cookie-banner,
  .alert-box,
  .risk-meter-container,
  .theme-toggle-btn,
  .ad-slot-leaderboard,
  .ad-slot-rectangle,
  .ad-slot-container,
  .ymyl-tax-disclaimer,
  .tooltip {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10pt !important;
  }

  /* Reset layout containers so only the slip box takes center stage */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .calculator-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: transparent !important;
    max-width: 680px !important;
  }

  .calculator-card::before {
    display: none !important;
  }

  .calc-layout-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  .calc-results-pane {
    display: block !important;
    gap: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  /* The Printable Tax Slip Box */
  .report-slip-box,
  .report-code-block {
    display: block !important;
    width: 100% !important;
    max-width: 650px !important;
    margin: 1.5rem auto !important;
    padding: 1.75rem 2rem !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 8px !important;
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
    font-size: 9.5pt !important;
    line-height: 1.55 !important;
    white-space: pre-wrap !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .report-slip-box > div {
    margin-bottom: 0.5rem !important;
  }

  .report-snippet-text {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #0f172a !important;
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
    font-size: 9.5pt !important;
    line-height: 1.55 !important;
    white-space: pre-wrap !important;
  }

  @page {
    size: portrait;
    margin: 12mm 15mm;
  }
}


/* ==========================================================================
   Additional Suite UI Components: Mobile Nav, Risk Meter, Comparison Tables
   ========================================================================== */

/* Mobile Nav Toggle */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .nav-menu {
    position: fixed;
    top: 4.25rem;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
    z-index: 99;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
  }
  .nav-menu.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-menu li:last-child {
    border-bottom: none;
  }
  .nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
  }
  .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding-left: 0.75rem;
  }
}

/* Alert Boxes */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Risk Meter & Gauge */
.risk-meter-container {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  height: 12px;
  overflow: hidden;
  margin: 0.75rem 0;
  position: relative;
}
.risk-score-bar {
  height: 100%;
  width: 25%;
  background-color: #10b981;
  transition: width 0.4s ease, background-color 0.4s ease;
  border-radius: 9999px;
}
.risk-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 9999px;
  border: 1.5px solid #10b981;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Comparison Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}
.comparison-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.comparison-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}
.comparison-table tr:last-child td {
  border-bottom: none;
}
.comparison-table tr:hover td {
  background: var(--primary-light);
  color: var(--text-main);
}


/* ==========================================================================
   Cookie Consent Banner (GDPR, CCPA & Google AdSense Compliance)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cookie-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.cookie-banner-text p {
  font-size: 0.875rem;
  color: #f1f5f9;
  line-height: 1.5;
  margin: 0;
}
.cookie-banner-text a {
  color: #38bdf8;
  text-decoration: underline;
  transition: color 0.15s ease;
}
.cookie-banner-text a:hover {
  color: #7dd3fc;
}
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.cookie-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.cookie-btn-accept {
  background: #059669;
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}
.cookie-btn-accept:hover {
  background: #047857;
  transform: translateY(-1px);
}
.cookie-btn-decline {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}
.cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
@media (max-width: 576px) {
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsiveness (Zero Overflow / High-DPI)
   ========================================================================== */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .calculator-card {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-md) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 1.25rem !important;
  }

  .comparison-grid,
  .metrics-grid,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .callout-value {
    font-size: 1.75rem !important;
  }

  .savings-amount-main {
    font-size: 2.15rem !important;
  }

  .action-buttons-row {
    justify-content: stretch !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .action-buttons-row .btn,
  .action-buttons-row .btn-action {
    flex: 1 1 100% !important;
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .report-code-block,
  .report-snippet-text {
    font-size: 0.75rem !important;
    padding: 0.75rem !important;
  }

  .risk-badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.55rem !important;
    white-space: normal !important;
    text-align: center !important;
  }
}


/* ==========================================================================
   YMYL & E-E-A-T Certified Tax Disclaimer Box
   ========================================================================== */
.ymyl-tax-disclaimer {
  margin-top: 1.75rem;
  padding: 1.25rem 1.5rem;
  background: #fefce8;
  border: 1px solid #fde047;
  border-left: 5px solid #eab308;
  border-radius: var(--radius-md, 10px);
  color: #713f12;
  font-size: 0.875rem;
  line-height: 1.6;
  box-sizing: border-box;
}

.ymyl-tax-disclaimer .disclaimer-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 0.5rem;
}

.ymyl-tax-disclaimer .disclaimer-text {
  margin: 0;
  color: #713f12;
}

.ymyl-tax-disclaimer .disclaimer-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(234, 179, 8, 0.3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #a16207;
  font-weight: 500;
}

.ymyl-tax-disclaimer .disclaimer-link {
  color: #854d0e;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.ymyl-tax-disclaimer .disclaimer-link:hover {
  color: #713f12;
}

[data-theme="dark"] .ymyl-tax-disclaimer {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(234, 179, 8, 0.35);
  border-left: 5px solid #eab308;
  color: #f1f5f9;
}

[data-theme="dark"] .ymyl-tax-disclaimer .disclaimer-header {
  color: #fde047;
}

[data-theme="dark"] .ymyl-tax-disclaimer .disclaimer-text {
  color: #cbd5e1;
}

[data-theme="dark"] .ymyl-tax-disclaimer .disclaimer-footer {
  border-top-color: rgba(234, 179, 8, 0.2);
  color: #94a3b8;
}

[data-theme="dark"] .ymyl-tax-disclaimer .disclaimer-link {
  color: #fde047;
}


/* ==========================================================================
   Google Official Dynamic Ad Container (Collapse Empty Div)
   - Collapses to display: none (0px height) when no ad is served (eliminates blank space)
   - Expands smoothly with reserved min-height ONLY when Google fills an ad
   ========================================================================== */
.ad-slot-container {
  display: none;
  justify-content: center;
  align-items: center;
  margin: 1.75rem auto;
  width: 100%;
  max-width: 970px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 8px);
  position: relative;
  text-align: center;
  box-sizing: border-box;
}

/* Expands when AdSense fills the slot */
.ad-slot-container.is-filled,
.ad-slot-container:has(ins.adsbygoogle[data-ad-status="filled"]),
.ad-slot-container:has(iframe) {
  display: flex;
  min-height: 280px;
  contain: layout;
}

@media (max-width: 768px) {
  .ad-slot-container.is-filled,
  .ad-slot-container:has(ins.adsbygoogle[data-ad-status="filled"]),
  .ad-slot-container:has(iframe) {
    min-height: 250px;
    margin: 1.25rem auto;
  }
}
