/* FedGovPay USA website styles
   Layout: a federal-forms ledger. Navy masthead, form-style field labels, red rules as dividers.
   Brand colors and fonts are set once in :root below; change them there. */

:root {
  --navy: #041F46;
  --red: #ED002B;
  --bg: #FFFFFF;
  --paper: #F4F6FA;
  --ink: #16202E;
  --muted: #586374;
  --line: #D6DDE7;
  --card: #FFFFFF;
  --accent-ink: #041F46;   /* navy text on light surfaces */
  --accent-red: #C8002A;   /* red for text on light surfaces (meets contrast) */
  --rule: #041F46;         /* accent rules on cards and totals */
  --tick: #041F46;         /* check-mark circles in the who-does-what table */
  --chip: #E9EEF6;
  --hero-bg: #041F46;
  --hero-ink: #FFFFFF;
  --hero-muted: #C7D2E4;
  --focus: #ED002B;
  --shadow: rgba(4, 31, 70, 0.14);
  --display: "Gelasio", Georgia, "Times New Roman", serif;
  --body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-3: 2rem;
  --step-4: clamp(2.1rem, 4.2vw, 3.1rem);
  --radius: 6px;
  --wrap: 1120px;
}

/* Dark mode follows the visitor's device setting */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07111F;
    --paper: #0C1A2E;
    --ink: #E7ECF4;
    --muted: #A3AFC2;
    --line: #22344F;
    --card: #0F1F37;
    --accent-ink: #DCE5F3;
    --accent-red: #FF4D6A;
    --rule: #FF4D6A;
    --tick: #2F5590;
    --chip: #15294A;
    --focus: #FF4D6A;
    --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px;
}
main [id] { scroll-margin-top: 84px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 4px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 10px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }
.label {
  font-family: var(--body); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-red); margin: 0;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--display); color: var(--accent-ink); line-height: 1.15; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
.lede { color: var(--muted); max-width: 62ch; }
.nowrap { white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; display: block; height: 3px; background: var(--red); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 44px; width: auto; }
.brand .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand .on-light { display: none; }
  .brand .on-dark { display: block; }
}
nav.primary { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
nav.primary a { text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--ink); padding-block: 4px; border-bottom: 2px solid transparent; }
nav.primary a:hover { border-bottom-color: var(--red); }
.callpill {
  font-family: var(--mono); font-weight: 500; font-size: 0.9rem; white-space: nowrap;
  color: #fff; background: var(--navy); border-radius: 999px; padding: 6px 14px; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.callpill:hover { background: #0B2D5E; }
.callpill .short { display: none; }
.menu-btn {
  display: none; align-items: center; gap: 8px; cursor: pointer;
  font: 600 0.9rem var(--body); color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.menu-btn .bars { display: inline-grid; gap: 3px; }
.menu-btn .bars i { display: block; width: 14px; height: 2px; background: currentColor; border-radius: 1px; }
@media (max-width: 860px) {
  .topbar .wrap { gap: 10px; }
  .brand { margin-right: auto; }
  .menu-btn { display: inline-flex; }
  nav.primary {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 4px 16px 10px; box-shadow: 0 14px 24px var(--shadow);
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  nav.primary a:last-child { border-bottom: 0; }
  nav.primary a:hover { border-bottom-color: var(--line); color: var(--accent-red); }
}
@media (max-width: 420px) {
  .callpill .long { display: none; }
  .callpill .short { display: inline; }
}

/* ---------- hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-ink); position: relative; overflow: hidden; }
.hero::before {
  /* flag-stripe edge: a quiet nod to the flag without repeating it */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--red) 0 48px, #fff 48px 96px);
  opacity: 0.9;
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 56px 60px; }
.hero h1 { color: var(--hero-ink); font-size: var(--step-4); margin-top: 12px; }
.hero h1 em { font-style: italic; color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.hero .label { color: #FF6B82; }
.hero p.sub { color: var(--hero-muted); font-size: 1.08rem; max-width: 52ch; margin-top: 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.98rem;
  padding: 12px 20px; border-radius: var(--radius); border: 2px solid transparent; text-decoration: none; cursor: pointer;
  font-family: var(--body);
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #C8002A; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; background: transparent; }
.btn-ghost:hover { border-color: #fff; }
.phone-line { margin-top: 18px; color: var(--hero-muted); font-size: 0.92rem; }
.phone-line a { color: #fff; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.45); margin-left: 6px; }
.phone-line a:hover { border-bottom-color: #fff; }
.hero figure { margin: 0; }
.hero figure img { border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.18); }
.hero figcaption { color: var(--hero-muted); font-size: 0.8rem; margin-top: 10px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; padding-block: 40px 44px; } }

/* ---------- regulation strip ---------- */
.regs { background: var(--paper); border-bottom: 1px solid var(--line); }
.regs .wrap { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding-block: 18px; }
.regs .label { color: var(--muted); margin-right: 6px; }
.chip { font-family: var(--mono); font-size: 0.8rem; background: var(--chip); color: var(--accent-ink); border-radius: 4px; padding: 4px 9px; white-space: nowrap; }

/* ---------- sections ---------- */
section.block { padding-block: 72px; }
section.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 32px; }
.section-head h2 { position: relative; padding-bottom: 14px; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 3px; background: var(--red); }

/* services */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.svc { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--rule); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; align-content: start; }
.svc .form-no { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.svc ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink); }
.svc li::marker { color: var(--accent-red); }
@media (max-width: 900px) { .services { grid-template-columns: 1fr; } }
.also { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.also .label { color: var(--muted); }

/* process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: step; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.steps li { counter-increment: step; padding: 22px 20px; display: grid; gap: 8px; align-content: start; border-left: 1px solid var(--line); }
.steps li:first-child { border-left: 0; }
.steps li::before { content: "Step " counter(step); font-family: var(--mono); font-size: 0.78rem; color: var(--accent-red); letter-spacing: 0.04em; }
.steps h3 { font-size: 1.05rem; }
.steps p { color: var(--muted); font-size: 0.93rem; }
@media (max-width: 980px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { border-left: 0; border-top: 1px solid var(--line); }
  .steps li:first-child { border-top: 0; }
}

/* responsibility table */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.matrix { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 0.95rem; }
.matrix th, .matrix td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.matrix thead th { background: var(--navy); color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.matrix tbody th { font-weight: 600; color: var(--ink); width: 34%; }
.matrix td { text-align: center; width: 22%; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.tick { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tick); color: #fff; font-weight: 700; font-size: 0.85rem; }
.tick.red { background: var(--red); }
.dash { color: var(--muted); }
.cond { font-size: 0.8rem; font-weight: 600; color: var(--accent-ink); background: var(--chip); border-radius: 4px; padding: 3px 8px; white-space: nowrap; }
.note { font-size: 0.86rem; color: var(--muted); margin-top: 12px; }
@media (max-width: 640px) {
  table.matrix { min-width: 0; display: block; }
  .matrix thead { display: none; }
  .matrix tbody, .matrix tr, .matrix tbody th, .matrix td { display: block; width: auto; }
  .matrix tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .matrix tr:last-child { border-bottom: 0; }
  .matrix tbody th { padding: 0 0 8px; border-bottom: 0; }
  .matrix td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 0; text-align: left; }
  .matrix td::before { content: attr(data-label); color: var(--muted); font-size: 0.88rem; }
}

/* forms (estimator and contact) */
.est { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .est { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 480px) { .fields { grid-template-columns: 1fr; } }
.field { display: grid; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  font: 500 1rem var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 9px 10px; width: 100%;
}
.field select, .field textarea, .field input[type="text"], .field input[type="tel"], .field input[type="email"] { font-family: var(--body); }
.field textarea { min-height: 110px; resize: vertical; }
.fieldset-title { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; color: var(--accent-ink); font-size: 1.05rem; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.fieldset-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* estimator results */
.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ledger td { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ledger td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.ledger .sub td { color: var(--muted); font-size: 0.88rem; }
.ledger .total td { border-bottom: 0; border-top: 2px solid var(--rule); font-weight: 700; padding-top: 12px; }
.ledger .perdiem td:first-child { border-left: 3px solid var(--red); padding-left: 10px; }
.kpi { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.kpi div { display: grid; }
.kpi span { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kpi strong { font-family: var(--mono); font-size: 1.35rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.flag-note { margin-top: 14px; font-size: 0.86rem; color: var(--muted); border-left: 3px solid var(--red); padding-left: 10px; }

/* questions */
.faq { display: grid; gap: 10px; max-width: 860px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--mono); color: var(--accent-red); font-size: 1.2rem; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: 16px; color: var(--muted); max-width: 70ch; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.card-addr { background: var(--hero-bg); color: #fff; border-radius: var(--radius); padding: 26px; display: grid; gap: 14px; }
.card-addr .label { color: #FF6B82; }
.card-addr .big { font-family: var(--mono); font-size: 1.5rem; color: #fff; text-decoration: none; justify-self: start; border-bottom: 1px solid rgba(255, 255, 255, 0.35); }
.card-addr .big:hover { border-bottom-color: #fff; }
.card-addr address { font-style: normal; color: var(--hero-muted); line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.form-actions .note { margin: 0; }
.form-msg { margin-top: 12px; font-size: 0.92rem; color: var(--ink); background: var(--chip); border-radius: 4px; padding: 10px 12px; border-left: 3px solid var(--rule); }
.form-msg.err { border-left-color: var(--red); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* footer */
footer.site { background: var(--navy); color: #C7D2E4; }
footer.site::before { content: ""; display: block; height: 4px; background: var(--red); }
footer.site .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; padding-block: 36px; align-items: start; }
@media (max-width: 760px) { footer.site .wrap { grid-template-columns: 1fr; } }
footer.site img { width: 220px; }
footer.site p { font-size: 0.86rem; line-height: 1.55; }
footer.site p + p { margin-top: 10px; }
footer.site strong { color: #fff; }
footer.site a { color: #fff; text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site .disclaimer { color: #9FB0CB; }
