/* ==========================================================================
   LEGAL PAGES — Privacy, Terms, Refund, Cookie
   Matches PerfectChroma dark design system
   ========================================================================== */

/* ── Wrapper ── */
.legal-page-wrap {
    color: #f1f1f1;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* ── Hero ── */
.legal-hero {
    position: relative;
    padding: 140px 20px 80px;
    text-align: center;
    background: #050505;
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg,
        #ff0080 0%, #ff6b00 16%, #ffff00 33%,
        #00ff88 50%, #0088ff 66%, #8800ff 83%, #ff0080 100%) 1;
    border-image-slice: 1;
    overflow: hidden;
}

/* Hero grid mesh */
.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Hero center glow */
.legal-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at center 60%, rgba(20, 40, 120, 0.35) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.legal-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 0 auto;
}

.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 28px;
    font-family: 'Space Grotesk', sans-serif;
}

.legal-eyebrow svg {
    opacity: 0.55;
}

.legal-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 20px;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-meta {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.03em;
    margin-top: 4px;
}

/* ── Layout: sidebar TOC + content ── */
.legal-main {
    padding: 60px 20px 100px;
}

.legal-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 60px;
    align-items: start;
}

/* ── Sidebar Table of Contents ── */
.legal-toc {
    position: sticky;
    top: 100px;
    height: max-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
}
.legal-toc::-webkit-scrollbar { display: none; }

.legal-toc-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

.legal-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.legal-toc ul li a {
    display: block;
    padding: 7px 0 7px 16px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
    border-left: 2px solid transparent;
    margin-left: -1px;
    line-height: 1.4;
}

.legal-toc ul li a:hover {
    color: rgba(255, 255, 255, 0.85);
    border-left-color: rgba(255, 255, 255, 0.4);
}

/* ── Body Content ── */
.legal-body {
    min-width: 0;
}

.legal-body > * + * {
    margin-top: 1.4em;
}

.legal-body p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.65);
}

.legal-body h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 2.8em;
    margin-bottom: 0.5em;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    scroll-margin-top: 100px;
}

.legal-body h2:first-child {
    margin-top: 0;
}

.legal-body h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1.8em;
    margin-bottom: 0.4em;
    scroll-margin-top: 100px;
}

.legal-body ul,
.legal-body ol {
    padding-left: 1.4em;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.8;
}

.legal-body ul li,
.legal-body ol li {
    margin-bottom: 0.4em;
}

.legal-body strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.legal-body a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.2);
    transition: color 0.2s, text-decoration-color 0.2s;
}

.legal-body a:hover {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

/* ── Address block ── */
.legal-body address {
    font-style: normal;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 0.9rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 1em;
}

/* ── Cookie Table ── */
.legal-table-wrap {
    overflow-x: auto;
    margin-top: 1em;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.legal-table thead tr {
    background: rgba(255, 255, 255, 0.05);
}

.legal-table th {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.legal-table td {
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
    line-height: 1.5;
}

.legal-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.legal-table code {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.75);
}

/* ── Highlight / callout box ── */
.legal-callout {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    margin-top: 1em;
}

/* ── Numbered steps ── */
.legal-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: steps;
}

.legal-steps li {
    counter-increment: steps;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.93rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
}

.legal-steps li:last-child {
    border-bottom: none;
}

.legal-steps li::before {
    content: counter(steps);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 800px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .legal-toc {
        position: static;
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 10px;
        padding: 16px 20px;
        background: rgba(255,255,255,0.02);
    }

    .legal-hero {
        padding: 120px 20px 60px;
    }

    .legal-hero h1 {
        font-size: clamp(2rem, 7vw, 2.8rem);
    }
}

@media (max-width: 480px) {
    .legal-main {
        padding: 40px 16px 80px;
    }
}
