/* Legal pages (Terms, Privacy, Legal Notice, Prohibited Items, Reporting & Appeals).
   Left: table of contents + links to the other legal pages. Right: the document. */

.legal-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px 48px;
}

.legal-wrap {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.legal-wrap > * {
    min-width: 0;
}

.legal-toc {
    position: sticky;
    top: 84px;
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-card);
    font-size: 13px;
}
.legal-toc h2 {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 4px 8px 8px;
    margin: 0;
}
.legal-toc a {
    display: block;
    padding: 7px 8px;
    border-radius: 9px;
    color: var(--ink-2);
    text-decoration: none;
    line-height: 1.35;
}
.legal-toc a:hover {
    background: var(--stone);
    color: var(--ink);
}
.legal-toc a[aria-current="page"] {
    color: var(--ink);
    font-weight: 700;
}
.legal-toc .legal-toc-pages {
    border-top: 1px solid var(--stone-2);
    margin-top: 10px;
    padding-top: 10px;
}

.legal-doc {
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 40px 48px;
    max-width: 820px;
    color: var(--ink-2);
}
.legal-doc h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
    margin: 0;
}
.legal-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 20px;
}
.legal-meta span {
    background: var(--stone);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
}
.legal-meta .legal-draft {
    background: var(--sand-l);
    color: #8A6A12;
}

.legal-summary {
    background: var(--green-l);
    color: var(--green-d);
    border-radius: 16px;
    padding: 16px 18px;
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.6;
}
.legal-summary strong {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    margin-bottom: 4px;
}

.legal-doc section {
    scroll-margin-top: 90px;
}
.legal-doc h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 30px 0 8px;
}
.legal-doc h3 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    color: var(--ink);
    margin: 18px 0 6px;
}
.legal-doc p,
.legal-doc li {
    font-size: 15px;
    line-height: 1.75;
}
.legal-doc p + p {
    margin-top: 8px;
}
.legal-doc ul,
.legal-doc ol {
    padding-left: 22px;
    margin: 6px 0;
}
.legal-doc li + li:not(.legal-steps li):not(.legal-items li) {
    margin-top: 4px;
}
.legal-doc a {
    color: var(--green-d);
    font-weight: 600;
}
.legal-doc strong {
    color: var(--ink);
}

/* Text still to be filled in once the operating company exists */
.legal-placeholder {
    background: #FFF3B0;
    color: #5B4B12;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
}

.legal-table-wrap {
    overflow-x: auto;
    margin: 10px 0;
}
.legal-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.legal-doc th {
    text-align: left;
    font-size: 12px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 12px;
    background: var(--stone);
}
.legal-doc td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--stone-2);
    vertical-align: top;
    line-height: 1.5;
}
.legal-doc td:first-child {
    font-weight: 600;
    color: var(--ink);
}

.legal-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px 0 4px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.legal-steps li {
    background: var(--stone);
    border-radius: 16px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
    counter-increment: step;
    margin: 0;
}
.legal-steps li::before {
    content: counter(step);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}
.legal-steps li strong {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    margin-bottom: 4px;
}

.legal-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    margin: 10px 0;
    list-style: none;
}
.legal-items li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--stone);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}
.legal-items li i {
    color: #B3442A;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .legal-page {
        padding: 16px 16px 32px;
    }
    .legal-wrap {
        grid-template-columns: 1fr;
    }
    .legal-toc {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    /* Phones: skip the long contents list, keep the other legal pages as chips */
    .legal-toc > h2,
    .legal-toc > a,
    .legal-toc-pages h2 {
        display: none;
    }
    .legal-toc .legal-toc-pages {
        border: 0;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .legal-toc .legal-toc-pages a {
        flex-shrink: 0;
        background: #fff;
        border-radius: 999px;
        padding: 7px 12px;
        box-shadow: var(--shadow-card);
        white-space: nowrap;
    }
    .legal-toc .legal-toc-pages a[aria-current="page"] {
        background: var(--ink);
        color: #fff;
    }
    .legal-doc {
        padding: 24px 20px;
        border-radius: 18px;
    }
    .legal-doc h1 {
        font-size: 1.7rem;
    }
    .legal-steps,
    .legal-items {
        grid-template-columns: 1fr;
    }
}
