/* DaaS-1: forest, gold, parchment. Playfair Display over Raleway. A ledger on good paper. */
:root {
  --forest: #1c2e27; --forest-2: #24382f; --sage: #4a5d56;
  --gold-1: #e7c977; --gold-2: #c9a24b; --gold-3: #9a6b28; --gold-ink: #7d5820; --gold-wash: #f3e7c6;
  --parch: #f4efe4; --paper: #fbf8f1; --rule: #ddd4bf; --line: #c5baa0;
  --body: #3f4d47; --mut: #5a665f; --err: #8a2a1c; --err-bg: #f6e3dc; --ok: #2c5a41; --ok-bg: #e4eee4;
  --display: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --text: "Raleway", "Segoe UI", system-ui, sans-serif;
  --gap: clamp(1rem, 3vw, 2.5rem);
  --lift: 0 18px 40px -28px rgba(28, 46, 39, 0.45);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--gold-2) var(--parch); }
body { margin: 0; background: var(--parch); color: var(--body); font: 500 1.0625rem/1.6 var(--text);
  font-variant-numeric: lining-nums; caret-color: var(--gold-3); }
::selection { background: var(--gold-1); color: var(--forest); }
:focus-visible { outline: 2px solid var(--gold-3); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, legend { font-family: var(--display); color: var(--forest); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.2; font-weight: 700; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
a { color: var(--gold-ink); text-underline-offset: 0.2em; }

/* ---------- frame ---------- */
.band { background: var(--forest); color: var(--parch); display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem var(--gap); border-bottom: 3px solid var(--gold-2); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--parch); text-decoration: none;
  font: 700 1.5rem/1 var(--display); letter-spacing: -0.01em; }
.brand b { color: var(--gold-1); font-weight: 700; }
.band-note { font-size: 0.9rem; font-weight: 600; color: #d9d2c0; letter-spacing: 0.02em; }
main { max-width: 72rem; margin: 0 auto; padding: clamp(1.75rem, 5vw, 4rem) var(--gap) 4rem; display: grid;
  gap: clamp(2.5rem, 5vw, 4rem); }
main:has(> form.intake) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
main:has(> form.intake) .intro { position: sticky; top: 2rem; }
.intro { display: grid; gap: 1.25rem; align-content: start; }
.lede { font-size: 1.15rem; line-height: 1.55; max-width: 62ch; color: var(--sage); }
.foot { max-width: 72rem; margin: 0 auto; padding: 1.5rem var(--gap) 3rem; font-size: 0.9rem; color: var(--mut);
  border-top: 1px solid var(--rule); }
.job-note { background: #e4e4e1; color: #45484a; font: 500 0.85rem/1.45 var(--text); padding: 0.55rem 0.8rem; border-radius: 3px; }

/* ---------- step trail ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; counter-reset: step;
  font-size: 0.9rem; font-weight: 600; color: var(--mut); }
.steps li { counter-increment: step; display: inline-flex; align-items: center; gap: 0.5rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem;
  border-radius: 50%; border: 1.5px solid var(--line); font: 700 0.8rem/1 var(--text); color: var(--mut); background: var(--paper); }
.steps li + li::after { content: none; }
.steps [aria-current="step"] { color: var(--forest); }
.steps [aria-current="step"]::before { background: var(--forest); border-color: var(--forest); color: var(--gold-1); }
.steps .done { color: var(--gold-ink); }
.steps .done::before { display: none; }
.tick { flex: none; width: 1.65rem; height: 1.65rem; padding: 0.42rem; border-radius: 50%; border: 1.5px solid var(--gold-2);
  background: var(--gold-wash); fill: none; stroke: var(--gold-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- hero: sample pages fanned ---------- */
.fan { position: relative; margin: 0.75rem 0 0.25rem; aspect-ratio: 16 / 11.8; isolation: isolate; }
.fan img { position: absolute; width: 74%; height: auto; border-radius: 3px; background: var(--paper);
  box-shadow: 0 22px 40px -22px rgba(28, 46, 39, 0.55), 0 2px 5px rgba(28, 46, 39, 0.14);
  transition: transform 0.9s var(--ease); }
.fan img:nth-child(1) { right: 0; top: 0; transform: rotate(4deg); }
.fan img:nth-child(2) { left: 13%; top: 12%; transform: rotate(-1.5deg); }
.fan img:nth-child(3) { left: 0; top: 22%; transform: rotate(-5deg); }
.fan figcaption { position: absolute; left: 0; right: 0; bottom: -1.9rem; font-size: 0.82rem; color: var(--mut); font-weight: 600; }
@starting-style {
  .fan img:nth-child(1), .fan img:nth-child(2), .fan img:nth-child(3) { transform: rotate(0) translate(0, 6%); }
}
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule); }
.tiers h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.tiers ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; font-size: 0.97rem; }
.tiers li { padding-left: 1.3rem; position: relative; }
.tiers li::before { content: ""; position: absolute; left: 0.1rem; top: 0.72em; width: 0.6rem; height: 2px; background: var(--gold-2); }

/* ---------- forms ---------- */
.intake { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: var(--lift); display: grid; gap: 2.25rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 1.1rem; }
legend { font-size: 1.35rem; font-weight: 700; padding: 0 0 0.55rem; margin-bottom: 0.9rem; width: 100%;
  border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: 0.35rem; align-content: start; }
label { font-weight: 700; font-size: 0.95rem; color: var(--forest); }
.opt { font-weight: 500; color: var(--mut); font-size: 0.85rem; margin-left: 0.3rem; }
input, select, textarea { font: inherit; color: var(--forest); background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 0.6rem 0.75rem; width: 100%; min-height: 2.9rem; transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out; }
input::placeholder, textarea::placeholder { color: #6b746f; }
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--gold-3); }
input:focus, select:focus, textarea:focus { border-color: var(--gold-3); box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.22); outline: none; }
.hint { font-size: 0.9rem; line-height: 1.45; color: var(--mut); }
.err { font-size: 0.9rem; font-weight: 600; color: var(--err); }
.has-err input, .has-err textarea, [aria-invalid="true"] { border-color: var(--err); background: #fffaf8; }
.alert { background: var(--err-bg); color: var(--err); border: 1px solid #dfb5a8; border-radius: 4px; padding: 0.8rem 1rem; font-weight: 600; }

/* drop zones: the real file input, enlarged into the zone once the script runs */
.drop { position: relative; border: 1.5px dashed var(--line); border-radius: 6px; background: var(--parch);
  transition: border-color 0.18s ease-out, background-color 0.18s ease-out; }
.drop input[type="file"] { border: 0; background: transparent; min-height: 0; padding: 0.8rem; cursor: pointer; }
.drop input[type="file"]::file-selector-button { font: 600 0.9rem var(--text); color: var(--forest); background: var(--gold-1);
  border: 0; border-radius: 3px; padding: 0.45rem 0.9rem; margin-right: 0.8rem; cursor: pointer; }
.drop-cta { display: none; }
.js .drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 2; }
.js .drop-cta { display: flex; align-items: center; gap: 0.9rem; padding: 1.35rem 1.2rem; color: var(--mut); font-size: 0.97rem; }
.js .drop-cta b { color: var(--forest); }
.js .drop-cta u { color: var(--gold-ink); text-decoration-thickness: 1px; }
.up { flex: none; width: 2.4rem; height: 2.4rem; padding: 0.45rem; border-radius: 50%; background: var(--paper);
  fill: none; stroke: var(--gold-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  box-shadow: 0 6px 14px -8px rgba(28, 46, 39, 0.5); transition: transform 0.25s var(--ease); }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--gold-3); background: var(--gold-wash); }
.drop.over .up { transform: translateY(-3px); }
.drop:focus-within { outline: 2px solid var(--gold-3); outline-offset: 3px; }
.has-err .drop { border-color: var(--err); }
.chosen, .picked { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chosen:not(:empty) { padding: 0 1.2rem 1.1rem; position: relative; z-index: 3; pointer-events: none; }
.chosen li, .picked li { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.85rem; font-weight: 600; color: var(--forest); }
.chosen span, .picked span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen small { color: var(--mut); font-weight: 500; }
.drive { display: grid; gap: 0.6rem; justify-items: start; }
.chip-x { font: 600 0.78rem var(--text); color: var(--gold-ink); background: none; border: 0; padding: 0.15rem 0.2rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.2em; }
.drive-msg:empty { display: none; }
.drive-msg { font-size: 0.9rem; color: var(--sage); }

/* ---------- buttons ---------- */
.go { font: 700 1.05rem var(--text); color: var(--parch); background: var(--forest); border: 0; border-radius: 4px;
  padding: 0.95rem 1.6rem; cursor: pointer; text-decoration: none; display: inline-block; justify-self: start;
  box-shadow: 0 10px 22px -14px rgba(28, 46, 39, 0.8);
  transition: background-color 0.18s ease-out, color 0.18s ease-out, transform 0.18s ease-out; }
.go:hover { background: var(--gold-2); color: var(--forest); }
.go:active { transform: translateY(1px); }
.ghost { font: 700 0.95rem var(--text); color: var(--forest); background: transparent; border: 1.5px solid var(--forest);
  border-radius: 4px; padding: 0.6rem 1.1rem; cursor: pointer; justify-self: start;
  transition: background-color 0.18s ease-out, color 0.18s ease-out; }
.ghost:hover { background: var(--forest); color: var(--parch); }
.go:disabled, .ghost:disabled { opacity: 0.55; cursor: wait; }
[aria-busy="true"] { cursor: wait; background-image: linear-gradient(90deg, transparent, rgba(231, 201, 119, 0.35), transparent);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
form.busy { cursor: progress; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---------- waiting pages ---------- */
.wait { display: grid; gap: 1.25rem; max-width: 40rem; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar span { display: block; width: 35%; height: 100%; background: var(--gold-2); border-radius: 3px;
  animation: slide 1.6s var(--ease) infinite alternate; }
@keyframes slide { from { transform: translateX(-20%); } to { transform: translateX(206%); } }

/* ---------- step 2: check the numbers ---------- */
main:has(> form.review) { gap: 2rem; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; max-width: 62ch; }
.files li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.65rem; font-size: 0.95rem; }
.files li::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-top: 0.5em; background: var(--ok); }
.files li.bad::before { background: var(--err); }
.files b { color: var(--forest); overflow-wrap: anywhere; }
.files span { grid-column: 2; color: var(--mut); font-size: 0.88rem; }
.review { display: grid; gap: 1.75rem; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem); gap: var(--gap); align-items: start; }
.review-main { display: grid; gap: 1.5rem; min-width: 0; }
.review-main > fieldset { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.1rem clamp(0.9rem, 2.5vw, 1.5rem) 1.3rem; box-shadow: var(--lift); }
.review-main legend { float: left; font-size: 1.25rem; margin-bottom: 0.4rem; }
.review-main legend + * { clear: both; }
.pname { display: grid; gap: 0.3rem; max-width: 26rem; }
.lines { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.lines th { text-align: left; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--mut); padding: 0 0.4rem 0.35rem; border-bottom: 1px solid var(--rule); }
.lines th:not(:first-child) { text-align: right; }
.lines td { padding: 0.15rem 0.2rem; border-bottom: 1px solid #ece5d4; vertical-align: top; }
.lines td:first-child { width: 50%; }
.lines input { border-color: transparent; background: transparent; min-height: 2.5rem; padding: 0.45rem 0.5rem; border-radius: 3px; }
.lines input:hover { border-color: var(--line); background: #fff; }
.lines input:focus { background: #fff; }
.lines input.num, input.num { text-align: right; font-variant-numeric: tabular-nums; }
.lines [aria-invalid="true"] { border-color: var(--err); background: #fffaf8; }
.flag { display: block; text-align: right; font-size: 0.75rem; font-weight: 700; color: var(--gold-ink); padding: 0 0.5rem 0.3rem; }
.pairs > input, .pairs > .num { max-width: 16rem; }
.sums { position: sticky; top: 1.5rem; display: grid; gap: 1rem; background: var(--forest); color: var(--parch);
  border-radius: 6px; padding: 1.4rem 1.3rem; box-shadow: 0 24px 50px -30px rgba(28, 46, 39, 0.75); }
.sums h2 { color: var(--parch); font-size: 1.3rem; }
.sums .ledger { background: transparent; border: 0; color: var(--parch); }
.sums .ledger th, .sums .ledger td { padding: 0.55rem 0; border-bottom: 1px solid rgba(231, 201, 119, 0.22); color: #e8e1cf; font-size: 0.95rem; }
.sums .ledger td { color: var(--parch); }
.sums .ledger .goal th, .sums .ledger .goal td { background: transparent; border-bottom: 0; padding-top: 0.9rem; font-size: 1.15rem; }
.sums .ledger .goal td { color: var(--gold-1); font-size: 1.45rem; }
.sums .ok { color: #b9d8bf; font-weight: 600; font-size: 0.92rem; }
.sums .warn { color: var(--gold-1); font-weight: 600; font-size: 0.92rem; }
.sums .hint { color: #cfc8b4; }
.sums .ghost { color: var(--parch); border-color: var(--gold-2); }
.sums .ghost:hover { background: var(--gold-2); color: var(--forest); }
.sums .verdict.bad { font-size: 0.9rem; }
.sums .job-note { background: #e4e4e1; }

/* ---------- step 3: preview ---------- */
.check, .shown, .rest { display: grid; gap: 1.5rem; }
.check-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--gap); align-items: start; }
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; }
.ledger caption { caption-side: bottom; text-align: left; padding-top: 0.6rem; font-size: 0.9rem; color: var(--mut); }
.ledger th, .ledger td { padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 500; }
.ledger td { text-align: right; font-weight: 700; color: var(--forest); }
.ledger .goal th, .ledger .goal td { background: var(--forest); color: var(--parch); border-bottom: 0; font-family: var(--display);
  font-size: 1.25rem; font-weight: 700; }
.ledger .goal td { color: var(--gold-1); }
.verdict { border-radius: 6px; padding: 1.2rem 1.35rem; display: grid; gap: 0.7rem; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.ok h3 { color: var(--ok); }
.verdict.bad { background: var(--err-bg); color: #5c2318; }
.verdict.bad h3 { color: var(--err); }
.verdict ul, .also { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.45rem; }
.more { font-weight: 700; }
.also { margin-top: 1.1rem; color: var(--sage); font-size: 0.98rem; }
figure { margin: 0; display: grid; gap: 0.6rem; }
.shown figure img { width: 100%; height: auto; display: block; border-radius: 4px;
  box-shadow: 0 24px 50px -30px rgba(28, 46, 39, 0.6), 0 2px 6px rgba(28, 46, 39, 0.12); }
figcaption { font-size: 0.9rem; font-weight: 600; color: var(--mut); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 1.1rem; align-items: start; }
.tiles li { position: relative; display: grid; gap: 0.45rem; font-size: 0.88rem; font-weight: 600; color: var(--mut); }
.tiles img { width: 100%; height: auto; display: block; border-radius: 4px; border: 1px solid var(--rule); }
.lock { position: absolute; left: 50%; top: 38%; width: 2.2rem; height: 2.2rem; transform: translate(-50%, -50%); fill: none;
  stroke: var(--parch); stroke-width: 1.8; stroke-linecap: round; filter: drop-shadow(0 2px 5px rgba(28, 46, 39, 0.7)); }
.ask { display: grid; gap: 0.7rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.done { background: var(--ok-bg); color: var(--ok); font-weight: 700; padding: 0.9rem 1.1rem; border-radius: 4px; }
.steps .done { background: none; padding: 0; border-radius: 0; }

/* ---------- widths ---------- */
@media (max-width: 960px) {
  .review-grid { grid-template-columns: minmax(0, 1fr); }
  .sums { position: static; order: -1; }
}
@media (max-width: 860px) {
  main:has(> form.intake), .check-grid { grid-template-columns: minmax(0, 1fr); }
  main:has(> form.intake) .intro { position: static; }
  .band-note { display: none; }
  .fan { max-width: 34rem; }
}
@media (max-width: 480px) {
  .row, .tiers { grid-template-columns: minmax(0, 1fr); }
  .lines th { font-size: 0.7rem; }
  .lines td:first-child { width: 44%; }
  .js .drop-cta { padding: 1.1rem 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bar span { animation: none; width: 100%; opacity: 0.6; }
  [aria-busy="true"] { animation: none; }
  .go, .ghost, .fan img, .up, .drop { transition: none; }
}
