/* Payroll Calculator — ClearBooks 2026 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fafafa; --bg-alt: #f1f5f9; --surface: #ffffff;
  --border: #e2e8f0; --text: #0f172a; --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent: #0d9488; --accent-hover: #0f766e;
  --accent-light: #ccfbf1; --accent-bg: #f0fdfa;
  --indigo: #6366f1; --amber: #f59e0b; --emerald: #10b981; --rose: #f43f5e;
  --radius: 10px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* Theme overrides — synced with home page via localStorage */
.style-bold {
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-light: #dbeafe; --accent-bg: #eff6ff;
  --radius: 12px; --radius-lg: 16px;
}
.style-classic {
  --accent: #1e3a5f; --accent-hover: #15294a; --accent-light: #e0e7ef; --accent-bg: #f1f5f9;
  --border: #d1d5db; --radius: 4px; --radius-lg: 6px;
}
.style-warm {
  --bg: #fffcf9; --bg-alt: #fef7ee; --accent: #c2410c; --accent-hover: #9a3412;
  --accent-light: #ffedd5; --accent-bg: #fff7ed; --border: #e7e0d8;
  --radius: 16px; --radius-lg: 20px;
}
.style-original {
  --bg: #0a0a0b; --bg-alt: #141416; --surface: #141416; --border: #27272a;
  --text: #fafafa; --text-secondary: #a1a1aa; --text-tertiary: #71717a;
  --accent: #6366f1; --accent-hover: #818cf8;
  --accent-light: rgba(99,102,241,0.15); --accent-bg: rgba(99,102,241,0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3); --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(250,250,250,0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: white; }
.nav-logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.5px; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.15s; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: none; color: var(--text-secondary); }
.btn-large { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }

/* Hero */
.calc-hero { padding: 88px 0 40px; text-align: center; }
.calc-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 12px; }
.calc-hero h1 span { background: linear-gradient(135deg, var(--accent) 0%, var(--indigo) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.calc-hero p { font-size: 16px; color: var(--text-secondary); max-width: 560px; margin: 0 auto 0; line-height: 1.7; }
.badge-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-light); }
.badge.purple { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.badge.amber { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge.rose { background: #fce7f3; color: #db2777; border-color: #fbcfe8; }

/* Calculator mode tabs */
.mode-tabs { display: flex; gap: 4px; justify-content: center; background: #e2e8f0; border-radius: 12px; padding: 5px; max-width: 560px; margin: 24px auto 28px; border: 1px solid #cbd5e1; }
.mode-tabs button { flex: 1; padding: 10px 16px; border: none; background: none; font-size: 14px; font-weight: 700; border-radius: 9px; cursor: pointer; color: var(--text-secondary); font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.mode-tabs button.active { background: var(--accent); color: white; box-shadow: var(--shadow-md); }
.mode-tabs button:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.5); }

/* Scenario presets */
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.preset-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; background: white; color: var(--text-secondary); font-family: inherit; transition: all 0.15s; }
.preset-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.preset-btn.active { border-color: var(--accent); color: white; background: var(--accent); }

/* Reciprocity alert */
.recip-alert { display: none; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: #fce7f3; border: 1px solid #fbcfe8; font-size: 12px; color: #9d174d; line-height: 1.5; }
.recip-alert.show { display: block; }
.recip-alert strong { color: #be185d; }

/* Local tax alert */
.local-alert { display: none; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: #ede9fe; border: 1px solid #ddd6fe; font-size: 12px; color: #5b21b6; line-height: 1.5; }
.local-alert.show { display: block; }

/* Gross-up result */
.grossup-result { display: none; margin-top: 12px; padding: 12px 16px; border-radius: 10px; background: linear-gradient(135deg, #f0fdfa, #e0e7ff); border: 1px solid #ccfbf1; }
.grossup-result.show { display: block; }
.grossup-result .gu-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.grossup-result .gu-amount { font-size: 24px; font-weight: 900; font-family: var(--mono); color: var(--text); }

/* Main calc layout */
.calc-container { display: grid; grid-template-columns: 420px 1fr; gap: 24px; padding-bottom: 64px; align-items: start; }

/* Input panel */
.input-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); position: sticky; top: 72px; }
.panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.form-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.form-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #f8fafc; color: var(--text);
  transition: all 0.15s; outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.08); background: white; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Salary input big */
.salary-wrap { position: relative; margin-bottom: 20px; }
.salary-wrap .currency-sign { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--text-tertiary); font-weight: 700; pointer-events: none; font-family: var(--mono); }
.salary-input { width: 100%; padding: 14px 14px 14px 34px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 28px; font-weight: 800; font-family: var(--mono); background: #f8fafc; color: var(--text); outline: none; transition: all 0.15s; letter-spacing: -0.02em; }
.salary-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(13,148,136,0.1); background: white; }

/* Pay type toggle */
.type-toggle { display: flex; background: #f1f5f9; border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.type-toggle button { flex: 1; padding: 7px; border: none; background: none; font-size: 12px; font-weight: 600; border-radius: 6px; cursor: pointer; color: var(--text-tertiary); font-family: inherit; transition: all 0.15s; }
.type-toggle button.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Results panel */
.results-panel { display: flex; flex-direction: column; gap: 20px; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.result-card.hero-card { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: white; border: none; box-shadow: var(--shadow-lg); }
.result-card.hero-card .rc-label { color: #94a3b8; }
.result-card.hero-card .rc-sublabel { color: #64748b; }
.rc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 4px; }
.rc-amount { font-size: 40px; font-weight: 900; letter-spacing: -0.04em; font-family: var(--mono); line-height: 1.1; }
.rc-sublabel { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.rc-stat { text-align: center; }
.rc-stat .value { font-size: 20px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.02em; }
.rc-stat .label { font-size: 11px; color: #64748b; margin-top: 2px; }
.hero-card .rc-stat { padding: 12px; background: rgba(255,255,255,0.06); border-radius: 8px; }

/* Tax bar */
.tax-bar-wrap { margin: 20px 0 12px; }
.tax-bar { display: flex; height: 24px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.tax-seg { transition: width 0.5s cubic-bezier(0.4,0,0.2,1); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; min-width: 0; overflow: hidden; }
.tax-seg.federal { background: linear-gradient(135deg, #6366f1, #818cf8); }
.tax-seg.state { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.tax-seg.fica { background: linear-gradient(135deg, #10b981, #34d399); }
.tax-seg.local { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.tax-seg.takehome { background: #e2e8f0; color: #475569; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }

/* Breakdown rows */
.breakdown-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 10px; }
.bd-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.bd-row + .bd-row { border-top: 1px solid #f1f5f9; }
.bd-row .label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.bd-row .label .rate { font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); }
.bd-row .value { font-size: 13px; font-weight: 700; color: var(--text); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bd-row.total { border-top: 2px solid var(--border); padding-top: 12px; margin-top: 4px; }
.bd-row.total .label { font-weight: 700; color: var(--text); font-size: 14px; }
.bd-row.total .value { font-size: 15px; font-weight: 800; }
.bd-row.green .value { color: var(--accent); }
.bd-row.red .value { color: var(--rose); }

/* Period tabs */
.period-tabs { display: flex; gap: 2px; background: #f1f5f9; border-radius: 8px; padding: 3px; }
.period-tabs button { padding: 6px 14px; border: none; background: none; font-size: 12px; font-weight: 600; border-radius: 6px; cursor: pointer; color: var(--text-tertiary); font-family: inherit; transition: all 0.15s; }
.period-tabs button.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

/* State comparison */
.state-compare { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.sc-item { text-align: center; padding: 10px 8px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; }
.sc-item:hover { border-color: var(--accent-light); box-shadow: var(--shadow-sm); }
.sc-item.current { background: var(--accent-bg); border-color: var(--accent-light); }
.sc-item .sc-state { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.sc-item .sc-pay { font-size: 14px; font-weight: 800; font-family: var(--mono); color: var(--text); margin-top: 2px; }
.sc-item .sc-rate { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }

/* Bracket table */
.bracket-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.bracket-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bracket-table td { font-size: 12px; padding: 6px 8px; border-bottom: 1px solid #f1f5f9; font-family: var(--mono); color: var(--text-secondary); }
.bracket-table tr.active td { background: var(--accent-bg); color: var(--text); font-weight: 600; }

/* Comparison table */
.compare-section { padding: 60px 0; background: var(--bg-alt); border-top: 1px solid var(--border); }
.compare-section h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 900; letter-spacing: -0.04em; text-align: center; margin-bottom: 8px; }
.compare-section .subtitle { text-align: center; font-size: 15px; color: var(--text-secondary); max-width: 550px; margin: 0 auto 32px; }
.compare-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.compare-table th { padding: 12px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); text-align: center; background: #f8fafc; border-bottom: 2px solid var(--border); }
.compare-table th:first-child { text-align: left; width: 260px; }
.compare-table th.us { color: var(--accent); }
.compare-table td { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.compare-table td:first-child { font-weight: 600; color: var(--text); text-align: left; }
.compare-table tr:last-child td { border-bottom: none; }
.ct-yes { color: var(--accent); font-weight: 700; }
.ct-no { color: #cbd5e1; }
.ct-partial { color: var(--amber); font-weight: 600; }

/* CTA */
.calc-cta { text-align: center; padding: 64px 0; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: white; }
.calc-cta h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.calc-cta p { font-size: 15px; color: #94a3b8; margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }
.calc-cta .btn-primary { background: var(--accent); padding: 14px 32px; font-size: 15px; border-radius: var(--radius-lg); }

/* Depth section */
.depth-section { padding: 80px 0; background: white; border-top: 1px solid var(--border); }
.depth-section h2 { font-size: clamp(24px, 3vw, 36px); font-weight: 900; letter-spacing: -0.04em; text-align: center; margin-bottom: 8px; }
.depth-section .subtitle { text-align: center; font-size: 16px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 48px; }
.depth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.depth-card { padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); transition: all 0.2s; }
.depth-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent-light); transform: translateY(-2px); }
.depth-card .dc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; }
.depth-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.depth-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.depth-card .dc-detail { margin-top: 10px; font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); line-height: 1.8; }
.stats-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 48px 0 0; }
.stat-item { text-align: center; padding: 20px 12px; background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-item .number { font-size: 32px; font-weight: 900; font-family: var(--mono); color: var(--accent); letter-spacing: -0.03em; transition: all 0.5s ease-out; }
.stat-item .label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 600; }
.stat-item.animated .number { animation: countPulse 0.3s ease-out; }
@keyframes countPulse { 0% { transform: scale(1.1); } 100% { transform: scale(1); } }
.source-note { margin-top: 32px; padding: 16px 20px; border-radius: var(--radius); background: var(--accent-bg); border: 1px solid var(--accent-light); font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.source-note strong { color: var(--accent); }

/* Footer */
.calc-footer { padding: 32px 0; border-top: 1px solid var(--border); }
.calc-footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.calc-footer .copy { font-size: 12px; color: var(--text-tertiary); }
.calc-footer .disclaimer { font-size: 11px; color: var(--text-tertiary); max-width: 600px; line-height: 1.5; }

/* Responsive */
@media (max-width: 900px) {
  .calc-container { grid-template-columns: 1fr; }
  .input-panel { position: static; }
  .rc-stats { grid-template-columns: repeat(3, 1fr); }
  .state-compare { grid-template-columns: repeat(2, 1fr); }
  .depth-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { grid-template-columns: repeat(3, 1fr); }
  .mode-tabs { flex-wrap: wrap; }
  .compare-table { font-size: 12px; }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .rc-amount { font-size: 32px; }
  .state-compare { grid-template-columns: 1fr 1fr; }
  .depth-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .mode-tabs button { font-size: 11px; padding: 7px 8px; }
}
