@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ============================================
   Legal Pages — Shared Stylesheet
   Covers /pages/privacy/ and /pages/terms/
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ap-text-secondary);
    background: var(--ap-bg-page);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ============================================
   Hero
   ============================================ */
.legal-hero {
    background: var(--ap-bg-card);
    border-bottom: 1px solid var(--ap-border);
    padding-top: calc(72px + 64px);
    padding-bottom: 56px;
}

.legal-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 48px;
}

.legal-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ap-text-placeholder);
    margin-bottom: 24px;
}

.legal-breadcrumb a {
    color: var(--ap-text-muted);
    transition: color 0.15s;
}

.legal-breadcrumb a:hover { color: var(--ap-text-primary); }

.legal-breadcrumb svg { color: var(--ap-border-hover); }

.legal-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.6px;
    line-height: 1.15;
    margin-bottom: 12px;
}

.legal-hero > .legal-hero-inner > p {
    font-size: 1.0625rem;
    color: var(--ap-text-muted);
    max-width: 520px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.legal-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ap-accent);
    background: var(--ap-accent-light);
    border: 1px solid var(--ap-accent-muted);
    border-radius: 6px;
    padding: 3px 9px;
}

.legal-updated {
    font-size: 13px;
    color: var(--ap-text-placeholder);
}

/* ============================================
   Two-column layout
   ============================================ */
.legal-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 48px 96px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 64px;
    align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */
.legal-sidebar {
    position: sticky;
    top: calc(72px + 32px);
}

.legal-toc {
    padding: 20px;
    background: var(--ap-bg-card);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
}

.legal-toc-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ap-text-placeholder);
    margin-bottom: 14px;
}

.legal-toc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legal-toc-link {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ap-text-muted);
    padding: 5px 10px;
    border-radius: 7px;
    transition: all 0.15s;
}

.legal-toc-link:hover {
    color: var(--ap-text-primary);
    background: var(--ap-bg-hover);
}

.legal-toc-link.active {
    color: var(--ap-accent);
    background: var(--ap-accent-light);
}

/* ============================================
   Main content
   ============================================ */
.legal-content {
    min-width: 0;
}

.legal-lead {
    font-size: 1.0625rem;
    color: var(--ap-text-secondary);
    line-height: 1.75;
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--ap-border);
}

.legal-section {
    padding: 40px 0;
    border-bottom: 1px solid var(--ap-border);
}

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

.legal-section h2 {
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ap-text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

.legal-section-num {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--ap-text-placeholder);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    padding-top: 2px;
}

.legal-section p {
    font-size: 15px;
    color: var(--ap-text-secondary);
    line-height: 1.75;
    margin-bottom: 16px;
}

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

.legal-section p strong {
    color: var(--ap-text-primary);
    font-weight: 600;
}

.legal-section p em {
    color: var(--ap-text-secondary);
}

.legal-list {
    list-style: none;
    margin: 12px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-list li {
    font-size: 15px;
    color: var(--ap-text-secondary);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ap-border-hover);
}

.legal-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ap-accent);
    background: var(--ap-accent-light);
    border: 1px solid var(--ap-accent-muted);
    border-radius: 9px;
    padding: 10px 18px;
    transition: all 0.15s;
}

.legal-contact-link:hover {
    background: var(--ap-accent-muted);
    border-color: var(--ap-accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.15);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 24px 64px;
    }

    .legal-sidebar {
        position: static;
    }

    .legal-hero-inner,
    .legal-layout {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 640px) {
    .legal-hero {
        padding-top: calc(72px + 40px);
        padding-bottom: 40px;
    }

    .legal-hero h1 {
        font-size: 1.875rem;
    }

    .legal-layout {
        padding: 32px 20px 48px;
    }
}
