/* FieldBridge shared stylesheet (T-011a). Tokens: docs/design/ONBOARDING_V1_VISUAL.md section 3, plus --fb-line-strong
   (ONBOARDING_V1.md section 12). One file, served at /join/assets/fb.css and /p/assets/fb.css. No external resources. */
:root {
  color-scheme: light dark;
  --fb-paper: #FBFAF7; --fb-surface: #FFFFFF; --fb-ink: #14201C; --fb-ink-2: #4C5A55;
  --fb-line: #D9DED9; --fb-line-strong: #7A8782;
  --fb-accent: #0F6E56; --fb-accent-ink: #FFFFFF; --fb-accent-soft: #E6F2EE;
  --fb-warn: #8A5A00; --fb-warn-bg: #FFF4DC; --fb-error: #A3261C; --fb-error-bg: #FCEBE9; --fb-ok: #1F6B3A;
  --fb-s1: 4px; --fb-s2: 8px; --fb-s3: 12px; --fb-s4: 16px; --fb-s5: 24px; --fb-s6: 32px; --fb-s7: 48px;
  --fb-r1: 6px; --fb-r2: 12px; --fb-r3: 16px; --fb-r4: 999px;
  --fb-target: 44px; --fb-control: 52px; --fb-row: 56px;
  --fb-motion: 150ms ease-out;
  --fb-sans: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fb-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fb-paper: #101514; --fb-surface: #17201D; --fb-ink: #F2F4F2; --fb-ink-2: #AEB8B3;
    --fb-line: #2A3531; --fb-line-strong: #7E8C86;
    --fb-accent: #5BC4A3; --fb-accent-ink: #0E1A16; --fb-accent-soft: #173029;
    --fb-warn: #F0C66A; --fb-warn-bg: #332A12; --fb-error: #F09A90; --fb-error-bg: #3A1A17; --fb-ok: #7CD39A;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fb-paper); color: var(--fb-ink); font: 17px/26px var(--fb-sans); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }

/* page and rhythm */
.fb-page { max-width: 480px; margin: 0 auto; padding: var(--fb-s4) var(--fb-s4) calc(var(--fb-s7) + env(safe-area-inset-bottom, 0px)); }
.fb-progress { display: block; width: 100%; height: 3px; margin: 0 0 var(--fb-s5); border: 0; border-radius: 0; background: var(--fb-line); color: var(--fb-accent); -webkit-appearance: none; appearance: none; }
.fb-progress::-webkit-progress-bar { background: var(--fb-line); }
.fb-progress::-webkit-progress-value { background: var(--fb-accent); }
.fb-progress::-moz-progress-bar { background: var(--fb-accent); }
.fb-display { margin: var(--fb-s5) 0 var(--fb-s2); font: 600 30px/36px var(--fb-serif); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.fb-reason { margin: 0 0 var(--fb-s5); max-width: 36em; color: var(--fb-ink-2); }
.fb-small { margin: var(--fb-s2) 0; font-size: 15px; line-height: 22px; color: var(--fb-ink-2); }
.fb-caption { margin: var(--fb-s2) 0 0; font-size: 13px; line-height: 18px; color: var(--fb-ink-2); overflow-wrap: anywhere; }
.fb-heading { margin: 0 0 var(--fb-s2); font: 600 20px/26px var(--fb-sans); }

/* fields */
.fb-field { margin: 0 0 var(--fb-s4); }
.fb-field label { display: block; margin-bottom: var(--fb-s2); font-weight: 600; }
.fb-input { display: block; width: 100%; height: var(--fb-control); padding: 0 var(--fb-s4); font: 17px/26px var(--fb-sans); color: var(--fb-ink);
  background: var(--fb-surface); border: 1px solid var(--fb-line-strong); border-radius: var(--fb-r2);
  transition: border-color var(--fb-motion), background-color var(--fb-motion); }
.fb-input[aria-invalid="true"] { border-color: var(--fb-error); border-width: 2px; }
.fb-fieldset { margin: 0 0 var(--fb-s5); padding: 0; border: 0; min-width: 0; }
.fb-fieldset legend { padding: 0; margin-bottom: var(--fb-s2); font-weight: 600; }

/* check and choice marks (custom box, outline uses --fb-line-strong) */
.fb-check input, .fb-choice input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 24px; height: 24px; margin: 0;
  background: var(--fb-surface); border: 2px solid var(--fb-line-strong); border-radius: var(--fb-r1); cursor: pointer;
  transition: background-color var(--fb-motion), border-color var(--fb-motion); }
.fb-choice input[type="radio"] { border-radius: var(--fb-r4); }
.fb-check input:checked, .fb-choice input:checked { background: var(--fb-accent); border-color: var(--fb-accent); }
.fb-check input:checked::after, .fb-choice input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px;
  border: solid var(--fb-accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.fb-choice input[type="radio"]:checked::after { content: ""; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border-radius: var(--fb-r4); background: var(--fb-accent-ink); }
.fb-check input:disabled, .fb-choice input:disabled { opacity: 0.7; cursor: default; }
.fb-check { display: flex; align-items: flex-start; gap: var(--fb-s3); min-height: var(--fb-target); padding: var(--fb-s2) 0; margin: 0 0 var(--fb-s2); }
.fb-check label { cursor: pointer; }
.fb-choice { display: flex; align-items: center; gap: var(--fb-s3); min-height: var(--fb-row); margin: 0 0 var(--fb-s2); padding: 0 var(--fb-s4);
  background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-r2); cursor: pointer;
  transition: background-color var(--fb-motion), border-color var(--fb-motion); }
.fb-choice:has(input:checked) { background: var(--fb-accent-soft); border-color: var(--fb-accent); }

/* the consent card (both pages) */
.fb-consent { margin: 0 0 var(--fb-s4); padding: var(--fb-s4); background: var(--fb-accent-soft); border: 1px solid var(--fb-accent); border-radius: var(--fb-r3); }
.fb-consent h2, .fb-consent h3 { margin: 0 0 var(--fb-s2); font: 600 22px/28px var(--fb-serif); }
.fb-consent p { margin: var(--fb-s2) 0; }
.fb-consent .fb-check { align-items: center; margin: var(--fb-s3) 0; }
.fb-consent .fb-check input { width: 32px; height: 32px; border-radius: var(--fb-r2); }
.fb-consent .fb-check input:checked::after { left: 10px; top: 3px; width: 8px; height: 16px; }
.fb-consent .fb-check label { font-size: 20px; line-height: 26px; font-weight: 700; }
.fb-consent .fb-caption { margin-top: var(--fb-s3); }

/* what we have */
.fb-ledger { margin: 0 0 var(--fb-s5); }
.fb-ledger h2 { margin: 0 0 var(--fb-s2); font: 600 15px/22px var(--fb-sans); color: var(--fb-ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.fb-ledger ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--fb-line); }
.fb-ledger li { padding: var(--fb-s3) 0; border-bottom: 1px solid var(--fb-line); }
.fb-card { margin: 0 0 var(--fb-s4); padding: var(--fb-s4); background: var(--fb-accent-soft); border-radius: var(--fb-r3); }
.fb-card h2 { margin: 0 0 var(--fb-s2); font: 600 20px/26px var(--fb-sans); }
.fb-card p { margin: 0 0 var(--fb-s3); }
.fb-card .fb-code { margin: var(--fb-s3) 0; font: 700 40px/48px var(--fb-sans); letter-spacing: 0.12em; text-align: center; font-variant-numeric: tabular-nums; color: var(--fb-ink); }

/* buttons and links */
.fb-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--fb-control); padding: 0 var(--fb-s5);
  font: 600 17px/26px var(--fb-sans); color: var(--fb-accent-ink); background: var(--fb-accent); border: 0; border-radius: var(--fb-r2);
  text-align: center; text-decoration: none; cursor: pointer;
  transition: opacity var(--fb-motion), background-color var(--fb-motion), transform var(--fb-motion); }
.fb-button:active { transform: scale(0.99); }
.fb-button:disabled { opacity: 0.6; cursor: default; }
.fb-link { display: inline-flex; align-items: center; min-height: var(--fb-target); padding: 0; font: inherit; color: var(--fb-accent);
  background: none; border: 0; text-decoration: underline; cursor: pointer; transition: color var(--fb-motion); }

/* validation and state, spoken by the aria-live region */
.fb-status { min-height: 0; margin: var(--fb-s2) 0 0; font-size: 15px; line-height: 22px; color: var(--fb-ink-2); }
.fb-status.err { color: var(--fb-error); }
.fb-status.warn, .fb-status.pending { color: var(--fb-warn); }
.fb-status.ok { color: var(--fb-ok); }
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .fb-button:active { transform: none; }
}

/* the texted link (T-012a): 56 px tap targets, buttons stacked */
.fb-tall { min-height: var(--fb-row); }
.fb-link.fb-tall { display: flex; width: 100%; justify-content: center; }
.fb-stack { display: grid; gap: var(--fb-s2); margin: 0 0 var(--fb-s4); }
.fb-stack > .fb-input { margin: 0; }
