/* ============================================================
   Landing / welcome page (logged-out homepage at "/").
   Uses the portal's existing design tokens so it honors light/dark.
   Loaded only matters on the public landing; scoped under .landing.
   ============================================================ */

/* The public shell wraps pages in a centered .login-container (for the login
   card). When it contains the landing, relax it to a full-width flow. */
.login-container:has(.landing),
.login-container:has(.legal) {
    display: block;
    /* The global body is locked to height:100vh / overflow:hidden (for the app
       shell + login card), so the landing — which is taller than the viewport —
       needs its OWN scroll viewport, mirroring .main-content. Without this it
       gets clipped with no scrollbar on short screens. dvh handles mobile chrome. */
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: none;
    width: 100%;
    padding: 0;
    align-items: initial;
    justify-content: initial;
}
.login-container:has(.landing) #main-inner,
.login-container:has(.legal) #main-inner { width: 100%; max-width: none; }

/* Auth pages (login/signup/reset/…) wrapped in the shared chrome: top bar, the
   card centered on a surface in a hero area, trust strip, footer. */
.auth-page { display: flex; flex-direction: column; min-height: 100%; }
.auth-hero { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: var(--space-12) var(--space-6); }
.auth-page .login-card {
    background: var(--bg-surface); border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}

.landing {
    width: 100%;
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: var(--leading-normal);
}
.landing *, .landing *::before, .landing *::after { box-sizing: border-box; }

/* ---- shared layout ---- */
.landing-section,
.landing-hero-inner,
.landing-topbar-inner,
.landing-footer-inner,
.landing-cta-band {
    max-width: 1080px;
    margin: 0 auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* ---- top bar ---- */
.landing-topbar {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-primary);
}
.landing-topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.landing-topnav { display: flex; align-items: center; gap: var(--space-3); }
.landing-logo-plate {
    display: inline-flex; align-items: center;
    background: #fff; border-radius: var(--radius-md);
    padding: 6px 10px; box-shadow: var(--shadow-xs);
}
.landing-logo { display: block; height: 38px; width: auto; }
.landing-icon-btn {
    background: none; border: 1px solid var(--border-primary); color: var(--text-secondary);
    width: 34px; height: 34px; border-radius: var(--radius-md); cursor: pointer;
    font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.landing-icon-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

/* ---- hero (branded accent band) ---- */
.landing-hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--text-on-accent);
    text-align: center;
}
.landing-hero-inner { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.landing-eyebrow {
    text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xl);
    font-weight: 700; opacity: 0.9; margin: 0 0 var(--space-4);
}
.landing-h1 {
    font-size: clamp(2rem, 5vw, 3rem); line-height: var(--leading-tight);
    font-weight: 800; margin: 0 auto var(--space-5); max-width: 16ch;
}
.landing-sub {
    font-size: var(--text-lg); opacity: 0.95; max-width: 60ch; margin: 0 auto var(--space-8);
}
.landing-hero-cta { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.landing-hero-note { margin: var(--space-5) 0 0; font-size: var(--text-sm); opacity: 0.8; }
/* High-contrast CTAs on the accent band */
.landing-hero .btn-primary,
.landing-cta-band .btn-primary {
    background: #fff; color: var(--accent); border-color: #fff;
}
.landing-hero .btn-primary:hover,
.landing-cta-band .btn-primary:hover { background: hsl(0 0% 92%); color: var(--accent-hover); }
.landing-hero .btn-ghost {
    background: transparent; color: #fff; border: 1px solid hsla(0, 0%, 100%, 0.6);
}
.landing-hero .btn-ghost:hover { background: hsla(0, 0%, 100%, 0.12); }
.landing-hero .btn, .landing-cta-band .btn { padding: 10px 22px; font-size: var(--text-md); }

/* ---- generic section ---- */
.landing-section { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.landing-section-alt { background: var(--bg-secondary); max-width: none; }
.landing-section-alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.landing-h2 {
    font-size: var(--text-3xl); font-weight: 700; text-align: center;
    margin: 0 auto var(--space-10); color: var(--text-primary);   /* auto side margins keep the block centered in .landing-section-alt (capped to 1080px) */
}

/* ---- how it works ---- */
.landing-steps {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6);
}
.landing-step {
    background: var(--bg-surface); border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg); padding: var(--space-6); text-align: center;
}
.landing-step-num {
    width: 40px; height: 40px; margin: 0 auto var(--space-4); border-radius: 50%;
    background: var(--accent-muted); color: var(--accent-text);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--text-lg);
}
.landing-step-title { font-size: var(--text-md); font-weight: 600; margin: 0 0 var(--space-2); }
.landing-step-text { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* ---- why join ---- */
.landing-features {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6) var(--space-8);
}
.landing-feature { display: flex; gap: var(--space-4); align-items: flex-start; }
.landing-feature-check {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-muted); color: var(--accent-text);
    display: flex; align-items: center; justify-content: center; font-weight: 700; margin-top: 2px;
}
.landing-feature-title { font-size: var(--text-md); font-weight: 600; margin: 0 0 var(--space-1); }
.landing-feature-text { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* ---- trust strip ---- */
.landing-trust { padding: var(--space-10) var(--space-6); border-top: 1px solid var(--border-primary); }
.landing-trust-row {
    display: flex; gap: var(--space-6); align-items: center; justify-content: center; flex-wrap: wrap;
}
.landing-trust-chip {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: var(--radius-md); padding: 10px 16px; box-shadow: var(--shadow-xs);
}
.landing-trust-badge { display: block; height: 44px; width: auto; }

/* ---- bottom CTA band ---- */
.landing-cta-band {
    max-width: none; text-align: center;
    background: var(--bg-secondary);
    padding: var(--space-16) var(--space-6);
}
.landing-cta-title { font-size: var(--text-2xl); font-weight: 700; margin: 0 0 var(--space-6); }
/* On the muted band, reuse the standard accent primary (not the white hero variant) */
.landing-cta-band .btn-primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.landing-cta-band .btn-primary:hover { background: var(--accent-hover); }

/* ---- footer ---- */
.landing-footer { background: var(--bg-sidebar); border-top: 1px solid var(--border-primary); }
.landing-footer-inner {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4);
    padding-top: var(--space-6); padding-bottom: var(--space-6);
}
.landing-foot-copy { font-size: var(--text-sm); color: var(--text-tertiary); }
.landing-foot-nav { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.landing-foot-link { font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; }
.landing-foot-link:hover { color: var(--text-primary); text-decoration: underline; }

/* ---- responsive ---- */
@media (max-width: 880px) {
    .landing-steps { grid-template-columns: repeat(2, 1fr); }
    .landing-features { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .landing-steps { grid-template-columns: 1fr; }
    .landing-hero-inner { padding-top: var(--space-12); padding-bottom: var(--space-12); }
    .landing-section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
    .landing-topnav { gap: var(--space-2); }
    .landing-topnav .btn { padding: 6px 12px; }
}

/* ============================================================
   Legal / content pages (e.g. /tos). Readable centered article that honors
   light/dark via tokens. Logged-out it sits between the shared public top bar
   + footer; logged-in it renders inside the app shell's scroll area.
   ============================================================ */
.landing-logo-link { display: inline-flex; text-decoration: none; border-radius: var(--radius-md); }

.legal { width: 100%; font-family: var(--font-sans); color: var(--text-primary); }
.legal *, .legal *::before, .legal *::after { box-sizing: border-box; }
.legal-article {
    max-width: 760px; margin: 0 auto;
    padding: var(--space-12) var(--space-6) var(--space-16);
}
.legal-h1 { font-size: var(--text-3xl); font-weight: 700; margin: 0 0 var(--space-2); color: var(--text-primary); }
.legal-updated { font-size: var(--text-sm); color: var(--text-tertiary); margin: 0 0 var(--space-8); }
.legal-section { margin: 0 0 var(--space-8); }
.legal-h2 { font-size: var(--text-lg); font-weight: 600; margin: 0 0 var(--space-3); color: var(--text-primary); }
.legal-p {
    font-size: var(--text-base); line-height: var(--leading-relaxed);
    color: var(--text-secondary); margin: 0 0 var(--space-4);
}
.legal-list { margin: 0 0 var(--space-4); padding-left: var(--space-6); }
.legal-list li {
    font-size: var(--text-base); line-height: var(--leading-relaxed);
    color: var(--text-secondary); margin: 0 0 var(--space-2);
}
.legal-link { color: var(--accent-text); text-decoration: underline; }
.legal-intro { font-size: var(--text-md); color: var(--text-secondary); line-height: var(--leading-relaxed); margin: 0 0 var(--space-6); }
.legal-callout { background: var(--bg-surface); border: 1px solid var(--border-primary); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); margin: 0 0 var(--space-6); }
.legal-callout-title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text-primary); margin: 0 0 var(--space-2); }
.legal-callout-text { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); margin: 0 0 var(--space-3); }
.legal-callout-link { display: inline-block; color: var(--accent-text); font-weight: var(--weight-medium); font-size: var(--text-sm); text-decoration: none; }
.legal-callout-link:hover { text-decoration: underline; }

/* ---- contact / request forms (/contact, /ccpa) ---- */
.contact-wrap { max-width: 560px; margin: 0 auto; padding: var(--space-12) var(--space-6) var(--space-16); }
.ccpa-page .contact-wrap { max-width: 760px; }   /* match the .legal-article width used by Terms + Privacy */
.contact-form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); }
.contact-label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.contact-label > span { font-weight: 600; color: var(--text-primary); }
.form-textarea { min-height: 140px; resize: vertical; font-family: inherit; line-height: var(--leading-normal); }
.ccpa-types { display: flex; flex-direction: column; gap: var(--space-2); }
.ccpa-option { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); font-weight: 400; cursor: pointer; }
.ccpa-option input { margin-top: 3px; flex: none; }
.contact-form .btn { align-self: flex-start; padding: 10px 22px; }
.contact-success { padding: var(--space-12) 0; }
/* Honeypot — visually hidden + off-screen, not announced to assistive tech. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* reCAPTCHA v3: hide the floating badge in favor of the text disclosure below the form. */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-note { font-size: var(--text-xs); color: var(--text-tertiary); margin: var(--space-2) 0 0; line-height: var(--leading-normal); }
.recaptcha-note a { color: var(--accent-text); text-decoration: underline; }
