/* ============================================================================
   AI Friendly — Public surfaces
   Marketing chrome (nav + footer) shared with the redesigned public pages,
   plus auth / score-share / sitemap / 404 patterns and a self-contained
   state switcher (no sidebar dependency).
   Load: tokens.css → components.css → public.css
   ============================================================================ */

body { background: var(--bg); }
[hidden] { display: none !important; }

/* ---------- Marketing nav (matches pricing/home) ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(250,250,251,0.92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; max-width: 1320px; margin: 0 auto; padding: 0 32px; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { font-size: 14px; color: var(--text-2); font-weight: 500; }
.nav__links a:hover { color: var(--text-1); }
.nav__links a.is-on { color: var(--text-1); }
.nav__actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---------- Marketing footer ---------- */
footer.site { padding: 56px 0 32px; background: var(--bg); border-top: 1px solid var(--border); margin-top: 64px; }
.ft-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; }
@media (max-width: 880px) { .ft-grid { grid-template-columns: 1fr 1fr; } }
.ft-grid h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--text-3); text-transform: uppercase; margin: 0 0 16px; font-weight: 600; }
.ft-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ft-grid ul a { font-size: 13.5px; color: var(--text-2); }
.ft-grid ul a:hover { color: var(--text-1); }
.ft-legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

/* ====================================================================
   AUTH — split layout
   ==================================================================== */
.auth { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 920px) { .auth { grid-template-columns: 1fr; min-height: auto; } }

/* Left: brand / value panel (dark) */
.auth__brand { background: var(--ink-900); color: #fff; padding: 56px 56px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__brand::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 18px 18px; opacity: 0.5; pointer-events: none; }
.auth__brand > * { position: relative; z-index: 1; }
@media (max-width: 920px) { .auth__brand { display: none; } }
.auth__brand-top { display: flex; align-items: center; gap: 12px; }
.auth__brand-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8FB5F8; }
.auth__brand h2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 580; margin: 20px 0 0; max-width: 16ch; text-wrap: balance; }
.auth__brand h2 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: #8FB5F8; }
.auth__brand p { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.66); margin: 16px 0 0; max-width: 42ch; }
.auth__proof { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.auth__proof-row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: rgba(255,255,255,0.8); }
.auth__proof-row .ic { width: 26px; height: 26px; border-radius: 7px; background: rgba(143,181,248,0.16); color: #8FB5F8; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth__brand-foot { font-family: var(--font-mono); font-size: 10.5px; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; text-transform: uppercase; }

/* Right: form column */
.auth__form { display: flex; align-items: center; justify-content: center; padding: 56px 32px; }
.authcard { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.authcard__eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--af-blue-700); display: inline-flex; align-items: center; gap: 8px; }
.authcard__eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--af-blue); }
.authcard h1 { font-family: var(--font-display); font-size: 28px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 580; margin: 0; }
.authcard h1 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.authcard__sub { font-size: 14px; line-height: 1.55; color: var(--text-2); margin: -8px 0 0; }
.authcard__sub a { color: var(--af-blue-700); font-weight: 550; }
.authcard__sub a:hover { color: var(--af-blue); }

/* Field */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; align-items: baseline; }
.field__label a { color: var(--af-blue-700); text-transform: none; letter-spacing: 0; font-size: 12px; }
.field__label a:hover { color: var(--af-blue); }
.field__hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.field__hint--bad { color: var(--signal-bad); }
.field__hint--good { color: var(--signal-good); }
.field .input { height: 46px; }

/* OAuth */
.oauthrow { display: flex; flex-direction: column; gap: 10px; }
.oauthbtn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 550; color: var(--text-1); transition: background 120ms, border-color 120ms; }
.oauthbtn:hover { background: var(--ink-50); border-color: var(--ink-400); }
.oauthbtn svg { width: 18px; height: 18px; }
.auth-divider { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.authcard__submit { width: 100%; justify-content: center; }
.authcard__legal { font-size: 12px; color: var(--text-3); line-height: 1.5; text-align: center; }
.authcard__legal a { color: var(--text-2); border-bottom: 1px solid var(--border-strong); }

/* Notice (reused) */
.pnotice { border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; font-size: 13px; line-height: 1.5; }
.pnotice .icn { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12px; margin-top: 1px; }
.pnotice--bad { background: var(--signal-bad-50); color: var(--signal-bad); border: 1px solid rgba(229,72,77,0.22); } .pnotice--bad .icn { background: var(--signal-bad); }
.pnotice--good { background: var(--signal-good-50); color: var(--signal-good); border: 1px solid rgba(21,184,134,0.22); } .pnotice--good .icn { background: var(--signal-good); }
.pnotice--info { background: var(--af-blue-50); color: var(--af-blue-700); border: 1px solid var(--af-blue-100); } .pnotice--info .icn { background: var(--af-blue); }
.pnotice b { color: var(--text-1); font-weight: 600; }
.pnotice--bad b, .pnotice--good b { color: inherit; }

/* Big icon for confirm / success / error centered states */
.authcard--center { text-align: center; align-items: center; }
.authcard__bigicon { width: 64px; height: 64px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; }
.authcard__bigicon--info { background: var(--af-blue-50); color: var(--af-blue); }
.authcard__bigicon--good { background: var(--signal-good-50); color: var(--signal-good); }
.authcard__bigicon--bad { background: var(--signal-bad-50); color: var(--signal-bad); }
.authcard__bigicon--muted { background: var(--ink-100); color: var(--text-3); }

/* ====================================================================
   SCORE SHARE — public shareable card
   ==================================================================== */
.share { padding: 56px 0 24px; }
.share__wrap { max-width: 760px; margin: 0 auto; }
.sharecard { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-md); }
.sharecard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; background: var(--ink-50); border-bottom: 1px solid var(--border); }
.sharecard__site { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-mono); font-size: 13px; color: var(--text-1); }
.sharecard__site .fav { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #6CA0FF 0%, #2E5DD9 100%); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; font-weight: 700; }
.sharecard__date { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }
.sharecard__body { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 36px 32px; align-items: center; }
@media (max-width: 620px) { .sharecard__body { grid-template-columns: 1fr; gap: 24px; text-align: center; justify-items: center; } }
.sharecard__ring { width: 200px; height: 200px; position: relative; }
.sharecard__ring svg { transform: rotate(-90deg); width: 200px; height: 200px; }
.sharecard__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-display); }
.sharecard__num .num { font-size: 68px; font-weight: 580; letter-spacing: -0.04em; line-height: 1; }
.sharecard__num .denom { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px; }
.sharecard__detail h2 { font-family: var(--font-display); font-size: 26px; font-weight: 580; letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
.sharecard__detail h2 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.sharecard__band { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 10px; }
.sharecard__band .dot { width: 7px; height: 7px; border-radius: 50%; }
.sharecard__bars { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.sharebar { display: grid; grid-template-columns: 120px 1fr 36px; gap: 12px; align-items: center; }
.sharebar .l { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }
.sharebar .v { font-family: var(--font-mono); font-size: 12px; color: var(--text-1); text-align: right; }
.sharecard__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--border); background: var(--ink-50); flex-wrap: wrap; }
.sharecard__foot .meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }
.share__cta { text-align: center; max-width: 600px; margin: 32px auto 0; }
.share__cta h3 { font-family: var(--font-display); font-size: 24px; font-weight: 580; letter-spacing: -0.02em; margin: 0 0 8px; }
.share__cta h3 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.share__cta p { font-size: 14px; color: var(--text-2); line-height: 1.55; margin: 0 0 18px; }
.share__scan { max-width: 480px; margin: 0 auto; }

/* Generic centered state (expired / 404) */
.midstate { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.midstate__inner { max-width: 480px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.midstate__icon { width: 72px; height: 72px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-100); color: var(--text-3); }
.midstate__icon--info { background: var(--af-blue-50); color: var(--af-blue); }
.midstate__code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.midstate__inner h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 580; margin: 0; }
.midstate__inner h1 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.midstate__inner p { font-size: 15px; color: var(--text-2); line-height: 1.6; margin: 0; max-width: 42ch; }
.midstate__routes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ====================================================================
   SITEMAP
   ==================================================================== */
.sm-hero { padding: 56px 0 8px; }
.sm-hero .t-eyebrow { color: var(--af-blue-700); }
.sm-hero h1 { font-family: var(--font-display); font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 580; margin: 14px 0 12px; }
.sm-hero h1 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.sm-hero p { font-size: 16px; color: var(--text-2); line-height: 1.55; margin: 0; max-width: 60ch; }
.sm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 40px 0 16px; }
@media (max-width: 880px) { .sm-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sm-grid { grid-template-columns: 1fr; } }
.sm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 4px; }
.sm-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sm-card__ic { width: 30px; height: 30px; border-radius: 8px; background: var(--af-blue-50); color: var(--af-blue); display: inline-flex; align-items: center; justify-content: center; }
.sm-card__ic--muted { background: var(--ink-100); color: var(--text-3); }
.sm-card h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 0; font-weight: 600; }
.sm-card a.smlink { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; color: var(--text-1); font-weight: 500; }
.sm-card a.smlink:last-child { border-bottom: 0; }
.sm-card a.smlink:hover { color: var(--af-blue-700); }
.sm-card a.smlink .meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-4); letter-spacing: 0.04em; text-transform: uppercase; }
.sm-card a.smlink.is-auth .meta { color: var(--af-blue-700); }

/* ====================================================================
   STATE SWITCHER + state-driven show/hide (self-contained)
   ==================================================================== */
body[data-state] [data-show] { display: none !important; }
body[data-state="signin"]   [data-show~="signin"],
body[data-state="signup"]   [data-show~="signup"],
body[data-state="confirm"]  [data-show~="confirm"],
body[data-state="recovery"] [data-show~="recovery"],
body[data-state="error"]    [data-show~="error"],
body[data-state="loading"]  [data-show~="loading"],
body[data-state="request"]  [data-show~="request"],
body[data-state="setnew"]   [data-show~="setnew"],
body[data-state="updated"]  [data-show~="updated"],
body[data-state="success"]  [data-show~="success"],
body[data-state="invalid"]  [data-show~="invalid"],
body[data-state="valid"]    [data-show~="valid"],
body[data-state="expired"]  [data-show~="expired"],
body[data-state="signed-out"]       [data-show~="signed-out"],
body[data-state="already-accepted"] [data-show~="already-accepted"]
{ display: revert !important; }

.statesw { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: inline-flex; align-items: center; gap: 4px; padding: 6px; background: rgba(14,14,20,0.92); backdrop-filter: saturate(180%) blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center; }
.statesw__lbl { font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,0.45); letter-spacing: 0.1em; text-transform: uppercase; padding: 0 8px 0 6px; }
.statesw button { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.7); background: transparent; border: 0; padding: 6px 11px; border-radius: 999px; transition: background 120ms, color 120ms; }
.statesw button:hover { color: #fff; background: rgba(255,255,255,0.08); }
.statesw button.is-on { background: var(--af-blue); color: #fff; }

/* ====================================================================
   ACCEPT INVITE — centered invite card on marketing chrome
   ==================================================================== */
.invitecard { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-md); overflow: hidden; text-align: left; }
.invitecard__head { padding: 22px 28px; background: var(--ink-50); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invitecard__eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--af-blue-700); display: inline-flex; align-items: center; gap: 8px; }
.invitecard__eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--af-blue); }
.invitecard__body { padding: 28px; }

/* Org identity block */
.invite-org { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.invite-org__fav { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #6CA0FF 0%, #2E5DD9 100%); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; flex-shrink: 0; }
.invite-org__txt { min-width: 0; }
.invite-org__name { font-family: var(--font-display); font-size: 20px; font-weight: 580; letter-spacing: -0.02em; color: var(--text-1); line-height: 1.15; }
.invite-org__meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 4px; }

.invitecard h1 { font-family: var(--font-display); font-size: 25px; line-height: 1.12; letter-spacing: -0.025em; font-weight: 580; margin: 0; }
.invitecard h1 em { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-weight: 500; color: var(--af-blue); }
.invitecard__sub { font-size: 14px; line-height: 1.55; color: var(--text-2); margin: 10px 0 0; }
.invitecard__sub b { color: var(--text-1); font-weight: 600; }

/* invite key facts */
.invite-facts { display: flex; flex-direction: column; gap: 0; margin: 20px 0 0; }
.invite-facts__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.invite-facts__row:last-child { border-bottom: 0; }
.invite-facts__l { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; }
.invite-facts__v { font-size: 13.5px; color: var(--text-1); font-weight: 550; text-align: right; }
.invite-facts__v .mono { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }

.invitecard__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.invitecard__actions .btn { width: 100%; justify-content: center; }
.invitecard__legal { font-size: 12px; color: var(--text-3); line-height: 1.5; text-align: center; margin: 16px 0 0; }
.invitecard__legal a { color: var(--text-2); border-bottom: 1px solid var(--border-strong); }

/* role chip used on invite */
.rolechip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--af-blue-50); color: var(--af-blue-700); border: 1px solid var(--af-blue-100); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
