/* memoe: the pages of the Earn sign-up and the business inquiries (/earn, /earn/continue, /business, /business/demo, /business/admin).
   Loads after brand.css and site.css and uses only their tokens: pale glass, graphite type, one dark pill as the primary action in a
   view, capsules for buttons. No colour of its own (api/earn-business-pages.test.js checks there is no literal one here). Text sits on
   frost or on white, in graphite or slate-700, never slate-600 on the backdrop (the in-app text rules, on the web). */

.page-leads [hidden] { display: none !important; }
.page-leads .page > *, .page-leads .stack > *, .page-leads .stack-lg > * { min-width: 0; }
.page-leads .page > * { max-width: 760px; }
.page-leads .panel { padding: clamp(20px, 3.2vw, 40px); }
.page-leads .panel .button-primary { margin-top: 0; }   /* site.css gives a button in a panel a top margin; these sit in rows */
.page-leads .hero-action { margin-top: 18px; }
/* The first screen's action goes to the join form; once someone has joined the form is hidden, and the action with it. */
.page-leads:has([data-done]:not([hidden])) [data-join-link] { display: none; }
.page-leads .page-title { font-size: clamp(36px, 5.4vw, 64px); }
.page-leads .panel .lede { margin-top: 14px; max-width: 36em; font-size: clamp(17px, 1.5vw, 20px); }
.page-leads .muted { color: var(--fg-2); }
.page-leads .num { font-variant-numeric: tabular-nums; }
.page-leads .section-title { font-size: clamp(24px, 2.6vw, 34px); font-weight: var(--fw-medium); line-height: 1.12; }

.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.button-primary[disabled], .button-secondary[disabled], .button-primary[aria-disabled="true"], .button-secondary[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.button-primary[aria-busy="true"] { cursor: progress; }
.button-small { min-height: 44px; padding: 0 16px; font-size: 14px; }   /* narrower, never shorter than a thumb */
.link-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.link-button:hover { text-decoration-color: var(--ink); }
.link-button:focus-visible, .button-primary:focus-visible, .button-secondary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--white); }

/* what this is and is not: a quiet line, always visible, never a banner that sells */
.truth { display: grid; gap: 6px; padding: 14px 18px; border-radius: var(--radius-card); background: color-mix(in srgb, var(--white) 55%, transparent); border-left: 3px solid var(--steel); }
.truth p { color: var(--ink); font-size: 16px; line-height: 1.45; }
.truth strong { font-weight: var(--fw-medium); }

/* the three steps */
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; padding: 14px 16px; border-radius: var(--radius-card); background: color-mix(in srgb, var(--white) 50%, transparent); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--graphite-800); color: var(--text-on-image); font-size: 15px; font-weight: var(--fw-medium); grid-row: span 2; }
.steps .step-title { font-size: 17px; font-weight: var(--fw-medium); color: var(--ink); }
.steps .step-body { font-size: 15.5px; line-height: 1.45; color: var(--ink); }

/* form rows */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 15px; font-weight: var(--fw-medium); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input:not([type]), .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--mist-300); background: var(--surface-elevated);
  font: inherit; font-size: 17px; color: var(--ink);
}
.field textarea { min-height: 96px; padding: 12px 16px; resize: vertical; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--mist-100); color: var(--fg-2); cursor: not-allowed; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--destructive); box-shadow: inset 0 0 0 1px var(--destructive); }
.hint { font-size: 14px; color: var(--fg-2); }
.field-error { font-size: 14px; color: var(--ink); padding-left: 12px; border-left: 3px solid var(--destructive); }
.field-error:empty { display: none; }
.group { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.group legend { margin-bottom: 8px; padding: 0; font-size: 15px; font-weight: var(--fw-medium); }

/* check boxes: a 44 px row, the whole label is the target; each consent is its own box with its own words */
.check { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; min-height: 44px; padding: 8px 0; cursor: pointer; font-size: 16px; line-height: 1.4; color: var(--ink); }
.check input { position: absolute; left: 0; top: 8px; width: 28px; height: 28px; margin: 0; opacity: 0; cursor: pointer; }
.check .box { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px; border-radius: 8px; border: 1.5px solid var(--slate-600); background: var(--surface-elevated); }
.check .box::after { content: ""; width: 7px; height: 13px; margin-top: -3px; border: solid var(--text-on-image); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .15s var(--ease); }
.check input:checked + .box { background: var(--graphite-800); border-color: var(--graphite-800); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--white); }
.check input[aria-invalid="true"] + .box { border-color: var(--destructive); box-shadow: inset 0 0 0 1px var(--destructive); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }

/* a field no person sees: the honeypot. Off screen, not display:none, so a bot that fills every field fills it. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* a message: put into an always-present live region, so it is spoken when it arrives */
.notice-region { display: grid; gap: 12px; }
.notice { display: grid; gap: 6px; padding: 14px 18px; border-radius: var(--radius-control); background: color-mix(in srgb, var(--white) 52%, transparent); border-left: 3px solid var(--steel); }
.notice[data-tone="warn"], .notice[data-tone="error"] { border-left-color: var(--destructive); }
.notice[data-tone="ok"] { border-left-color: var(--navy); }
.notice p { color: var(--ink); }

/* the Turnstile box: Cloudflare draws the widget inside it */
.human { min-height: 65px; display: grid; align-items: center; }
.human:empty { display: none; }

/* the code to keep, and the link to the app */
.keep { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--surface-elevated); border: 1px solid var(--mist-300); }
.keep-value { font-size: clamp(16px, 2.4vw, 19px); font-weight: var(--fw-medium); letter-spacing: .02em; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; color: var(--ink); }
.qr { display: grid; justify-items: start; gap: 8px; }
.qr svg { width: min(100%, 220px); height: auto; border-radius: var(--radius-sm); border: 1px solid var(--mist-300); background: var(--white); }

/* the terms, as the person agrees to them */
.terms-text { display: grid; gap: 10px; max-height: 320px; overflow: auto; padding: 14px 16px; border-radius: var(--radius-card); background: color-mix(in srgb, var(--white) 55%, transparent); font-size: 15px; line-height: 1.5; color: var(--ink); }
.terms-text:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.terms-text h3 { font-size: 15px; font-weight: var(--fw-medium); }
.terms-text ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.keep-pre { margin: 0; padding: 14px 16px; border-radius: var(--radius-card); background: var(--surface-elevated); border: 1px solid var(--mist-300); font: inherit; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; color: var(--ink); }
.keep-pre:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.draft-note { font-size: 14px; color: var(--ink); padding-left: 12px; border-left: 3px solid var(--destructive); }

/* the demo and the admin pages */
.page-demo .page > *, .page-business-admin .page > * { max-width: 1040px; }
.demo-banner { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 18px; border-radius: var(--radius-control); background: var(--graphite-950); color: var(--text-on-image); font-size: 15px; font-weight: var(--fw-medium); letter-spacing: .03em; }
.demo-banner .muted { color: var(--text-on-image); font-weight: var(--fw-regular); letter-spacing: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.segmented label { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--slate-600) 45%, transparent); background: color-mix(in srgb, var(--white) 40%, transparent); font-size: 15px; font-weight: var(--fw-medium); color: var(--ink); cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--graphite-800); border-color: transparent; color: var(--text-on-image); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--white); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.demo-grid li { display: grid; gap: 6px; padding: 8px; border-radius: var(--radius-card); background: var(--surface-elevated); border: 1px solid var(--mist-300); }
.demo-grid img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.demo-phone { max-width: 380px; padding: 18px; border-radius: var(--radius-panel); border: 1px solid var(--mist-300); background: color-mix(in srgb, var(--white) 70%, transparent); }
.demo-list { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: 15.5px; line-height: 1.45; color: var(--ink); }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--mist-300); vertical-align: top; color: var(--ink); }
.table-wrap th { font-weight: var(--fw-medium); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--mist-100); font-size: 13.5px; font-weight: var(--fw-medium); color: var(--ink); }
.dialog-box { width: min(92vw, 640px); max-height: 90vh; overflow: auto; padding: clamp(18px, 3vw, 32px); border: 0; border-radius: var(--radius-panel); background: var(--surface-elevated); color: var(--ink); }
.dialog-box::backdrop { background: color-mix(in srgb, var(--graphite-950) 45%, transparent); }

@media (prefers-reduced-motion: reduce) { .check .box::after { transition: none; } }
@media (prefers-reduced-transparency: reduce) {
  .truth, .steps li, .notice, .terms-text, .demo-phone, .segmented label { background: var(--surface-elevated); }
}
@media (prefers-contrast: more) {
  .field input, .field textarea, .field select, .check .box, .keep { border-color: var(--ink); }
  .truth, .notice { border-left-width: 5px; }
}
@media (forced-colors: active) {
  .field input, .field textarea, .field select, .notice, .truth, .keep { border: 1px solid CanvasText; }
  .check .box { border: 2px solid CanvasText; }
  .check input:checked + .box { background: Highlight; }
  .field [aria-invalid="true"] { border-width: 3px; }
}
@media (max-width: 520px) {
  .page-leads .row > .button-primary, .page-leads .row > .button-secondary { width: 100%; }
}
