/* StateCalcUSA shared stylesheet v2 — colourful modern design.
   Self-hosted Inter variable font. No external requests. All v1 class
   names are preserved so existing pages keep working. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --violet: #7c3aed;
  --violet-dark: #5b21b6;
  --violet-deep: #4c1d95;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --ink: #221d33;
  --text: #3f3f52;
  --muted: #6b7280;
  --border: #e5e1f2;
  --border-strong: #c9c4de;
  --bg-soft: #f5f3ff;
  --bg-blue: #eff6ff;
  --warn-bg: #fff8e6;
  --warn-border: #e6c87a;
  --ok-bg: #e6f4ea;
  --ok-text: #1e6b34;
  --err-bg: #fdecea;
  --err-border: #d66;
  --err-text: #7a1f1f;
  --grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 55%, #06b6d4 100%);
  --shadow-sm: 0 1px 3px rgba(34, 29, 51, 0.08);
  --shadow-md: 0 8px 24px rgba(76, 29, 149, 0.12);
  --shadow-lg: 0 16px 40px rgba(76, 29, 149, 0.18);
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}
::selection { background: var(--violet); color: #fff; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; }
h1 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 1rem; font-weight: 800; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 2rem 0 0.75rem; font-weight: 700; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 1.5rem 0 0.5rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--violet-dark); }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
main { padding: 1.5rem 0 2.5rem; }
main > section { margin-bottom: 2rem; }

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1rem; }

/* Header — sticky, white, colourful brand */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.7rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.brand-word { color: var(--ink); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-word em { font-style: normal; color: var(--violet); }
.brand:hover .brand-word { color: var(--violet-deep); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; margin-left: auto; }
.site-header nav a { color: var(--text); text-decoration: none; font-size: 0.95rem; font-weight: 600; padding: 0.35rem 0; }
.site-header nav a:hover { color: var(--violet); }
.nav-cta {
  background: var(--grad);
  color: #fff !important;
  border-radius: 999px;
  padding: 0.45rem 1.1rem !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.nav-cta:hover { color: #fff !important; filter: brightness(1.08); }

/* Footer — deep violet with a gradient top bar */
.site-footer {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #06b6d4) top / 100% 4px no-repeat, #17132b;
  color: #c9d6e4;
  padding: 2rem 0 2.25rem;
  margin-top: 2.5rem;
}
.site-footer a { color: #dbe6f2; }
.site-footer a:hover { color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0.75rem 0; }
.site-footer p { margin: 0 0 0.5rem; }
.site-footer strong { color: #fff; }
.footer-mark { width: 24px; height: 24px; border-radius: 6px; vertical-align: -5px; margin-right: 0.45rem; }
.fineprint { font-size: 0.85rem; color: #9fb0c3; }

/* Hero — homepage only, full-bleed gradient */
.hero {
  position: relative;
  overflow: hidden;
  margin: -1.5rem calc(50% - 50vw) 2rem;
  padding: 3.75rem max(1rem, calc(50vw - 29rem)) 3.25rem;
  background: var(--grad);
  color: #fff;
  border-radius: 0 0 2rem 2rem;
  text-align: left;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.hero::before { width: 340px; height: 340px; right: -110px; top: -150px; }
.hero::after { width: 220px; height: 220px; right: 16%; bottom: -140px; background: rgba(255, 255, 255, 0.08); }
.hero > * { position: relative; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin: 0 0 1rem;
}
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3rem); max-width: 46rem; }
.hero-lead { font-size: 1.15rem; line-height: 1.55; color: rgba(255, 255, 255, 0.92); max-width: 44rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0; }
.hero-badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }
.btn-hero { background: #fff !important; color: var(--violet-deep) !important; border-color: #fff !important; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22); }
.btn-hero:hover { color: var(--violet-deep) !important; filter: brightness(1); transform: translateY(-1px); }
.btn-hero-ghost { background: transparent !important; color: #fff !important; border: 2px solid rgba(255, 255, 255, 0.85) !important; box-shadow: none !important; }
.btn-hero-ghost:hover { color: #fff !important; background: rgba(255, 255, 255, 0.12) !important; }

/* Cards and grids */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; margin: 1rem 0; }
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--card-accent, transparent);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #ddd6fe; }
.card h3 { margin-top: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--violet); text-decoration: underline; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: 1rem;
  background: var(--chip-bg, var(--bg-soft));
  color: var(--chip-color, var(--violet));
}
.card-icon svg { width: 28px; height: 28px; }
.accent-violet { --card-accent: #7c3aed; --chip-bg: #f3e8ff; --chip-color: #7c3aed; }
.accent-blue { --card-accent: #2563eb; --chip-bg: #dbeafe; --chip-color: #2563eb; }
.accent-teal { --card-accent: #0d9488; --chip-bg: #ccfbf1; --chip-color: #0d9488; }
.accent-amber { --card-accent: #f59e0b; --chip-bg: #fef3c7; --chip-color: #d97706; }
.accent-rose { --card-accent: #e11d48; --chip-bg: #ffe4e6; --chip-color: #e11d48; }
.accent-sky { --card-accent: #0284c7; --chip-bg: #e0f2fe; --chip-color: #0284c7; }
.accent-green { --card-accent: #16a34a; --chip-bg: #dcfce7; --chip-color: #16a34a; }
.accent-pink { --card-accent: #db2777; --chip-bg: #fce7f3; --chip-color: #db2777; }

/* Tinted panel (homepage verify section) */
.panel-tint {
  background: linear-gradient(180deg, #f5f3ff, #eff6ff);
  border: 1px solid #e9e5f7;
  border-radius: 20px;
  padding: 1.75rem;
}
.panel-tint h2 { margin-top: 0; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--violet);
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field-hint { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }

.btn {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { color: #fff; filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124, 58, 237, 0.35); }

/* Results and answers */
.result {
  border: 1px solid #ddd6fe;
  border-left: 5px solid var(--violet);
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}
.result-amount { font-size: 2rem; font-weight: 800; color: var(--violet-deep); line-height: 1.2; letter-spacing: -0.02em; }
.answer-box { background: var(--bg-blue); border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.25rem 0; }
.answer-box p:last-child { margin-bottom: 0; }
.disclaimer { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 12px; padding: 0.9rem 1.1rem; margin: 1.25rem 0; font-size: 0.95rem; }
.disclaimer p:last-child { margin-bottom: 0; }
.alert { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text); border-radius: 12px; padding: 0.9rem 1.1rem; margin: 1rem 0; }
.alert p:last-child { margin-bottom: 0; }

/* FAQ */
.faq > div { border-bottom: 1px solid var(--border); padding: 0.25rem 0 1rem; }
.faq h3 { margin-bottom: 0.35rem; }
.faq p:last-child { margin-bottom: 0; }

/* Tables: wrap a <table> in .data-table for horizontal scroll on small screens */
.data-table { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 12px; }
.data-table table, table.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td, table.data-table th, table.data-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.data-table th, table.data-table th { background: var(--bg-soft); color: var(--violet-deep); }
.data-table caption, table.data-table caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; color: var(--ink); }

/* Sources and verification */
.sources { background: #f8f7ff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; font-size: 0.95rem; }
.sources h2, .sources h3 { margin-top: 0; }
.sources ul { margin: 0; padding-left: 1.25rem; }
.sources li { margin-bottom: 0.4rem; }
.verified-stamp {
  display: inline-block;
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid #a9d6b4;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

/* Lists */
.tool-list { list-style: none; margin: 1rem 0; padding: 0; }
.tool-list li { border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
.tool-list li:last-child { border-bottom: 0; }
.tool-list a { font-weight: 600; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Generated letters and checklists */
.letter-output { border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; padding: 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
pre.letter {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  background: #fbfbfb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.checklist { list-style: none; margin: 1rem 0; padding: 0; }
.checklist li { padding: 0.6rem 0 0.6rem 2rem; border-bottom: 1px solid var(--border); position: relative; }
.checklist li:last-child { border-bottom: 0; }
.checklist input[type="checkbox"] { position: absolute; left: 0; top: 0.85rem; width: 1.1rem; height: 1.1rem; accent-color: var(--violet); }

/* Wider screens */
@media (min-width: 37.5rem) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2.4rem; }
}
@media (min-width: 56rem) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}

/* Print: show letter output cleanly, hide site chrome */
@media print {
  .site-header, .site-footer, nav, .btn, .hero-ctas { display: none !important; }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  main { padding: 0; }
  a { color: #000; text-decoration: none; }
  .hero { background: #fff; color: #000; margin: 0; padding: 0; border-radius: 0; }
  .hero h1, .hero-lead { color: #000; }
  .hero-badge { border-color: #999; color: #000; background: #fff; }
  .hero::before, .hero::after { display: none; }
  .letter-output, pre.letter { border: 0; padding: 0; background: #fff; box-shadow: none; }
  .card, .answer-box, .result, .disclaimer, .sources { border: 1px solid #999; box-shadow: none; }
  h1, h2, h3 { color: #000; }
}
