/* =============================================================
   Ourday worker-page stylesheet
   Served from the public site at https://ourday.today/worker.css so
   Cloudflare Worker-generated pages (signup form, verification/consent
   landings, cancel-link landings) can <link> to ONE canonical stylesheet
   and match the launch site's look.

   Self-contained on purpose: no @import, no third-party font CDN. Fonts
   are self-hosted next to this file (/fonts/fraunces-var.woff2) so the
   no-third-party posture holds on every Ourday surface, not just the
   marketing site.

   Defines the od- class contract the Workers re-markup TO. The live signup
   form (engineering's signup-intake/form.ts, the multi-step form at
   go.ourday.today/signup) currently emits its own classes; engineering
   converts its markup to the od- classes below so it inherits the launch
   brand. This file is the frozen contract; the intended markup is noted in
   comments beside each block. Design tokens mirror src/styles/tokens.css.
   v1, 2026-07-08: extended to cover the live multi-step form (wizard steps,
   phone-OTP widget, radios, Turnstile, error summary).
   ============================================================= */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/fraunces-var.woff2') format('woff2');
}

:root {
  --od-bg: #faf7f1;
  --od-surface: #f3eee5;
  --od-ink: #292423;
  --od-ink-soft: #5c534f;
  --od-accent: #0f766e;
  --od-accent-ink: #0b5d57; /* AA-safe teal for small text/links on cream */
  --od-border: rgba(41, 36, 35, 0.22);
  --od-border-strong: rgba(41, 36, 35, 0.32);
  --od-display: 'Fraunces', georgia, 'Times New Roman', serif;
  --od-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, helvetica,
    arial, sans-serif;
  --od-radius: 8px;
  --od-touch: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --od-bg: #211d1a;
    --od-surface: #2a2521;
    --od-ink: #ede6dc;
    --od-ink-soft: #b5aa9f;
    --od-accent: #4cc4b6;
    --od-accent-ink: #63d2c5;
    --od-border: rgba(237, 230, 220, 0.25);
    --od-border-strong: rgba(237, 230, 220, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--od-bg);
  color: var(--od-ink);
  font-family: var(--od-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- skip link ---------- */
.od-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--od-surface);
  color: var(--od-ink);
  padding: 0.5rem 1rem;
  border-radius: var(--od-radius);
  z-index: 200;
  font-size: 0.875rem;
  text-decoration: none;
}
.od-skip:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- layout ---------- */
.od-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.od-prose {
  max-width: 42rem;
}

/* ---------- header + wordmark ---------- */
.od-header {
  border-bottom: 1px solid var(--od-border);
}
.od-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  /* padding-block only, so this composes with od-wrap's horizontal padding
     whether the two classes are nested (signup form) or on the same element
     (worker landings: <div class="od-wrap od-header__inner">). A `padding`
     shorthand here would clobber od-wrap's side padding in the combined case. */
  padding-block: 0.75rem;
}
.od-wordmark {
  font-family: var(--od-display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--od-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  min-height: var(--od-touch);
}
.od-wordmark .dot {
  color: var(--od-accent);
  margin-left: 1px;
}
.od-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.od-nav a {
  font-size: 0.875rem;
  color: var(--od-ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--od-touch);
}
.od-nav a:hover,
.od-nav a[aria-current='page'] {
  color: var(--od-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- headings + links ---------- */
.od-h1 {
  font-family: var(--od-display);
  font-weight: 500;
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  line-height: 1.15;
  color: var(--od-ink);
  margin: 0 0 1rem;
  text-wrap: balance;
}
.od-link,
.od-legal a {
  color: var(--od-accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.od-link:hover,
.od-legal a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- generic page + legal wrapper ---------- */
.od-legal {
  padding: 2.5rem 0 4rem;
}
.od-legal__head {
  margin-bottom: 2rem;
}
.od-legal__lede {
  font-size: 1.125rem;
  color: var(--od-ink-soft);
  max-width: 42rem;
}
.od-legal__back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--od-accent-ink);
}

/* Brand headings + lists across every worker surface (the signup form's
   phone-verify heading and page lists, plus prose landings). Global so
   engineering needs no inline <style>, and brand changes propagate from
   here. worker.css is loaded only by Worker pages, so this never touches the
   main Astro site. */
h2 {
  font-family: var(--od-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--od-ink);
  margin: 2rem 0 0.75rem;
}
ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
li {
  margin-bottom: 0.5rem;
}

/* Readable prose measure inside a landing (message /m/, document,
   coppa-confirm). Wrap the content region in .od-legal or .od-prose. */
.od-legal p,
.od-legal li {
  max-width: 46rem;
}
.od-legal p {
  margin: 0 0 1rem;
}

/* ---------- form ---------- */
.od-form {
  max-width: 37.5rem;
  margin: 2.5rem 0 0;
}
.od-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 2.25rem;
}
.od-fieldset__legend {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--od-ink);
  margin: 0 0 0.25rem;
}
.od-fieldset__sub {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--od-ink-soft);
  margin: 0 0 1.125rem;
}
.od-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}
.od-field__label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--od-ink);
}
.od-field__req {
  color: var(--od-accent-ink);
  font-weight: 600;
}
.od-field__opt {
  color: var(--od-ink-soft);
  font-weight: 400;
}
.od-field__hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--od-ink-soft);
}
.od-input {
  width: 100%;
  min-height: var(--od-touch);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--od-body);
  color: var(--od-ink);
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: var(--od-radius);
}
.od-input::placeholder {
  color: var(--od-ink-soft);
}
.od-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- member card ---------- */
.od-member {
  border: 1px solid var(--od-border);
  border-radius: var(--od-radius);
  background: var(--od-surface);
  padding: 1.375rem 1.375rem 0.375rem;
  margin-bottom: 1rem;
}
.od-member__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.875rem;
}
.od-member__title {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--od-ink-soft);
  text-transform: uppercase;
}
.od-member__remove {
  font-size: 0.8125rem;
  color: var(--od-accent-ink);
  background: none;
  border: 0;
  cursor: pointer;
  min-height: var(--od-touch);
  padding: 0 0.25rem;
}
.od-member__remove:hover {
  text-decoration: underline;
}

/* ---------- checkboxes / consent ---------- */
.od-checkline {
  display: flex;
  gap: 0.6875rem;
  align-items: flex-start;
  margin: 0.375rem 0 1rem;
}
.od-checkline input[type='checkbox'] {
  margin: 0.125rem 0 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--od-accent);
}
.od-checkline label {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--od-ink);
}
.od-consent {
  background: var(--od-surface);
  border: 1px solid var(--od-border-strong);
  border-radius: var(--od-radius);
  padding: 1.25rem 1.375rem;
  margin: 1.75rem 0 1.25rem;
}
.od-consent .od-checkline {
  margin-bottom: 0;
}

/* ---------- buttons ---------- */
.od-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--od-touch);
  padding: 0.5rem 1.5rem;
  font-family: var(--od-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--od-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.od-btn--primary {
  background: var(--od-accent);
  color: #faf7f1;
}
@media (prefers-color-scheme: dark) {
  .od-btn--primary {
    color: #16211f;
  }
}
.od-btn--primary:hover {
  filter: brightness(0.95);
}
.od-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--od-touch);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--od-radius);
  background: transparent;
  color: var(--od-accent-ink);
  border: 1px solid var(--od-border-strong);
  cursor: pointer;
}
.od-addbtn:hover {
  background: var(--od-surface);
}
.od-addbtn[hidden] {
  display: none;
}

/* ---------- form status / notes ---------- */
.od-form__actions {
  margin-top: 1.75rem;
}
.od-form__note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--od-ink-soft);
  max-width: 52ch;
}
.od-form__status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--od-accent-ink);
}
.od-form__status[data-state='error'] {
  color: var(--od-ink);
}
.od-form.is-done .od-form__live {
  display: none;
}

/* ---------- footer ---------- */
.od-footer {
  border-top: 1px solid var(--od-border);
  padding: 2.5rem 0;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--od-ink-soft);
}
.od-footer a {
  color: var(--od-accent-ink);
}
.od-footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* =============================================================
   Multi-step signup form (live: go.ourday.today/signup)
   Engineering re-markups signup-intake/form.ts TO these classes.
   The .field/.q/.help/.intro/.coppa/.radio/.step/.btns/.add/.secondary/
   .linklike/.muted/.rates/.errors/.pv*/.cf-turnstile of the live form map
   to the od- classes here (see the message accompanying v1).
   ============================================================= */

/* Wizard step: one panel per step; the form's JS toggles [hidden]. */
.od-step[hidden] {
  display: none;
}

/* Progress indicator. Copy stays PLAIN-LANGUAGE ("a few more things and
   you're done"), never "Step N of 6" (brand guardrail: no step-counting
   mechanics, no gamified bar). Quiet and muted. */
.od-progress {
  font-size: 0.8125rem;
  color: var(--od-ink-soft);
  margin-bottom: 1.5rem;
}

/* Intro text at the top of a step. */
.od-intro {
  font-size: 1.0625rem;
  color: var(--od-ink-soft);
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

/* Radio group. Markup: <div class="od-radio"><label><input type="radio">
   Option</label>...</div> */
.od-radio {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.od-radio label {
  display: flex;
  gap: 0.6875rem;
  align-items: flex-start;
  min-height: var(--od-touch);
  font-size: 0.9375rem;
  color: var(--od-ink);
  cursor: pointer;
}
.od-radio input[type='radio'] {
  margin: 0.125rem 0 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--od-accent);
}

/* Phone-OTP verify widget. Markup: <div class="od-pv">
   <input class="od-pv__num"> <button class="od-linklike od-pv__resend">Resend
   </button> <p class="od-pv__ok">Verified</p> <p class="od-pv__err">...</p></div> */
.od-pv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.od-pv__num {
  width: 8rem;
  min-height: var(--od-touch);
  padding: 0.5rem 0.75rem;
  font-size: 1.125rem;
  letter-spacing: 0.25em;
  text-align: center;
  font-family: var(--od-body);
  color: var(--od-ink);
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: var(--od-radius);
}
.od-pv__ok {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--od-accent-ink);
}
.od-pv__err {
  margin: 0;
  font-size: 0.875rem;
  color: var(--od-ink);
}

/* Error summary. Subtle, never alarmist (no red alarm), per brand voice. */
.od-errors {
  background: var(--od-surface);
  border: 1px solid var(--od-border-strong);
  border-left: 3px solid var(--od-accent);
  border-radius: var(--od-radius);
  padding: 0.875rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--od-ink);
}
.od-errors ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

/* Cloudflare Turnstile container (CF styles the widget; we own spacing). */
.od-turnstile {
  margin: 1.25rem 0;
}

/* Button row (back / next) at the foot of a step. */
.od-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
}

/* Secondary (ghost) button, e.g. Back. */
.od-btn--secondary {
  background: transparent;
  color: var(--od-ink);
  border: 1px solid var(--od-border-strong);
}
.od-btn--secondary:hover {
  background: var(--od-surface);
}

/* Link-styled button (resend, small inline actions). */
.od-linklike {
  background: none;
  border: 0;
  padding: 0;
  min-height: var(--od-touch);
  font-family: var(--od-body);
  font-size: 0.875rem;
  color: var(--od-accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* Muted helper text + SMS-rate microcopy (live form's .muted / .rates). */
.od-muted,
.od-rates {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--od-ink-soft);
}
.od-rates {
  max-width: 52ch;
  margin: 1rem 0 0;
}

/* ---------- focus + motion ---------- */
:focus-visible {
  outline: 3px solid var(--od-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 560px) {
  .od-grid2 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
