/* ============================================================
   LEGAL / POLICY PAGES — Terms, Privacy, Cookies, Refunds,
   EULA, Copyright, Account Deletion.

   Long-form documents need different treatment to the short
   .text-page screens (which stay centred): left-aligned copy, a
   comfortable measure, clear section hierarchy and a glassy
   document card matching the register/auth cards.
   Scoped to .legal-page so nothing else on the site is affected.
   ============================================================ */

.legal-page {

    /* ── Page header ─────────────────────────────────────────── */
    .hero .content h1 {
        text-align: center;
    }

    /* ── Document card ───────────────────────────────────────── */
    .sec1 {
        /* Override .text-page's centred layout — centred legal copy is
           hard to read over many paragraphs.
           NOTE: no max-width here. style.css sets `section { min-width: 1200px }`
           for the fixed desktop layout, and min-width always beats max-width, so
           the measure has to be constrained on the inner .legal-doc div instead. */
        text-align: left;
        margin: 0 auto 110px;
        /* Top padding gives the card room to breathe below the hero — the
           original .text-page rule used padding: 5%, which this replaces. */
        padding: 62px 20px 0;
    }

    .legal-doc {
        /* The reading measure — roughly 80 characters per line. */
        max-width: 860px;
        margin: 0 auto;
        background: rgba(12, 13, 16, 0.88);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        backdrop-filter: blur(18px) saturate(140%);
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 18px;
        box-shadow: 0 34px 70px -28px rgba(0, 0, 0, 0.95);
        padding: 44px 46px 48px;
        color: #c9cbd2;
        font-size: 0.97em;
        line-height: 1.8;
    }

    /* ── Effective-date chip ─────────────────────────────────── */
    .legal-meta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 30px;
        padding: 7px 15px;
        background: rgba(193, 145, 20, 0.1);
        border: 1px solid rgba(193, 145, 20, 0.32);
        border-radius: 100px;
        color: #d8ad3c;
        font-size: 0.82em;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-wrap: nowrap;

        strong {
            color: #d8ad3c;
            font-weight: 600;
        }
    }

    /* ── Body copy ───────────────────────────────────────────── */
    .legal-doc p {
        margin: 0 0 18px;
        text-wrap: initial;
        /* .text-page balances short paragraphs; long copy must not */
    }

    .legal-doc strong {
        color: #fff;
        font-weight: 600;
    }

    .legal-doc>p:first-of-type:not(.legal-meta) {
        font-size: 1.05em;
        color: #dfe1e7;
    }

    /* ── Section headings ────────────────────────────────────── */
    .legal-doc h2 {
        margin: 44px 0 16px;
        padding-top: 26px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 1.32em;
        font-weight: 700;
        line-height: 1.35;
        letter-spacing: -0.2px;
        scroll-margin-top: 130px;
    }

    .legal-doc h2:first-of-type {
        margin-top: 34px;
    }

    .legal-doc h3 {
        margin: 30px 0 12px;
        color: #d8ad3c;
        font-size: 1.04em;
        font-weight: 600;
        letter-spacing: 0.1px;
    }

    /* ── Lists ───────────────────────────────────────────────── */
    .legal-doc ul,
    .legal-doc ol {
        margin: 0 0 20px;
        padding: 0 0 0 4px;
        list-style: none;
    }

    .legal-doc li {
        position: relative;
        margin-bottom: 11px;
        padding-left: 26px;
    }

    .legal-doc ul li::before {
        content: "";
        position: absolute;
        left: 6px;
        top: 0.72em;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #c19114;
    }

    /* Numbered lists keep their numerals (used for the takedown
       procedure and cancellation steps). */
    .legal-doc ol {
        counter-reset: legal-ol;
    }

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

    .legal-doc ol li::before {
        content: counter(legal-ol) ".";
        position: absolute;
        left: 0;
        top: 0;
        color: #c19114;
        font-weight: 700;
        font-size: 0.92em;
    }

    /* ── Links ───────────────────────────────────────────────── */
    .legal-doc a {
        color: #d8ad3c;
        text-decoration: underline;
        text-underline-offset: 2px;
        text-decoration-color: rgba(216, 173, 60, 0.45);
        transition: color .2s ease, text-decoration-color .2s ease;

        &:hover {
            color: #eac352;
            text-decoration-color: #eac352;
        }
    }

    /* ── "On this page" jump nav (built by js/legal-toc.js) ──── */
    .legal-toc {
        margin: 0 0 8px;
        padding: 22px 26px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 14px;
    }

    .legal-toc .legal-toc-title {
        margin: 0 0 14px;
        color: #8b8e97;
        font-size: 0.74em;
        font-weight: 700;
        letter-spacing: 1.1px;
        text-transform: uppercase;
    }

    .legal-toc ol {
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 28px;
        counter-reset: none;
    }

    .legal-toc li {
        margin: 0;
        padding: 0;
        counter-increment: none;
    }

    .legal-toc li::before {
        display: none;
    }

    .legal-toc a {
        display: block;
        padding: 5px 0;
        color: #b6b9c1;
        font-size: 0.92em;
        text-decoration: none;
        border-bottom: 1px solid transparent;

        &:hover {
            color: #d8ad3c;
        }
    }

    /* ── Cross-links to the other documents ──────────────────── */
    .legal-related {
        margin-top: 44px;
        padding-top: 30px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .legal-related h2 {
        margin: 0 0 16px;
        padding-top: 0;
        border-top: 0;
        font-size: 1.05em;
    }

    .legal-related-links {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .legal-related-links a {
        padding: 9px 17px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 100px;
        color: #c9cbd2;
        font-size: 0.86em;
        text-decoration: none;
        transition: border-color .2s ease, color .2s ease, background .2s ease;

        &:hover {
            background: rgba(193, 145, 20, 0.1);
            border-color: rgba(193, 145, 20, 0.45);
            color: #d8ad3c;
        }
    }

    .legal-contact {
        margin-top: 30px;
        padding: 20px 24px;
        background: rgba(193, 145, 20, 0.06);
        border-left: 2px solid #c19114;
        border-radius: 10px;
        font-size: 0.92em;
    }
}

/* ── Tablet / mobile ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .legal-page {
        .legal-doc {
            padding: 32px 24px 38px;
            border-radius: 14px;
            line-height: 1.75;
        }

        .legal-doc h2 {
            margin-top: 36px;
            font-size: 1.18em;
        }

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

        .sec1 {
            padding: 40px 14px 0;
            margin-bottom: 70px;
        }
    }
}

@media (max-width: 520px) {
    .legal-page {
        .legal-doc {
            padding: 26px 18px 32px;
            font-size: 0.92em;
        }

        .legal-meta {
            text-wrap: initial;
        }
    }
}
