/* ============================================================
   Legal Pages — AfricSpend
   Inherits design tokens from index.css (loaded first)
   ============================================================ */

/* ---- Page shell ------------------------------------------- */
.legal-page {
    padding-top: 80px; /* clear fixed header */
    min-height: 100vh;
    background: #fafafa;
}

/* ---- Hero banner ------------------------------------------ */
.legal-hero {
    background: var(--dark);
    color: #fff;
    padding: 56px 0 48px;
    text-align: center;
}

.legal-hero .badge {
    display: inline-block;
    background: rgba(128, 0, 128, 0.25);
    color: #c084fc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.legal-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.legal-hero .meta {
    font-size: 13px;
    color: var(--muted2);
    margin-top: 12px;
}

/* ---- Body layout: sidebar TOC + content ------------------- */
.legal-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    align-items: start;
}

/* ---- Sidebar Table of Contents ---------------------------- */
.legal-toc {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    font-size: 13px;
}

.legal-toc h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

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

.legal-toc ol li {
    counter-increment: toc;
    margin-bottom: 6px;
}

.legal-toc ol li a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: var(--muted);
    line-height: 1.4;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.legal-toc ol li a::before {
    content: counter(toc) ".";
    font-size: 11px;
    color: var(--muted2);
    flex-shrink: 0;
}

.legal-toc ol li a:hover,
.legal-toc ol li a.active {
    background: #f5f0ff;
    color: purple;
}

/* ---- Main content card ------------------------------------ */
.legal-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 40px 48px;
}

.legal-content section {
    margin-bottom: 48px;
    scroll-margin-top: 100px;
}

.legal-content section:last-child {
    margin-bottom: 0;
}

.legal-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-content h2 .section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f5f0ff;
    color: purple;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.legal-content p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul,
.legal-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.legal-content li {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 4px;
}

.legal-content strong {
    color: var(--dark);
}

/* Highlight box */
.legal-content .callout {
    background: #fdf4ff;
    border-left: 3px solid purple;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.legal-content .callout strong {
    color: purple;
}

/* Warning box */
.legal-content .warning {
    background: #fff7ed;
    border-left: 3px solid #f97316;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #7c4a1e;
    line-height: 1.7;
}

/* ---- Contact chip ----------------------------------------- */
.contact-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f0ff;
    color: purple;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
}

.contact-chip:hover {
    background: purple;
    color: #fff;
}

/* ---- Legal nav tabs (switch between docs) ----------------- */
.legal-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
}

.legal-nav-inner {
    max-width: 1080px;
    margin: auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 0;
}

.legal-nav-inner a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    padding: 8px 18px;
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.legal-nav-inner a:hover {
    background: #f5f5f5;
    color: var(--dark);
}

.legal-nav-inner a.active {
    background: #f5f0ff;
    color: purple;
    font-weight: 600;
}

/* ---- Footer ------------------------------------------------ */
.legal-footer {
    background: var(--dark);
    color: var(--muted2);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

.legal-footer a {
    color: #c084fc;
    text-decoration: none;
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 768px) {
    .legal-body {
        grid-template-columns: 1fr;
        padding: 24px 16px 60px;
        gap: 24px;
    }

    .legal-toc {
        position: static;
    }

    .legal-content {
        padding: 24px 20px;
    }

    .legal-hero {
        padding: 40px 16px 32px;
    }
}
