/* -----------------------------------------------
   TaxCalc - Premium Tax Calculator Design System
   Trust · Accuracy · Confidence
   ----------------------------------------------- */

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

/* ACCESSIBILITY */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

:root {
  --bg: #f7f8fa;
  --bg-white: #ffffff;
  --surface: #f1f4f8;
  --surface-alt: #e8ecf2;
  --border: #dfe3ea;
  --border-dark: #c4cad4;
  --text: #1a2332;
  --text-muted: #5a6a7e;
  --text-light: #8a96a8;
  --primary: #0c2340;
  --primary-mid: #163d6b;
  --primary-light: #1a5bb5;
  --accent: #1a73e8;
  --accent-light: #e8f0fe;
  --green: #0d7a3e;
  --green-light: #e6f9ee;
  --green-bg: #effdf4;
  --amber: #a85d00;
  --amber-bg: #fef9eb;
  --red: #c53030;
  --red-bg: #fef2f2;
  --gold: #b8860b;
  --navy: #0c1829;
  --navy-mid: #162a45;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --shadow-xs: 0 1px 2px rgba(12,35,64,0.04);
  --shadow-sm: 0 1px 3px rgba(12,35,64,0.06), 0 1px 2px rgba(12,35,64,0.04);
  --shadow: 0 2px 8px rgba(12,35,64,0.08), 0 1px 3px rgba(12,35,64,0.06);
  --shadow-md: 0 4px 16px rgba(12,35,64,0.10), 0 2px 4px rgba(12,35,64,0.05);
  --shadow-lg: 0 8px 32px rgba(12,35,64,0.12), 0 4px 8px rgba(12,35,64,0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1140px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -- TYPOGRAPHY -- */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.85rem; margin-bottom: 8px; }
h2 { font-size: 1.35rem; margin-bottom: 6px; border-bottom: 2px solid var(--primary); padding-bottom: 6px; display: inline-block; }
h3 { font-size: 1.1rem; margin-bottom: 4px; }
p { margin-bottom: 12px; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); text-decoration: underline; }

.num { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.02em; }
.num-lg { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--primary); }
.num-green { color: var(--green); }
.num-red { color: var(--red); }
.num-amber { color: var(--amber); }

/* -- LAYOUT -- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* -- HEADER -- */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white;
  padding: 12px 0;
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { color: white; text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.header-nav { display: flex; gap: 4px; align-items: center; }
.header-nav a {
  color: rgba(255,255,255,0.85);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.header-nav a:hover { background: rgba(255,255,255,0.12); color: white; text-decoration: none; }
.header-nav a.active { background: rgba(255,255,255,0.15); color: white; }

/* -- TRUST BAR -- */
.trust-bar {
  background: var(--green-bg);
  border-bottom: 1px solid #c6f0d5;
  padding: 6px 0;
  font-size: 0.78rem;
  color: var(--green);
  text-align: center;
  font-weight: 500;
}

/* -- HERO -- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--navy-mid) 100%);
  color: white;
  padding: 40px 0 32px;
  text-align: center;
}
.hero h1 { color: white; font-size: 2.2rem; margin-bottom: 12px; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; max-width: 640px; margin: 0 auto 20px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

/* -- CARDS -- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }

/* -- CALCULATOR GRID -- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.calc-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  border-color: var(--accent);
}
.calc-card .calc-icon { font-size: 2rem; }
.calc-card h3 { color: var(--primary); margin: 0; font-size: 1rem; }
.calc-card p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.calc-card .calc-keywords { font-size: 0.75rem; color: var(--text-light); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* -- CALCULATOR FORM -- */
.calc-section { margin: 24px 0; }
.calc-form {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 5px;
}
.form-row input, .form-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--bg-white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row input:focus, .form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.btn-calc {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}
.btn-calc:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.08);
}

/* -- RESULTS -- */
.results-panel {
  background: linear-gradient(135deg, var(--primary) 0%, var(--navy-mid) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 20px;
  display: none;
}
.results-panel.visible { display: block; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.result-row:last-child { border-bottom: none; }
.result-label { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.result-value { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; }
.result-highlight {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  text-align: center;
}
.result-highlight .result-big {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: #5bf29c;
  display: block;
}
.result-highlight .result-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* -- BREAKDOWN TABLE -- */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.breakdown-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.breakdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.breakdown-table tr:hover { background: var(--surface); }

/* -- FAQ -- */
.faq-section { margin: 32px 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-white);
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
  font-family: var(--font-body);
}
.faq-question:hover { background: var(--surface); }
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform var(--transition); }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 16px 16px; }

/* -- RELATED CALCS -- */
.related-section { margin: 32px 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.related-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.related-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); text-decoration: none; }
.related-link .icon { font-size: 1.2rem; }

/* -- INFO/CONTENT SECTIONS -- */
.info-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.info-section h2 { margin-bottom: 12px; }
.info-section ul { padding-left: 20px; margin: 12px 0; }
.info-section li { margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }

.tip-box {
  background: var(--green-bg);
  border: 1px solid #c6f0d5;
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.tip-box h3 { color: var(--green); font-size: 0.95rem; margin-bottom: 8px; }
.tip-box p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.warning-box {
  background: var(--amber-bg);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

/* -- CROSS-SITE LINKS -- */
.network-section {
  margin-top: 32px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.network-section h2 { font-size: 1rem; border: none; padding: 0; margin-bottom: 12px; }
.network-links { display: flex; flex-wrap: wrap; gap: 8px; }
.network-links a {
  padding: 6px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.network-links a:hover { border-color: var(--accent); background: var(--accent-light); text-decoration: none; }

/* -- FOOTER -- */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 32px 0 20px;
  margin-top: 40px;
  font-size: 0.82rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.footer-section h4 { color: white; font-size: 0.9rem; margin-bottom: 10px; }
.footer-section a { color: rgba(255,255,255,0.6); display: block; padding: 3px 0; font-size: 0.8rem; }
.footer-section a:hover { color: white; text-decoration: none; }
.footer-bottom {
  text-align: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
}

/* -- BREADCRUMBS -- */
.breadcrumbs {
  padding: 10px 0;
  font-size: 0.8rem;
  color: var(--text-light);
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; color: var(--border-dark); }

/* -- CHART CONTAINER -- */
.chart-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
}
.chart-container canvas { width: 100% !important; height: 300px !important; }

/* -- RESPONSIVE -- */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: 1.7rem; }
  .calc-form { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-nav { gap: 2px; }
  .header-nav a { padding: 6px 8px; font-size: 0.78rem; }
  .result-highlight .result-big { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .header-nav a:nth-child(n+4) { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
}
