/* AutoTaxFiling: light, premium. Warm paper, forest ink, one gold accent. Fonts are self-hosted. */
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(fonts/hanken-grotesk.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #faf7f0; --paper-deep: #f3eee2; --surface: #fff;
  --ink: #1b2620; --ink-soft: #55625a; --line: #e8e2d3; --line-strong: #cfc7b2;
  --forest: #1f4d3f; --forest-deep: #143a2e; --forest-tint: #eaf2ed;
  --gold: #b3843a; --gold-text: #7a5217; --gold-soft: #f6ecd6;
  --err: #a3200f; --err-bg: #fdf0ec;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-sm: 0 1px 2px rgba(43, 38, 32, .05), 0 6px 16px -8px rgba(43, 38, 32, .10);
  --shadow-md: 0 1px 2px rgba(43, 38, 32, .05), 0 18px 36px -18px rgba(43, 38, 32, .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 10rem; font-size: 100%; -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--paper); }
::selection { background: var(--gold-soft); color: var(--forest-deep); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.6 var(--sans); accent-color: var(--forest); caret-color: var(--forest); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 30; border-radius: 8px; }

/* Header + test-mode banner */
/* The header (and the test banner, when shown) stay put while the page body scrolls underneath. */
.sticky-head { position: sticky; top: 0; z-index: 20; }
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.banner .short { display: none; }
.top .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 3.5rem; }
.top nav { display: flex; align-items: center; gap: 1.25rem; }
.brand { font: 500 1.5rem/1 var(--serif); letter-spacing: -.015em; color: var(--forest); text-decoration: none; }
.brand::after { content: ""; display: inline-block; width: .42em; height: .42em; margin-left: .18em; border-radius: 50%; background: var(--gold); vertical-align: .05em; }
.top nav a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1.1rem; color: var(--forest); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover { color: var(--forest-deep); border-color: var(--forest); background: var(--forest-tint); }
.banner { background: var(--gold-soft); color: var(--gold-text); font-size: .9rem; line-height: 1.35; padding: .4rem 0; border-bottom: 1px solid #ecdcb6; text-align: center; }

main.wrap { padding-top: 2.5rem; padding-bottom: 3.5rem; animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main.wrap { animation: none; } * { transition: none !important; } }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--forest-deep); text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); line-height: 1.12; letter-spacing: -.022em; margin: .25rem 0 1rem; }
h2 { font-size: clamp(1.45rem, 4vw, 1.75rem); font-weight: 600; line-height: 1.2; letter-spacing: -.012em; margin: 2.75rem 0 1rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
h2:first-child, .card h2, section:first-of-type > h2:first-child { border-top: 0; padding-top: 0; }
h3 { font-size: 1.25rem; margin: 0 0 .25rem; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 2rem; max-width: 36rem; text-wrap: pretty; }
a { color: var(--forest); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--forest-deep); text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
p { margin: 0 0 1rem; }

/* Progress */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; list-style: none; padding: 0; margin: 0 0 2.5rem; counter-reset: s; font-size: .82rem; }
.steps li { counter-increment: s; position: relative; padding-top: .75rem; color: var(--ink-soft); min-width: 0; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--line); border-radius: 2px; }
.steps li.done::before { background: var(--forest); }
.steps li.on::before { background: var(--gold); height: 3px; top: -.5px; }
.steps li.on { color: var(--forest-deep); font-weight: 700; }
.steps a { color: inherit; text-decoration: none; }
.steps a:hover { text-decoration: underline; text-decoration-color: var(--gold); }

/* Forms */
.field { margin: 0 0 1.5rem; border: 0; padding: 0; min-width: 0; }
.field label, legend { display: block; font-weight: 600; font-size: 1rem; margin-bottom: .15rem; padding: 0; color: var(--ink); }
.hint { color: var(--ink-soft); font-size: .93rem; line-height: 1.45; margin: 0 0 .5rem; }
input[type=text], input[type=date], select {
  width: 100%; font: inherit; padding: .8rem 1rem; min-height: 3.25rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
input:hover, select:hover { border-color: #b5ab90; }
input:focus, select:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(31, 77, 63, .14); }
.money { display: flex; align-items: stretch; }
.money span { display: flex; align-items: center; padding: 0 1rem; border: 1px solid var(--line-strong); border-right: 0; border-radius: 12px 0 0 12px; background: var(--paper-deep); color: var(--ink-soft); font-family: var(--serif); font-size: 1.15rem; }
.money input { border-radius: 0 12px 12px 0; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.field label.choice, .choice { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 1.05rem 1.15rem; margin: .6rem 0; font-weight: 400; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .2s, background .2s, box-shadow .2s; }
.choice:hover { border-color: var(--forest); }
.choice:has(input:checked) { border-color: var(--forest); background: var(--forest-tint); box-shadow: 0 0 0 3px rgba(31, 77, 63, .10); }
.choice input { width: 1.3rem; height: 1.3rem; margin-top: .25rem; flex: none; }
.field label.choice { font-weight: 400; }
.choice small { color: var(--ink-soft); font-size: .92rem; }
.field.has-error input { border-color: var(--err); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: .6rem 1.9rem; border: 1px solid var(--forest); border-radius: 999px; background: var(--forest); color: #fff; font: 600 1rem var(--sans); letter-spacing: .005em; text-decoration: none; cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 18px -10px rgba(20, 58, 46, .7); transition: transform .25s var(--ease), background .2s, box-shadow .25s; }
.btn:hover { background: var(--forest-deep); color: #fff; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 14px 24px -12px rgba(20, 58, 46, .75); }
.btn:active { transform: none; }
.btn.ghost { background: var(--surface); color: var(--forest); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: var(--forest); background: var(--surface); color: var(--forest-deep); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; margin-top: 2rem; }
.actions .btn:only-child { margin-left: auto; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--forest); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
form.inline { display: inline; }

/* Messages */
.alert { border: 1px solid #efc3b8; background: var(--err-bg); color: #6f1a0e; border-radius: 14px; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.alert strong { color: var(--err); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert.soft { border-color: #ecdcb6; background: var(--gold-soft); color: var(--gold-text); }
.alert.soft strong { color: var(--gold-text); }
.note { color: var(--ink-soft); font-size: .93rem; }
.ok { color: var(--forest); font-weight: 700; }

/* Cards, statements, results */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem 1.6rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
.card h2, .card h3 { margin-top: 0; }
.card.total { padding: 1.9rem 1.6rem 1.6rem; border-color: #d7cfb8; box-shadow: var(--shadow-md); background: linear-gradient(180deg, #fff 0%, #fdfaf2 100%); }
.card.total h2 { font-size: 1.2rem; font-weight: 500; color: var(--ink-soft); margin: 0 0 .5rem; }
.big { font: 500 clamp(2.9rem, 10vw, 4.2rem)/1 var(--serif); letter-spacing: -.025em; color: var(--forest-deep); margin: .1rem 0 .85rem; font-variant-numeric: lining-nums tabular-nums; }
.stmt { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.stmt th, .stmt td { padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.stmt tr:last-child th, .stmt tr:last-child td { border-bottom: 0; }
.stmt td { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.stmt tr.sub th, .stmt tr.sub td { font-weight: 600; background: #fcfaf5; }
.stmt tr.total th, .stmt tr.total td { font: 500 1.1rem var(--serif); color: var(--forest-deep); background: var(--gold-soft); border-top: 1px solid #e3d3a8; border-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list small, .small { color: var(--ink-soft); }
.status { font-weight: 700; color: var(--forest); }
.foot.wrap { color: var(--ink-soft); font-size: .88rem; padding-top: 1.75rem; padding-bottom: 2.5rem; text-align: left; }
.foot::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: 1.5rem; }

@media (min-width: 40rem) {
  .row { grid-template-columns: 1fr 1fr; }
  .steps { font-size: .9rem; }
  .card { padding: 1.75rem 2rem; }
  .stmt th, .stmt td { padding: .8rem 1.4rem; }
}

/* Small screens: a one-line banner so the sticky header does not eat the page. */
@media (max-width: 36rem) {
  .banner .full { display: none; }
  .banner .short { display: inline; }
  .top .wrap { min-height: 3.25rem; }
  html { scroll-padding-top: 9.5rem; }
}

/* Company & period variants: choice cards, locked company summary, step footer. Mobile first. */
.cards { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.field label.card-choice, .card-choice { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; margin: 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; min-height: 3.5rem; }
.field label.card-choice:hover, .card-choice:hover { border-color: var(--forest); }
.card-choice:has(input:checked) { border-color: var(--forest); background: var(--forest-tint); }
.card-choice input { margin-top: .3rem; flex: none; width: 1.1rem; height: 1.1rem; }
.card-choice span { min-width: 0; }
.card-choice strong { display: block; color: var(--forest-deep); }
.card-choice small { display: block; color: var(--ink-soft); font-size: .93rem; line-height: 1.4; margin-top: .15rem; }
.locked { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; padding: .9rem 1.1rem; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 .5rem; }
.locked small { display: block; color: var(--ink-soft); font-size: .8rem; }
.locked strong { overflow-wrap: anywhere; }
.locked a { margin-left: auto; }
input.is-locked, input[readonly] { background: var(--paper-deep); color: var(--ink-soft); }
select { width: 100%; font: inherit; padding: .8rem 1rem; min-height: 3.25rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); }
.note { color: var(--ink-soft); font-size: .93rem; margin: .5rem 0 0; }
details { margin-top: .75rem; } details summary { cursor: pointer; color: var(--forest); min-height: 2.5rem; display: flex; align-items: center; }
.lookup-status { min-height: 1.4em; margin: -.25rem 0 .75rem; color: var(--forest-deep); }
.step-foot { display: flex; flex-direction: column-reverse; gap: .75rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.step-foot > p { margin: 0; }
.step-foot .actions { display: flex; gap: .75rem; }
.step-foot .actions .btn { flex: 1; text-align: center; }
@media (min-width: 36rem) {
  .cards { grid-template-columns: 1fr 1fr; }
  .step-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .step-foot .actions { flex: none; } .step-foot .actions .btn { flex: none; min-width: 7rem; }
}

/* Step pages: the progress bar and the page title join the fixed strip; only the form below scrolls. */
.subhead { background: var(--paper); border-bottom: 1px solid var(--line); }
.subhead .steps { margin: 0; font-size: .78rem; gap: .35rem; }
.subhead .steps li { padding-top: .6rem; }
.subhead h1 { font-size: 1.3rem; line-height: 1.15; margin: .4rem 0 .55rem; letter-spacing: -.012em; overflow-wrap: anywhere; }
main.has-subhead { padding-top: 1.25rem; }

/* Disabled choice cards (options we do not support yet) and a three-across layout for the screening questions. */
.card-choice.is-disabled { opacity: .55; cursor: not-allowed; background: var(--paper-deep); }
.card-choice.is-disabled:hover { border-color: var(--line-strong); }
@media (min-width: 36rem) { .cards.three { grid-template-columns: repeat(3, 1fr); } }

/* Company name in the fixed title row, in blue, once we know it. */
:root { --blue: #1d5fb8; }
.titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; min-width: 0; }
.titlerow h1 { flex: none; max-width: 60%; }
.co-tag { color: var(--blue); font-weight: 700; font-size: .95rem; letter-spacing: .01em; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-tag[hidden] { display: none; }

/* Help: a small "?" beside a field opens a plain-English popup (native popover). */
.label-row { display: flex; align-items: center; gap: .45rem; }
.label-row label { margin-bottom: 0; }
legend .help { margin-left: .35rem; vertical-align: middle; }
.help { flex: none; position: relative; width: 1.5rem; height: 1.5rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--blue); border-radius: 50%; background: var(--surface); color: var(--blue); font: 700 .85rem/1 var(--sans); cursor: pointer; }
.help::after { content: ""; position: absolute; inset: -.55rem; }
.help:hover, .help:focus-visible { background: var(--blue); color: #fff; }
.help-pop { margin: auto; width: min(26rem, calc(100vw - 2rem)); max-height: 80vh; overflow: auto; padding: 1.25rem 1.4rem; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); }
.help-pop::backdrop { background: rgba(20, 38, 30, .45); }
.help-pop h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.help-pop p { margin: .45rem 0; font-size: 1rem; line-height: 1.5; }
.help-pop .btn { margin-top: .9rem; }
@media (max-width: 36rem) {
  .help-pop { inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
}
/* Browsers without native popovers: hide the buttons (the hints under each label stay). */
@supports not selector(:popover-open) { .help, .help-pop { display: none; } }

.help-pop .help-note { font-size: .85rem; color: var(--ink-soft); margin-top: .7rem; }

/* Progress bar: every reachable step is a link; a green tick marks a finished step, a red mark the current step if unfinished. */
.steps li a { display: block; padding: .1rem 0 .35rem; }
.steps li.go a:hover { text-decoration: underline; }
.steps .mark { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; margin-left: .3rem; border-radius: 50%; font-size: .68rem; font-weight: 700; line-height: 1; vertical-align: middle; }
.steps .mark.ok { background: #2b8a57; color: #fff; }
.steps .mark.todo { background: var(--err-bg); color: var(--err); border: 1.5px solid var(--err); }

.help-pop strong { font-weight: 700; color: var(--forest-deep); }

/* Check step: the list of fields left empty. */
.blank-group h2 { font-size: clamp(1.4rem, 3.8vw, 1.65rem); font-weight: 600; margin: 1.75rem 0 .5rem; padding-top: 0; border-top: 0; }
.blank-group h2 small { font-size: .8rem; color: var(--ink-soft); font-weight: 400; }
.blank-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.blank-list li { padding: .1rem 0; }
.blank-list a { display: inline-flex; align-items: center; min-height: 2.5rem; color: var(--forest); text-decoration: underline; text-underline-offset: .2em; }

.blank-list li { display: flex; align-items: center; gap: .5rem; }
.lede .help { vertical-align: middle; margin-left: .25rem; }

/* Live balance strip on the Figures page: sticks to the bottom of the screen while typing. */
.balance-strip { position: sticky; bottom: .75rem; z-index: 5; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center; gap: .35rem .75rem; margin: 1.25rem 0 0; padding: .7rem 1rem; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper-deep); box-shadow: var(--shadow-md); }
.balance-strip[hidden] { display: none; }
.balance-strip small { display: block; color: var(--ink-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.balance-strip strong { font-variant-numeric: tabular-nums; font-size: 1.02rem; overflow-wrap: anywhere; }
.balance-strip .status { display: flex; align-items: center; gap: .4rem; font-weight: 700; white-space: nowrap; }
.balance-strip .status .icon { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-size: 1rem; line-height: 1; color: #fff; }
.balance-strip.ok .status .icon { background: #2b8a57; }
.balance-strip.off .status .icon { background: var(--err); }
.balance-strip .status .out { font-size: .85rem; }
.balance-strip.ok { background: var(--forest-tint); border-color: var(--forest); }
.balance-strip.ok .status { color: var(--forest-deep); }
.balance-strip.off { background: var(--err-bg); border-color: var(--err); }
.balance-strip.off .status { color: var(--err); }


.help-pop .help-unsure { margin-top: .8rem; padding: .6rem .8rem; border-radius: 10px; background: var(--paper-deep); font-size: .95rem; }
.help-pop .help-eg { font-style: italic; color: var(--ink-soft); font-size: .92rem; }

/* A figure the customer must type: "Required" shows in red inside the empty field and disappears as soon as they type. */
input.is-required::placeholder { color: var(--err); opacity: .85; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; text-align: right; }
input.is-required:placeholder-shown { border-color: #efc2b8; background: #fffafa; }

/* "Some of these figures are estimates": the explanation opens only when ticked. */
.estimates .check { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.estimates .estimates-more { display: none; margin-top: .5rem; }
.estimates:has(input[name="estimated"]:checked) .estimates-more { display: block; }
.estimates textarea { width: 100%; box-sizing: border-box; }
