:root {
    color-scheme: dark;
    --background: #070a12;
    --card: #0d111c;
    --card-soft: #101522;
    --foreground: #f4f6fb;
    --muted: #9299aa;
    --primary: #6682ed;
    --primary-hover: #7892f3;
    --border: #202636;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
a { color: inherit; }
svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.legal-head {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: 65px;
    border-bottom: 1px solid rgba(32, 38, 54, .85);
    background: rgba(7, 10, 18, .8);
    backdrop-filter: blur(14px);
}
.legal-head-inner {
    width: min(calc(100% - 32px), 1600px);
    height: 100%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.back {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9px;
    color: var(--foreground);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.back:hover { background: rgba(102, 130, 237, .1); color: var(--primary-hover); }
.back svg { width: 16px; height: 16px; }
.brand { width: 40px; height: 40px; display: block; }
.brand img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

.legal-main {
    width: min(calc(100% - 32px), 1024px);
    margin: auto;
    padding: 115px 0 80px;
}
.legal-hero { text-align: center; margin-bottom: 38px; }
.hero-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: rgba(102, 130, 237, .11);
}
.hero-icon svg { width: 24px; height: 24px; }
h1, h2 { font-family: 'Poppins', sans-serif; }
h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    line-height: 1.2;
    letter-spacing: -.035em;
    font-weight: 800;
}
h1 span { color: var(--primary); }
.legal-hero p {
    max-width: 650px;
    margin: 10px auto 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.7;
}

.legal-nav {
    height: 45px;
    margin-bottom: 30px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.legal-nav button {
    min-width: 0;
    border: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 700;
    transition: color .2s, background .2s, transform .2s;
}
.legal-nav button:hover { color: var(--foreground); background: rgba(255, 255, 255, .035); }
.legal-nav button.active { color: #fff; background: var(--primary); box-shadow: 0 2px 8px rgba(102, 130, 237, .28); }
.legal-nav button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.legal-nav svg { width: 15px; height: 15px; flex: none; }

.content {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    padding: 28px 32px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .13);
    animation: reveal .22s ease;
}
.content[hidden] { display: none; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.content-title {
    min-height: 43px;
    padding-bottom: 17px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--border);
}
.content-title svg { width: 21px; height: 21px; color: var(--primary); flex: none; }
.content-title h2 { margin: 0; font-size: 1.04rem; line-height: 1.35; font-weight: 700; }
.content-body { color: var(--muted); font-size: .84rem; }
.content-body > :first-child { margin-top: 0; }
.content-body > :last-child { margin-bottom: 0; }
.content-body p { margin: 0 0 15px; }
.content-body h1, .content-body h2, .content-body h3, .content-body h4 {
    margin: 22px 0 8px;
    color: var(--foreground);
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 700;
}
.content-body ul, .content-body ol { margin: 8px 0 15px; padding-left: 24px; }
.content-body li { margin: 5px 0; }
.content-body strong { color: #dbe0ec; }

.help {
    margin-top: 40px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border: 1px solid rgba(102, 130, 237, .22);
    border-radius: 16px;
    background: rgba(102, 130, 237, .055);
}
.help h2 { margin: 0 0 5px; font-size: 1.02rem; }
.help p { max-width: 590px; margin: 0; color: var(--muted); font-size: .8rem; }
.help a {
    min-width: 151px;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(102, 130, 237, .2);
    transition: background .2s, transform .2s;
}
.help a:hover { background: var(--primary-hover); transform: translateY(-1px); }
.legal-foot { padding: 0 16px 28px; text-align: center; color: #626a7b; font-size: .72rem; }

@media (max-width: 640px) {
    .legal-head { height: 61px; }
    .legal-main { padding-top: 92px; padding-bottom: 55px; }
    .legal-hero { margin-bottom: 25px; }
    .hero-icon { width: 42px; height: 42px; border-radius: 11px; }
    .hero-icon svg { width: 21px; height: 21px; }
    h1 { font-size: 1.55rem; }
    .legal-hero p { font-size: .75rem; }
    .legal-nav { height: 43px; margin-bottom: 20px; }
    .legal-nav button { font-size: 0; gap: 0; }
    .legal-nav button svg { width: 17px; height: 17px; }
    .content { padding: 20px; }
    .content-title { margin-bottom: 18px; padding-bottom: 15px; }
    .content-title h2 { font-size: .92rem; }
    .content-body { font-size: .78rem; }
    .help { margin-top: 26px; padding: 22px; flex-direction: column; text-align: center; gap: 18px; }
    .help a { width: 100%; }
}
