/* =============================================================
   Coreza — Legal Pages (Terms of Service & Privacy Policy)
   Matches the Coreza design system (Outfit font, same CSS vars)
   ============================================================= */

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

:root {
    --c-dark:         #060C18;
    --c-dark-2:       #0C1526;
    --c-accent:       #5563E8;
    --c-accent-dim:   #4451D8;
    --c-accent-light: #8B96F8;
    --c-cyan:         #0EA5E9;
    --c-off-white:    #F7F9FC;
    --c-border:       #E2E8F2;
    --c-text:         #0A1628;
    --c-muted:        #64748B;
    --c-error:        #EF4444;
    --c-success:      #10B981;
    --c-warn-bg:      #FFFBEB;
    --c-warn-border:  #FDE68A;
    --c-warn-text:    #92400E;
    --c-info-bg:      #EFF6FF;
    --c-info-border:  #BFDBFE;
    --c-info-text:    #1E40AF;
    --font:           'Outfit', sans-serif;
    --r:              10px;
    --nav-h:          64px;
    --sidebar-w:      260px;
    --content-max:    760px;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--c-off-white);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    font-size: 1rem;
    line-height: 1.7;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.legal-nav {
    position: sticky; top: 0; z-index: 100;
    height: var(--nav-h);
    background: rgba(6, 12, 24, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center;
    padding: 0 32px;
    gap: 16px;
}
.legal-nav-brand {
    font-size: 1.1rem; font-weight: 800;
    color: #fff; letter-spacing: -.3px; text-decoration: none;
    flex-shrink: 0;
}
.legal-nav-divider {
    width: 1px; height: 20px;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.legal-nav-title {
    font-size: .875rem; font-weight: 600;
    color: rgba(255,255,255,0.55);
    flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legal-nav-links {
    display: flex; gap: 4px; flex-shrink: 0;
}
.legal-nav-link {
    font-size: .8rem; font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 20px;
    transition: all .15s;
}
.legal-nav-link:hover  { color: #fff; background: rgba(255,255,255,0.08); }
.legal-nav-link.active { color: #fff; background: var(--c-accent); }
.legal-nav-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all .15s;
    flex-shrink: 0;
}
.legal-nav-back:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.legal-nav-back svg { flex-shrink: 0; }

/* ── Layout ──────────────────────────────────────────────────── */
.legal-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: calc(100vh - var(--nav-h));
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px;
    gap: 48px;
    align-items: start;
}

/* ── Sidebar / TOC ───────────────────────────────────────────── */
.legal-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 20px 0;
    box-shadow: 0 2px 12px rgba(10,22,40,0.05);
    max-height: calc(100vh - var(--nav-h) - 48px);
    overflow-y: auto;
}
.legal-sidebar::-webkit-scrollbar { width: 4px; }
.legal-sidebar::-webkit-scrollbar-track { background: transparent; }
.legal-sidebar::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

.toc-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: #94A3B8;
    padding: 0 20px 12px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 8px;
}
.toc-list { list-style: none; }
.toc-list li a {
    display: block;
    padding: 7px 20px;
    font-size: .8rem; font-weight: 500;
    color: var(--c-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .12s;
    line-height: 1.4;
}
.toc-list li a:hover {
    color: var(--c-accent);
    background: rgba(85,99,232,0.04);
    border-left-color: rgba(85,99,232,0.3);
}
.toc-list li a.active {
    color: var(--c-accent);
    background: rgba(85,99,232,0.07);
    border-left-color: var(--c-accent);
    font-weight: 700;
}

/* ── Main Content ────────────────────────────────────────────── */
.legal-main {
    max-width: var(--content-max);
    width: 100%;
}

/* Hero / title block */
.legal-hero {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--c-border);
}
.legal-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(85,99,232,0.08); border: 1px solid rgba(85,99,232,0.2);
    color: var(--c-accent); font-size: .72rem; font-weight: 700;
    padding: 4px 12px; border-radius: 20px; letter-spacing: .07em;
    text-transform: uppercase; margin-bottom: 16px;
}
.legal-badge::before { content: ''; width: 6px; height: 6px; background: var(--c-accent); border-radius: 50%; }
.legal-h1 {
    font-size: 2rem; font-weight: 800;
    color: var(--c-text); letter-spacing: -.04em;
    line-height: 1.15; margin-bottom: 14px;
}
.legal-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    font-size: .82rem; color: var(--c-muted);
}
.legal-meta-item { display: flex; align-items: center; gap: 6px; }
.legal-meta-item svg { flex-shrink: 0; opacity: .6; }

/* Alert / notice boxes */
.legal-notice {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 20px; border-radius: 10px;
    margin-bottom: 32px;
    font-size: .875rem; line-height: 1.6;
}
.legal-notice.warn {
    background: var(--c-warn-bg);
    border: 1px solid var(--c-warn-border);
    color: var(--c-warn-text);
}
.legal-notice.info {
    background: var(--c-info-bg);
    border: 1px solid var(--c-info-border);
    color: var(--c-info-text);
}
.legal-notice-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.legal-notice strong { display: block; margin-bottom: 2px; }

/* Sections */
.legal-section {
    margin-bottom: 48px;
    scroll-margin-top: calc(var(--nav-h) + 24px);
}
.legal-section-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(85,99,232,0.08); border: 1px solid rgba(85,99,232,0.2);
    color: var(--c-accent); font-size: .72rem; font-weight: 800;
    flex-shrink: 0;
}
.legal-h2 {
    font-size: 1.25rem; font-weight: 800;
    color: var(--c-text); letter-spacing: -.025em;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border);
}
.legal-h3 {
    font-size: 1rem; font-weight: 700;
    color: var(--c-text); margin: 20px 0 8px;
}
.legal-section p {
    font-size: .9375rem; color: #374151;
    line-height: 1.75; margin-bottom: 14px;
}
.legal-section p:last-child { margin-bottom: 0; }

/* Lists */
.legal-list {
    list-style: none; margin: 12px 0 16px; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.legal-list li {
    display: flex; gap: 12px; align-items: flex-start;
    font-size: .9375rem; color: #374151; line-height: 1.65;
}
.legal-list li::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--c-accent); flex-shrink: 0;
    margin-top: 8px;
}
.legal-list.alpha { list-style: lower-alpha; padding-left: 24px; }
.legal-list.alpha li { display: list-item; }
.legal-list.alpha li::before { display: none; }

/* Ordered / numbered */
.legal-ol {
    list-style: none; counter-reset: legal-item;
    margin: 12px 0 16px; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.legal-ol > li {
    counter-increment: legal-item;
    display: flex; gap: 12px; align-items: flex-start;
    font-size: .9375rem; color: #374151; line-height: 1.65;
}
.legal-ol > li::before {
    content: counter(legal-item);
    min-width: 24px; height: 24px; border-radius: 6px;
    background: var(--c-off-white); border: 1px solid var(--c-border);
    color: var(--c-accent); font-size: .72rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}

/* Rights cards */
.rights-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px; margin: 16px 0;
}
.right-card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 12px; padding: 16px 18px;
    border-left: 3px solid var(--c-accent);
    transition: box-shadow .15s;
}
.right-card:hover { box-shadow: 0 4px 16px rgba(85,99,232,0.1); }
.right-card-icon { font-size: 1.5rem; margin-bottom: 8px; }
.right-card-title { font-size: .875rem; font-weight: 700; color: var(--c-text); margin-bottom: 4px; }
.right-card-desc { font-size: .8rem; color: var(--c-muted); line-height: 1.5; }

/* Contact card / DPO box */
.dpo-card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 14px; padding: 24px 28px;
    display: flex; gap: 20px; align-items: flex-start;
    box-shadow: 0 2px 12px rgba(10,22,40,0.05);
    margin-top: 16px;
}
.dpo-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(85,99,232,0.1); border: 1px solid rgba(85,99,232,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.dpo-info { flex: 1; }
.dpo-info strong { display: block; font-size: .9375rem; font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.dpo-info p { font-size: .875rem; color: var(--c-muted); margin: 0; line-height: 1.6; }
.dpo-info a { color: var(--c-accent); text-decoration: none; font-weight: 600; }
.dpo-info a:hover { text-decoration: underline; }

/* Law citations */
.law-ref {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(14,165,233,0.08); border: 1px solid rgba(14,165,233,0.2);
    color: #0369A1; font-size: .75rem; font-weight: 700;
    padding: 2px 8px; border-radius: 6px;
    letter-spacing: .02em; vertical-align: middle;
}

/* Emphasis / highlight inline */
.legal-hi {
    background: rgba(85,99,232,0.08);
    color: var(--c-accent);
    font-weight: 700;
    padding: 1px 5px; border-radius: 4px;
}

/* Table */
.legal-table-wrap { overflow-x: auto; margin: 16px 0; }
.legal-table {
    width: 100%; border-collapse: collapse;
    font-size: .875rem;
}
.legal-table th {
    background: #F1F5F9; color: #475569;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 10px 14px; text-align: left;
    border-bottom: 2px solid var(--c-border);
}
.legal-table td {
    padding: 10px 14px; color: #374151; line-height: 1.5;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table tr:hover td { background: rgba(85,99,232,0.02); }

/* Footer */
.legal-footer {
    margin-top: 60px; padding-top: 28px;
    border-top: 1px solid var(--c-border);
    text-align: center; color: var(--c-muted);
    font-size: .82rem; line-height: 1.7;
}
.legal-footer a { color: var(--c-accent); text-decoration: none; font-weight: 600; }
.legal-footer a:hover { text-decoration: underline; }
.legal-footer-brand { font-weight: 800; color: var(--c-text); }

/* Back to top */
.back-top {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--c-accent); color: #fff;
    font-size: .8rem; font-weight: 700; text-decoration: none;
    padding: 8px 16px; border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(85,99,232,0.3);
    transition: all .15s;
}
.back-top:hover { background: var(--c-accent-dim); transform: translateY(-1px); color: #fff; }

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

@media (max-width: 768px) {
    .legal-layout {
        grid-template-columns: 1fr;
        padding: 24px 16px;
    }
    .legal-sidebar { display: none; }
    .legal-nav-links { display: none; }
    .legal-h1 { font-size: 1.5rem; }
    .rights-grid { grid-template-columns: 1fr; }
    .dpo-card { flex-direction: column; }
}

@media (max-width: 480px) {
    .legal-nav { padding: 0 16px; }
    .legal-nav-title { display: none; }
    .legal-h1 { font-size: 1.3rem; }
    .legal-h2 { font-size: 1.1rem; }
}
