/* Brainfire AI — legal & support pages */

:root {
    --bg: #F6F8F5;
    --bg-glow: rgba(63, 178, 104, 0.16);
    --surface: #FFFFFF;
    --surface-2: #EEF4EF;
    --border: rgba(18, 48, 30, 0.10);
    --border-strong: rgba(18, 48, 30, 0.18);
    --text: #13211A;
    --muted: #45584E;
    --dim: #76877D;
    --accent: #2E9C5A;
    --accent-strong: #1E7442;
    --accent-soft: rgba(46, 156, 90, 0.11);
    --amber: #C98516;
    --amber-soft: rgba(232, 162, 58, 0.14);
    --danger-soft: rgba(214, 69, 69, 0.10);
    --shadow: 0 1px 2px rgba(16, 40, 24, 0.04), 0 8px 24px rgba(16, 40, 24, 0.06);
    --radius: 18px;
    --radius-sm: 12px;
    --header-h: 64px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A100D;
        --bg-glow: rgba(91, 208, 138, 0.12);
        --surface: #111915;
        --surface-2: #17221C;
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.14);
        --text: #E8F0EB;
        --muted: #A6B6AD;
        --dim: #6E8077;
        --accent: #5BD08A;
        --accent-strong: #86E2AA;
        --accent-soft: rgba(91, 208, 138, 0.12);
        --amber: #F2B65A;
        --amber-soft: rgba(242, 182, 90, 0.12);
        --danger-soft: rgba(240, 100, 100, 0.12);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
        color-scheme: dark;
    }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: -240px 0 auto 0;
    height: 620px;
    background: radial-gradient(ellipse 60% 70% at 50% 0%, var(--bg-glow), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
strong { color: var(--text); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 16px; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px var(--border); }

.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 999px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }

.lang-switch { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.lang-switch button {
    border: 0;
    background: none;
    color: var(--muted);
    font: 600 12px/1 'Inter', sans-serif;
    letter-spacing: .04em;
    padding: 7px 11px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .lang-switch button[aria-pressed="true"] { color: #08130D; } }

/* Layout */
main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 56px 24px 96px; }

.hero { max-width: 760px; margin-bottom: 40px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.eyebrow svg { width: 14px; height: 14px; }

h1 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(34px, 5.4vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--dim); font-size: 14px; margin-bottom: 20px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; }

.lead { font-size: 18px; color: var(--muted); line-height: 1.65; }

/* Summary cards */
.glance { margin-bottom: 56px; }
.glance-title { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.glance-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.glance-card .ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.glance-card .ic svg { width: 20px; height: 20px; }
.glance-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.glance-card p { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* Document */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 820px; }

.toc { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; padding-right: 4px; }
.toc-title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.toc ol { list-style: none; border-left: 1px solid var(--border); }
.toc a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.45;
    padding: 6px 0 6px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 500; }

.toc-mobile { display: none; margin-bottom: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toc-mobile summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary svg { width: 18px; height: 18px; transition: transform .2s; color: var(--dim); }
.toc-mobile[open] summary svg { transform: rotate(180deg); }
.toc-mobile ol { padding: 0 18px 14px 38px; color: var(--dim); font-size: 14px; }
.toc-mobile li { padding: 4px 0; }
.toc-mobile a { color: var(--muted); text-decoration: none; }

.section { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; margin-bottom: 0; }

h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(21px, 2.6vw, 25px);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
h2 .num { flex: none; font-size: 13px; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 8px; padding: 3px 8px; transform: translateY(-3px); font-variant-numeric: tabular-nums; }
h2 .anchor { opacity: 0; color: var(--dim); text-decoration: none; font-weight: 400; transition: opacity .15s; }
h2:hover .anchor { opacity: 1; }

h3.sub { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }

.section p { color: var(--muted); margin-bottom: 14px; }
.section p:last-child { margin-bottom: 0; }

.section ul { list-style: none; margin: 10px 0 16px; }
.section ul li { position: relative; color: var(--muted); padding: 5px 0 5px 24px; }
.section ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 15px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .75;
}

.note {
    display: flex;
    gap: 14px;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 18px 0;
}
.note svg { flex: none; width: 20px; height: 20px; color: var(--accent-strong); margin-top: 3px; }
.note p { margin: 0 !important; color: var(--text) !important; font-size: 15px; }
.note.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.note.warn svg { color: var(--amber); }

.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); background: var(--surface-2); }
td { color: var(--muted); }
td:first-child { color: var(--text); font-weight: 500; }
tr:last-child td { border-bottom: 0; }

.steps { counter-reset: step; list-style: none; margin: 12px 0 16px; }
.steps li { counter-increment: step; position: relative; padding: 6px 0 6px 40px; color: var(--muted); }
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 50%;
}

/* Support */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; margin: 8px 0 18px; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.contact-card .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.contact-card .ic svg { width: 20px; height: 20px; }
.contact-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.contact-card p { font-size: 14px; margin-bottom: 12px !important; }
.contact-card a { font-weight: 600; font-size: 14px; word-break: break-all; }

.faq { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 600; font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-2); }
.faq summary svg { flex: none; width: 18px; height: 18px; color: var(--dim); transition: transform .2s; }
.faq details[open] summary svg { transform: rotate(180deg); color: var(--accent-strong); }
.faq .answer { padding: 0 20px 18px; }
.faq .answer p { font-size: 15px; }

/* Footer */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 32px 24px 40px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; color: var(--dim); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: no-preference) {
    .hero, .glance, .doc { animation: rise .5s ease both; }
    .glance { animation-delay: .06s; }
    .doc { animation-delay: .12s; }
    @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 960px) {
    .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .toc { display: none; }
    .toc-mobile { display: block; }
}

@media (max-width: 720px) {
    :root { --header-h: 108px; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px 10px; row-gap: 10px; }
    .main-nav { order: 3; width: 100%; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; }
    .main-nav::-webkit-scrollbar { display: none; }
    .lang-switch { margin-left: auto; }
    main { padding: 36px 16px 80px; }
    .lead { font-size: 17px; }
    .glance { margin-bottom: 40px; }
    .footer-inner { padding: 28px 16px 36px; }
}

@media print {
    body::before, .site-header, .toc, .toc-mobile, .to-top, .glance { display: none !important; }
    body { background: #fff; color: #000; }
    main { padding: 0; }
    .doc { display: block; }
    .section { break-inside: avoid-page; }
    a { color: #000; }
}
