/*
 * The public site's one stylesheet.
 *
 * It borrows the operator app's palette on purpose — the same zinc greys, the
 * same work-zone orange on the mark, the same heavy rule under the header —
 * because the thing being sold is the sheet that tool draws, and a customer who
 * later sees a plan should recognise where it came from.
 *
 * Two rules the layout is built on:
 *
 * - **One column, and a measure.** Prose is capped at 64 characters a line, the
 *   same cap the operator app's results column carries and for the same reason.
 * - **390 px first.** A contractor reads this on a phone, on a job site, with a
 *   crane on the clock. Every page is laid out at 390 px and widened from there,
 *   not the other way round.
 */
:root {
  color-scheme: light;
  --ink: #18181b;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --rule: #e4e4e7;
  --paper: #ffffff;
  --page: #f4f4f5;
  --mark: #d97706;
  --deep: #1e3a5f;
  --warn-bg: #fff7ed;
  --warn-rule: #ea580c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/*
 * A column the full height of the window, so the footer sits at the bottom of
 * a short page rather than halfway up it with grey below. The received page is
 * the short one, and it is the page a customer is most likely to keep open.
 */
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* ---------------------------------------------------------------- header */

header.site {
  display: flex;
  align-items: stretch;
  background: #fcfcfc;
  border-bottom: 2px solid #1a1a1a;
}
header.site .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 9px 14px;
  border-right: 1px solid var(--rule);
  text-decoration: none;
}
header.site .brand-mark { font-size: 20px; font-weight: 700; color: var(--mark); line-height: 1; }
header.site .brand-sub { font-size: 8px; font-weight: 700; letter-spacing: 0.13em; color: var(--ink-soft); margin-top: 3px; }
header.site nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 16px;
  padding: 8px 14px;
}
header.site nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
header.site nav a:hover { color: var(--ink); border-bottom-color: var(--mark); }
header.site nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--mark); }

/* ------------------------------------------------------------------ page */

main { padding: 20px 16px 48px; max-width: 760px; margin: 0 auto; }
h1 { font-size: 25px; line-height: 1.2; letter-spacing: -0.015em; margin: 8px 0 12px; }
h2 { font-size: 18px; margin: 30px 0 8px; }
h3 { font-size: 15px; margin: 22px 0 6px; }
p, li { max-width: 64ch; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
a { color: var(--deep); }
.lede { font-size: 18px; color: var(--ink-soft); }
.muted { color: var(--muted); font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
.card h2, .card h3 { margin-top: 0; }
.note {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-rule);
  padding: 10px 12px;
  margin: 16px 0;
  font-size: 14.5px;
}
.note b { display: block; }
.draft {
  background: #fef2f2;
  border-left: 3px solid #b91c1c;
  padding: 10px 12px;
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- prices */

.offers { display: grid; gap: 12px; margin: 16px 0; }
.offer {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px;
}
.offer .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.offer h3 { margin: 0; font-size: 16px; }
.offer .price { font-size: 17px; font-weight: 700; white-space: nowrap; }
.offer p { margin: 6px 0 0; font-size: 14.5px; }
.offer .who { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ form */

form.order { margin: 0; }
fieldset {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 16px 18px;
  margin: 0 0 16px;
}
legend { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); padding: 0 6px; }
fieldset > .blurb { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.q { margin: 16px 0 0; }
.q > label { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.q .help { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; font-weight: 400; }
.q input, .q select, .q textarea {
  width: 100%;
  padding: 9px 10px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.q textarea { min-height: 76px; resize: vertical; }
.q.check > label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.q.check input { width: auto; margin-top: 3px; flex: none; }
.q .decides { margin: 5px 0 0; }
.q .decides summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }
.q .decides ul { margin: 5px 0 0; padding-left: 20px; }
.q .decides li { font-size: 12.5px; color: var(--muted); }
.req { color: var(--warn-rule); font-weight: 700; }

button.go {
  width: 100%;
  padding: 13px;
  font-size: 16.5px;
  font-weight: 700;
  color: white;
  background: var(--deep);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
button.go:hover { background: #274b7a; }
button.go:disabled, button.go:disabled:hover { background: #a1a1aa; cursor: progress; }
a.go {
  display: inline-block;
  padding: 11px 22px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: var(--deep);
  border-radius: 7px;
  text-decoration: none;
}
a.go:hover { background: #274b7a; }

.files { margin-top: 10px; }
.files ul { list-style: none; padding: 0; margin: 8px 0 0; }
.files li { font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.files .bad { color: #b91c1c; }
.problems { list-style: none; padding: 0; }
.problems li { background: #fef2f2; border-left: 3px solid #b91c1c; padding: 7px 10px; margin-bottom: 6px; font-size: 14px; }

.ref {
  font-family: ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 12px;
  display: inline-block;
}

/* ------------------------------------------------- where is my plan (M2) */

/*
 * The one page that prints facts about an order rather than prose about the
 * product, so it gets the one layout the rest of the site does not have: a
 * two-column term list that collapses to one at a phone's width. Same shape as
 * the operator queue's `dl.kv`, narrower, because the terms here are short
 * ("Ordered", "Where") and the values are a customer's own words.
 */
dl.kv {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 4px 14px;
  margin: 12px 0 0;
  font-size: 14.5px;
}
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 560px) {
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  dl.kv dt { margin-top: 8px; font-size: 13px; }
}

/* The quoted amount reads as the number it is, beside the date it was set. */
.row.quoted { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.row.quoted .price { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }

#order .card h3 { margin-top: 0; }
#order ul { margin: 6px 0 0; }
#order button.go { margin-top: 6px; }

footer.site {
  border-top: 1px solid var(--rule);
  background: #fcfcfc;
  padding: 18px 16px 30px;
}
footer.site .inner { max-width: 760px; margin: 0 auto; }
footer.site p { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
footer.site a { color: var(--muted); }

/*
 * On a phone the price and the offer's name cannot share a line: the price is
 * `nowrap` and "Multi-phase plan set" was squeezed into three lines against
 * "$150 per sheet, $400 minimum". Stacked, both read.
 */
@media (max-width: 560px) {
  .offer .row { flex-direction: column; gap: 2px; }
  .offer .price { white-space: normal; }
}

@media (min-width: 720px) {
  main { padding: 28px 24px 60px; }
  h1 { font-size: 30px; }
  .offers { gap: 14px; }
}

/*
 * The honeypot (package M3, `apps/site/src/abuse.ts`).
 *
 * Off the side of the page rather than `display: none` or `visibility: hidden`,
 * because a bot worth catching reads the computed style and skips anything the
 * browser says is not rendered. This box *is* rendered — it is simply nowhere a
 * person will ever look. The markup carries `aria-hidden` and `tabindex="-1"`,
 * which is what keeps it away from a screen reader and from the tab order; CSS
 * alone would hide it from the eye and leave it in both.
 *
 * `position: absolute` with a real size and no `overflow: hidden` ancestor, so
 * it cannot make the page scroll sideways — the one way a trap like this shows
 * itself.
 */
.trap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/*
 * The line under the send button about the terms. Was an inline `style` attribute
 * in the bundle, which the public pages' Content Security Policy blocks
 * (`style-src 'self'`, package M3) — so it lives here, where a stylesheet lives.
 */
.help.terms-note { margin-top: 10px; }
