/*
 * Scout Support design system for the member facing pages.
 * Hand written, no build step. Tokens first, then the shared shell (header, account menu, banners),
 * then the components every page reuses (card, buttons, fields, notices).
 * The chat page's own rules live in css/chat.css.
 */

:root {
    color-scheme: light;
    --site-header-height: 6.6rem;

    --purple: #622599;
    --purple-deep: #4a1c73;
    --purple-tint: #f3eefa;
    --purple-soft: #e6dbf3;
    --yellow: #ffc124;
    --yellow-tint: #fff4d6;
    --yellow-line: #f0d27a;
    --ink: #18181b;
    --paper: #fafaf8;
    --surface: #ffffff;
    --line: #e4e4e7;
    --line-strong: #d4d4d8;
    --text: var(--ink);
    --text-muted: #52525b;
    --text-faint: #71717a;
    --green: #15803d;
    --green-tint: #eaf7ee;
    --green-line: #b7e3c4;
    --red: #b91c1c;
    --red-tint: #fdecec;
    --red-line: #f3b9b9;

    --radius-control: 12px;
    --radius-card: 16px;
    --shadow-card: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(98, 37, 153, 0.06);
    --shadow-pop: 0 12px 32px rgba(24, 24, 27, 0.14), 0 0 0 1px var(--line);
    --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    background: var(--paper);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--purple); }
a:hover { color: var(--purple-deep); }

/* Shell */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.trial-banner {
    background: var(--yellow-tint); border-bottom: 1px solid var(--yellow-line);
    color: var(--text-muted); font-size: 0.78rem; text-align: center; padding: 0.45rem 1rem;
}
.trial-banner-short { display: none; }
.impersonation-banner {
    background: var(--red-tint); border-bottom: 1px solid var(--red-line);
    color: var(--red); font-size: 0.8rem; text-align: center; padding: 0.45rem 1rem;
}
.impersonation-banner a { color: inherit; font-weight: 600; margin-left: 0.4rem; }
.page { position: relative; max-width: 1320px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.site-header .page { padding: 0 1rem; }
.site-main { flex: 1; }
.page-footer { width: 100%; padding-top: 0; padding-bottom: 0; }
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; }
.brand .brand-mark { width: 2rem; height: 2rem; flex: none; }
.brand h1 { font-size: 1.1rem; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.brand h1 a { color: var(--ink); text-decoration: none; }
.brand > span { font-size: 0.85rem; color: var(--text-muted); }

/* Site footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; }
.footer-row {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; color: var(--text-faint);
}
@media (min-width: 640px) { .footer-row { flex-direction: row; justify-content: space-between; } }
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
@media (min-width: 640px) { .footer-brand { align-items: flex-start; } }
.footer-brand .ssa-logo { width: 140px; }
.footer-membership { margin: 0; font-size: 0.72rem; color: var(--text-faint); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 0.75rem; }
.footer-links a { color: var(--text-faint); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--purple); }
.footer-links .dot { color: var(--line-strong); }

/* Account pin and menu */
.account { margin-left: auto; position: relative; }
.profile-pin {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.7rem 0.2rem 0.2rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    font: inherit; font-size: 0.8rem; color: var(--ink); cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.profile-pin:hover, .profile-pin[aria-expanded="true"] { background: var(--purple-tint); border-color: var(--purple-soft); }
.profile-avatar { position: relative; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; overflow: hidden; }
.profile-initials {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    background: var(--purple); color: #fff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
}
.profile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.profile-chevron {
    width: 0.4rem; height: 0.4rem; margin: 0 0.1rem 0.15rem 0; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg); opacity: 0.6;
}
.account-menu {
    position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 20; min-width: 12rem;
    padding: 0.4rem; border-radius: var(--radius-control); background: var(--surface); box-shadow: var(--shadow-pop);
}
.account-menu-name {
    padding: 0.45rem 0.7rem 0.55rem; font-size: 0.78rem; color: var(--text-faint);
    border-bottom: 1px solid var(--line); margin-bottom: 0.3rem;
}
.account-menu form { margin: 0; }
.account-menu a, .account-menu button {
    display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border: 0; border-radius: 8px;
    background: none; font: inherit; font-size: 0.85rem; color: var(--ink); text-decoration: none; cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--purple-tint); color: var(--purple-deep); }

/* Components */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
    box-shadow: var(--shadow-card); padding: 1.75rem;
}
.card-narrow { max-width: 26rem; margin: 2.5rem auto 0; }
.card h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.card-intro { font-size: 0.9rem; color: var(--text-muted); margin: 0.75rem 0 1.25rem; line-height: 1.5; }
.card-note { font-size: 0.78rem; color: var(--text-faint); margin: 1.1rem 0 0; line-height: 1.5; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.25rem; border: 1px solid transparent; border-radius: var(--radius-control);
    font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 6px 16px rgba(98, 37, 153, 0.22); }
.btn-primary:hover { background: var(--purple-deep); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--purple-tint); border-color: var(--purple-soft); color: var(--purple-deep); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn svg { width: 1rem; height: 1rem; }

.field { display: block; margin-bottom: 1rem; }
.field > span:first-child { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-muted); }
.field input {
    width: 100%; padding: 0.65rem 0.75rem; border-radius: var(--radius-control);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.field-invalid input { border-color: var(--red); }
.field-invalid > span:first-child { color: var(--red); }
.field-error { display: block; margin-top: 0.45rem; font-size: 0.82rem; line-height: 1.45; color: var(--red); }
.field-error a { color: inherit; font-weight: 600; }

.notice {
    display: flex; align-items: flex-start; gap: 0.6rem; border-radius: var(--radius-control); padding: 0.8rem 1rem;
    background: var(--purple-tint); border: 1px solid var(--purple-soft); color: var(--ink); font-size: 0.85rem; line-height: 1.5;
}
.notice svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.1rem; }
.notice-warn { background: var(--yellow-tint); border-color: var(--yellow-line); }
.notice-success { background: var(--green-tint); border-color: var(--green-line); }
.notice-success svg { color: var(--green); }
.notice-error { background: var(--red-tint); border-color: var(--red-line); color: var(--red); }

.divider { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0 0; font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.eyebrow { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--purple); font-weight: 600; }

/* Long form text pages (AI safety) */
.article { max-width: 720px; margin: 0 auto; padding-top: 1.25rem; }
.article h1 { margin: 0.35rem 0 0.9rem; font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
.article .lede { margin: 0 0 1.5rem; font-size: 1.02rem; line-height: 1.6; color: var(--text-muted); }
.article h2 { margin: 2rem 0 0.5rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); }
.article p, .article li { margin: 0 0 0.8rem; font-size: 0.95rem; line-height: 1.65; color: var(--text); }
.article ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.article li { margin-bottom: 0.5rem; }
.article strong { font-weight: 600; color: var(--ink); }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; color: var(--purple-deep); background: var(--purple-tint); border-radius: 6px; padding: 0.1em 0.3em; margin: 0 0.05em; }
.article-footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }

/* Phones */
@media (max-width: 760px) {
    :root { --site-header-height: 4.6rem; }
    .trial-banner { font-size: 0.72rem; padding: 0.3rem 0.75rem; }
    .trial-banner-long { display: none; }
    .trial-banner-short { display: inline; }
    .brand { padding: 0.45rem 0; }
    .brand .brand-mark { width: 1.6rem; height: 1.6rem; }
    .brand h1 { font-size: 1rem; }
    .brand > span { display: none; }
    .profile-pin { padding: 0.15rem; gap: 0; }
    .profile-name, .profile-chevron { display: none; }
}
@media (max-width: 480px) {
    .card-narrow { margin-top: 1rem; }
    .card { padding: 1.35rem 1.1rem; }
    .field input { font-size: 16px; }
}

/* Footer analytics note */
.footer-analytics { margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-faint); }
.footer-analytics a { color: inherit; }
