/* StateCalcUSA shared stylesheet. System fonts only. No external requests. */
:root {
  --navy: #122a44;
  --navy-dark: #0d1f33;
  --accent: #1466b8;
  --accent-dark: #0f4f8f;
  --text: #1c2733;
  --muted: #5a6b7d;
  --border: #d9e1ea;
  --light: #f2f7fb;
  --warn-bg: #fff8e6;
  --warn-border: #e6c87a;
  --ok-bg: #e6f4ea;
  --ok-text: #1e6b34;
  --err-bg: #fdecea;
  --err-border: #d66;
  --err-text: #7a1f1f;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 1rem; color: var(--navy); }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 2rem 0 0.75rem; color: var(--navy); }
h3 { font-size: 1.15rem; line-height: 1.35; margin: 1.5rem 0 0.5rem; color: var(--navy); }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main { padding: 1.5rem 0 2.5rem; }
main > section { margin-bottom: 2rem; }

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

/* Header */
.site-header { background: var(--navy); color: #fff; padding: 0.9rem 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.brand { color: #fff; font-size: 1.4rem; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand:hover, .brand:focus-visible { color: #fff; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a { color: #dbe6f2; text-decoration: none; font-size: 0.95rem; padding: 0.25rem 0; }
.site-header nav a:hover { color: #fff; text-decoration: underline; }

/* Footer */
.site-footer { background: var(--navy-dark); color: #c9d6e4; padding: 1.75rem 0 2rem; margin-top: 2rem; }
.site-footer a { color: #dbe6f2; }
.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; }
.fineprint { font-size: 0.85rem; color: #9fb0c3; }

/* Cards and grids */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; background: #fff; box-shadow: 0 1px 3px rgba(18, 42, 68, 0.08); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
  border: 1px solid #9aa9ba;
  border-radius: 6px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 3px solid rgba(20, 102, 184, 0.35); outline-offset: 0; }
.field textarea { min-height: 7rem; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* Results and answers */
.result { border-left: 4px solid var(--accent); background: var(--light); border-radius: 0 6px 6px 0; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.result-amount { font-size: 1.75rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.answer-box { background: var(--light); border: 1px solid #c9d9ea; border-radius: 8px; padding: 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: 8px; 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: 8px; 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; }
.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(--light); color: var(--navy); }
.data-table caption, table.data-table caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; color: var(--navy); }

/* Sources and verification */
.sources { background: #f7f8fa; border: 1px solid var(--border); border-radius: 8px; 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 #9aa9ba; border-radius: 8px; background: #fff; padding: 1.25rem; margin: 1.25rem 0; }
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: 8px;
  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; }

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

/* Print: show letter output cleanly, hide site chrome */
@media print {
  .site-header, .site-footer, nav, .btn { 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; }
  .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; }
}
