/* ============================================================
   Legal pages (Privacy, Terms) — landing-grade design
   ============================================================ */

.legal-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 64rem;
    margin-inline: auto;
    padding: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
}

/* ---- Sticky nav ---- */

.legal-header {
    position: sticky;
    top: 1rem;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 24px;
    background: rgba(10, 12, 18, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
}

.legal-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.legal-brand-image {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
}

.legal-nav {
    display: flex;
    gap: 0.25rem;
}

.legal-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.legal-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.legal-nav-link-active {
    color: #d7dcff;
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(129, 140, 248, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.legal-nav-link-active:hover {
    color: #e4e8ff;
    background: rgba(99, 102, 241, 0.2);
}

.legal-nav-login {
    margin-left: auto;
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.35rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(165, 180, 252, 0.2);
    transition: background 150ms ease, color 150ms ease;
}

.legal-nav-login:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
}

/* ---- Hero banner ---- */

.legal-hero {
    position: relative;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(4, 6, 10, 0.94), rgba(4, 6, 10, 0.86)),
        radial-gradient(ellipse at 20% 40%, rgba(99, 102, 241, 0.22), transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(99, 102, 241, 0.10), transparent 50%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.legal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at 15% 30%, rgba(129, 140, 248, 0.12), transparent 60%);
    pointer-events: none;
}

.legal-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 52rem;
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(129, 140, 248, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(99, 102, 241, 0.12);
    color: #d7dcff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.legal-hero h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.legal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.legal-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legal-hero-meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--text-muted);
}

/* ---- Article body ---- */

.legal-article {
    flex: 1;
    padding: 1.5rem clamp(0.5rem, 2vw, 2rem) 3rem;
    line-height: 1.78;
}

.legal-article h2 {
    position: relative;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 2.75rem;
    margin-bottom: 0.85rem;
    padding-left: 1rem;
    color: var(--text-primary);
}

.legal-article h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 3px;
    height: 1em;
    border-radius: 999px;
    background: linear-gradient(180deg, #818cf8, #6366f1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.legal-article p {
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
}

.legal-article ul,
.legal-article ol {
    margin-bottom: 1.1rem;
    padding-left: 0;
    list-style: none;
    color: var(--text-secondary);
}

.legal-article li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1.35rem;
}

.legal-article ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.legal-article ol {
    counter-reset: legal-ol;
}

.legal-article ol li {
    counter-increment: legal-ol;
}

.legal-article ol li::before {
    content: counter(legal-ol) ".";
    position: absolute;
    left: 0;
    color: #818cf8;
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.legal-article li strong {
    color: var(--text-primary);
}

.legal-article a {
    color: #a5b4fc;
    text-decoration: none;
    border-bottom: 1px solid rgba(165, 180, 252, 0.25);
    transition: color 150ms ease, border-color 150ms ease;
}

.legal-article a:hover {
    color: #c7d2fe;
    border-color: rgba(199, 210, 254, 0.5);
}

/* ---- Contact card ---- */

.legal-contact-card {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03));
    border: 1px solid rgba(129, 140, 248, 0.14);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.legal-contact-card p {
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1.85;
}

/* ---- Footer ---- */

.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    background: rgba(10, 12, 18, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.legal-footer-links {
    display: flex;
    gap: 1.25rem;
}

.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 150ms ease;
}

.legal-footer a:hover {
    color: var(--text-primary);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .legal-shell {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .legal-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        top: 0.5rem;
    }

    .legal-nav {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .legal-nav-link {
        font-size: 0.76rem;
        padding: 0.32rem 0.65rem;
    }

    .legal-hero {
        padding: 1.5rem 1.25rem;
    }

    .legal-hero h1 {
        font-size: 1.5rem;
    }

    .legal-article h2 {
        font-size: 1rem;
    }

    .legal-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
    }
}
