/* ============================================
   CHUPA — Legal Pages (Privacy / Terms)
   Typography, TOC, anchor offsets, contact blocks
   ============================================ */

.legal-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 100px;
    position: relative;
}

.legal-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.legal-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 56px;
    align-items: start;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    width: fit-content;
    transition: all 0.3s var(--ease);
}

.back-link:hover {
    color: var(--accent-2);
    border-color: var(--accent);
    background: rgba(61, 220, 151, 0.06);
    transform: translateX(-2px);
}

.legal-header {
    grid-column: 2 / 3;
    margin-bottom: 0;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

.legal-title {
    font-family: 'Unbounded', sans-serif;
    font-weight: 900;
    font-size: clamp(32px, 4.5vw, 56px);
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.legal-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--text-dim);
}

.legal-meta strong {
    color: var(--text);
    font-weight: 600;
}

.legal-meta-sep {
    width: 4px;
    height: 4px;
    background: var(--text-mute);
    border-radius: 50%;
}

/* TOC */
.legal-toc {
    grid-column: 1 / 2;
    position: sticky;
    top: 120px;
    background: linear-gradient(180deg, rgba(17, 19, 26, 0.6), rgba(11, 12, 16, 0.6));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.legal-toc-title {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.legal-toc-list {
    list-style: none;
    counter-reset: toc-counter;
    padding: 0;
    margin: 0;
}

.legal-toc-list li {
    counter-increment: toc-counter;
    margin-bottom: 2px;
}

.legal-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-dim);
    border-radius: 8px;
    transition: all 0.2s var(--ease);
    line-height: 1.4;
}

.legal-toc-list a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    font-size: 10px;
    color: var(--text-mute);
    flex-shrink: 0;
    min-width: 20px;
    transition: color 0.2s var(--ease);
}

.legal-toc-list a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.legal-toc-list a:hover::before {
    color: var(--accent);
}

.legal-toc-list a.active {
    color: var(--accent-2);
    background: rgba(61, 220, 151, 0.08);
}

.legal-toc-list a.active::before {
    color: var(--accent);
}

/* Content */
.legal-content {
    grid-column: 2 / 3;
    max-width: 760px;
}

.legal-cta {
    margin-top: 0;
}

.legal-content section {
    margin-bottom: 56px;
    scroll-margin-top: 120px;
}

.legal-content h2 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: clamp(22px, 2.6vw, 30px);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    color: var(--text);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.legal-content h2::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.legal-content p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.legal-content p strong,
.legal-content p em {
    color: var(--text);
    font-style: normal;
    font-weight: 600;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 20px 0;
    padding: 0;
    list-style: none;
}

.legal-content ul li,
.legal-content ol li {
    position: relative;
    padding: 8px 0 8px 28px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
}

.legal-content ul li:last-child,
.legal-content ol li:last-child {
    border-bottom: none;
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

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

.legal-content ol li {
    counter-increment: ol-counter;
    padding-left: 36px;
}

.legal-content ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 4px;
    top: 12px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(61, 220, 151, 0.12);
    color: var(--accent-2);
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 11px;
    border-radius: 50%;
    box-shadow: none;
}

.legal-content strong {
    color: var(--text);
    font-weight: 600;
}

.legal-content em {
    color: var(--text-dim);
    font-style: italic;
}

.legal-content a {
    color: var(--accent-2);
    text-decoration: underline;
    text-decoration-color: rgba(61, 220, 151, 0.3);
    text-underline-offset: 3px;
    transition: all 0.2s var(--ease);
}

.legal-content a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.legal-content [data-fill] {
    background: rgba(61, 220, 151, 0.08);
    border-bottom: 1px dashed rgba(61, 220, 151, 0.4);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--accent-2);
    font-weight: 500;
}

/* Contact block */
.legal-contact {
    background: rgba(61, 220, 151, 0.05);
    border: 1px solid rgba(61, 220, 151, 0.15);
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 16px;
}

.legal-contact li {
    border-bottom: 1px solid rgba(61, 220, 151, 0.1) !important;
    padding: 10px 0 10px 28px !important;
}

.legal-contact li:last-child {
    border-bottom: none !important;
}

/* Requisites */
.legal-requisites {
    background: linear-gradient(135deg, rgba(17, 19, 26, 0.7), rgba(11, 12, 16, 0.7));
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 24px 28px;
    margin-top: 16px;
}

.legal-requisites p {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dim);
    border: none;
    padding: 0;
}

.legal-requisites p:last-child {
    margin-bottom: 0;
}

.legal-requisites strong {
    color: var(--text);
    font-weight: 600;
    margin-right: 6px;
}

.legal-requisites em {
    color: var(--text);
    font-style: italic;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px dashed var(--line-strong);
}

/* CTA */
.legal-cta {
    grid-column: 2 / 3;
    margin-top: 40px;
    padding: 36px;
    background: linear-gradient(135deg, rgba(17, 19, 26, 0.6), rgba(11, 12, 16, 0.6));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    text-align: center;
}

.legal-cta h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text);
}

.legal-cta p {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 20px;
}

.legal-cta .btn-discord {
    width: auto;
    display: inline-flex;
}

/* Footer legal link block */
.footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-legal a {
    color: var(--text-dim);
    font-size: 13px;
    transition: color 0.2s var(--ease);
}

.footer-legal a:hover {
    color: var(--accent-2);
}

.footer-legal-sep {
    color: var(--text-mute);
    font-size: 13px;
}

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

    .legal-toc,
    .legal-header,
    .legal-content,
    .legal-cta {
        grid-column: 1 / -1;
    }

    .legal-toc {
        position: static;
        max-height: none;
    }

    .legal-toc-list {
        columns: 2;
        column-gap: 24px;
    }

    .legal-toc-list li {
        break-inside: avoid;
    }
}

@media (max-width: 640px) {
    .legal-main {
        padding: 24px 16px 60px;
    }

    .legal-toc-list {
        columns: 1;
    }

    .legal-content h2 {
        font-size: 22px;
    }

    .legal-content p,
    .legal-content ul li,
    .legal-content ol li {
        font-size: 15px;
    }

    .legal-cta {
        padding: 28px 20px;
    }

    .legal-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Print */
@media print {
    .bg-ambient,
    .site-header,
    .back-link,
    .legal-toc,
    .legal-cta,
    .site-footer {
        display: none !important;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-content {
        color: #000;
    }

    .legal-content p,
    .legal-content li {
        color: #1a1a1a;
    }
}
