/* ============================================
   whazora.com — Legal pages (privacy / terms)
   Editorial layout, dark + emerald, sticky TOC
   ============================================ */

:root {
    --legal-bg: #060709;
    --legal-surface: #0d1014;
    --legal-surface-2: #14181f;
    --legal-border: rgba(255, 255, 255, 0.06);
    --legal-border-hover: rgba(255, 255, 255, 0.12);
    --legal-text-1: #f0f4f8;
    --legal-text-2: #a9b3c2;
    --legal-text-3: #6c7382;
    --legal-emerald: #4a9d78;
    --legal-emerald-mid: #3a8566;
    --legal-emerald-deep: #356f49;
    --legal-emerald-glow: rgba(74, 157, 120, 0.12);
    --legal-emerald-faint: rgba(74, 157, 120, 0.04);
    --legal-font: 'DM Sans', system-ui, -apple-system, sans-serif;
    --legal-font-display: 'Outfit', sans-serif;
    --legal-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --legal-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--legal-font);
    background: var(--legal-bg);
    color: var(--legal-text-2);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* Ambient background */
.legal-bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 38% at 15% 12%, rgba(74, 157, 120, 0.035), transparent 65%),
        radial-gradient(ellipse 40% 45% at 88% 90%, rgba(74, 157, 120, 0.018), transparent 70%);
}

.legal-bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(74, 157, 120, 0.014) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 157, 120, 0.014) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black 20%, transparent 75%);
}

/* Container */
.legal-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

/* ============================================
   NAV
   ============================================ */
.legal-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(6, 7, 9, 0.78);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--legal-border);
}

.legal-nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--legal-border);
    background: rgba(255, 255, 255, 0.018);
    color: var(--legal-text-2);
    font-size: 0.8746rem;
    font-weight: 600;
    transition: all 0.3s var(--legal-ease);
}

.legal-back i {
    font-size: 0.8026rem;
    color: var(--legal-emerald);
    transition: transform 0.3s var(--legal-ease);
}

.legal-back:hover {
    border-color: rgba(74, 157, 120, 0.32);
    background: rgba(74, 157, 120, 0.05);
    color: var(--legal-text-1);
}

.legal-back:hover i { transform: translateX(-2px); }

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.legal-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid rgba(74, 157, 120, 0.22);
}

.legal-brand-text {
    font-family: var(--legal-font-display);
    font-size: 1.1319rem;
    font-weight: 800;
    color: var(--legal-text-1);
    letter-spacing: -0.5px;
}

.legal-brand-dot { color: var(--legal-emerald); }

.legal-nav-spacer { flex: 1; min-width: 0; }

/* Language switcher (matches login globe FR/EN) */
.legal-lang {
    position: relative;
    flex-shrink: 0;
}
.legal-lang .btn-lang {
    background: transparent;
    border: 1px solid var(--legal-border);
    color: var(--legal-text-2);
    font-size: 0.8026rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--legal-font);
    transition: all 0.3s var(--legal-ease);
}
.legal-lang .btn-lang:hover {
    border-color: rgba(74, 157, 120, 0.32);
    color: var(--legal-text-1);
}
.legal-lang .btn-lang i { color: var(--legal-emerald); font-size: 0.8746rem; }
.legal-lang .lang-modal {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--legal-surface-2);
    border: 1px solid var(--legal-border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    padding: 6px;
    min-width: 130px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.98);
    transition: opacity 0.2s var(--legal-ease), transform 0.2s var(--legal-ease), visibility 0.2s;
    z-index: 60;
}
.legal-lang .lang-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.legal-lang .lang-option {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8026rem;
    font-weight: 500;
    color: var(--legal-text-2);
    transition: background 0.12s;
}
.legal-lang .lang-option:hover { background: rgba(255, 255, 255, 0.04); }
.legal-lang .lang-option.active {
    background: var(--legal-emerald-faint);
    color: var(--legal-emerald);
    font-weight: 600;
}

/* ============================================
   HEADER
   ============================================ */
.legal-header {
    padding: 72px 0 56px;
    text-align: left;
    max-width: 820px;
}

.legal-tag {
    font-family: var(--legal-font-display);
    font-size: 0.7203rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--legal-emerald);
    margin-bottom: 18px;
}

.legal-header h1 {
    font-family: var(--legal-font);
    font-size: clamp(2.2638rem, 4.5vw, 3.4986rem);
    font-weight: 800;
    color: var(--legal-text-1);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.legal-header h1 .accent { color: var(--legal-emerald); }

.legal-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--legal-font-mono);
    font-size: 0.8026rem;
    color: var(--legal-text-3);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--legal-border);
    margin-bottom: 24px;
    font-feature-settings: 'tnum';
}

.legal-meta i {
    color: var(--legal-emerald);
    font-size: 0.7615rem;
}

.legal-lead {
    font-size: clamp(1.029rem, 1.4vw, 1.1525rem);
    color: var(--legal-text-2);
    line-height: 1.65;
    max-width: 64ch;
}

.legal-lead strong { color: var(--legal-text-1); font-weight: 700; }

/* ============================================
   LAYOUT — TOC + CONTENT
   ============================================ */
.legal-layout {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 60px;
    align-items: flex-start;
    padding: 0 0 96px;
}

/* Sticky TOC */
.legal-toc {
    position: sticky;
    top: 90px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.legal-toc::-webkit-scrollbar { width: 3px; }
.legal-toc::-webkit-scrollbar-thumb { background: var(--legal-surface-2); border-radius: 2px; }
.legal-toc::-webkit-scrollbar-track { background: transparent; }

.legal-toc-title {
    font-family: var(--legal-font-display);
    font-size: 0.6791rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--legal-text-3);
    margin-bottom: 14px;
    padding-left: 4px;
}

.legal-toc ol {
    counter-reset: toc-num;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legal-toc li { counter-increment: toc-num; }

.legal-toc a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--legal-text-2);
    font-size: 0.8849rem;
    line-height: 1.4;
    transition: background 0.25s ease, color 0.25s ease;
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.legal-toc a::before {
    content: counter(toc-num, decimal-leading-zero);
    font-family: var(--legal-font-mono);
    font-feature-settings: 'tnum';
    font-size: 0.7203rem;
    color: var(--legal-text-3);
    font-weight: 600;
    flex-shrink: 0;
    transition: color 0.25s ease;
}

.legal-toc a:hover {
    color: var(--legal-text-1);
    background: rgba(255, 255, 255, 0.02);
}

.legal-toc a:hover::before { color: var(--legal-emerald); }

/* Content article */
.legal-content {
    max-width: 760px;
    color: var(--legal-text-2);
}

.legal-section {
    counter-increment: content-num;
    padding: 32px 0 36px;
    border-bottom: 1px solid var(--legal-border);
    scroll-margin-top: 90px;
}

.legal-content { counter-reset: content-num; }

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

.legal-section-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
}

.legal-section-num {
    font-family: var(--legal-font-display);
    font-size: 0.8026rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--legal-emerald);
    font-feature-settings: 'tnum';
    line-height: 1;
    flex-shrink: 0;
    padding-top: 4px;
}

.legal-section h2 {
    font-family: var(--legal-font);
    font-size: clamp(1.3891rem, 2.2vw, 1.6978rem);
    font-weight: 700;
    color: var(--legal-text-1);
    letter-spacing: -0.015em;
    line-height: 1.2;
    flex: 1;
}

.legal-section h3 {
    font-family: var(--legal-font);
    font-size: 1.0496rem;
    font-weight: 700;
    color: var(--legal-text-1);
    margin: 22px 0 10px;
    letter-spacing: -0.005em;
}

.legal-section p {
    margin: 0 0 14px;
    font-size: 0.9878rem;
    line-height: 1.78;
    color: var(--legal-text-2);
}

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

.legal-section strong {
    color: var(--legal-text-1);
    font-weight: 700;
}

.legal-section em {
    color: var(--legal-text-1);
    font-style: italic;
}

.legal-section a {
    color: var(--legal-emerald);
    border-bottom: 1px solid rgba(74, 157, 120, 0.3);
    transition: border-color 0.25s ease;
}

.legal-section a:hover { border-bottom-color: var(--legal-emerald); }

/* Lists inside content */
.legal-section ul,
.legal-section ol {
    margin: 8px 0 18px;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-section ul li,
.legal-section ol li {
    position: relative;
    padding-left: 22px;
    font-size: 0.9673rem;
    line-height: 1.7;
    color: var(--legal-text-2);
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0.7em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--legal-emerald);
    box-shadow: 0 0 6px rgba(74, 157, 120, 0.5);
}

.legal-section ol {
    counter-reset: legal-list;
}

.legal-section ol li {
    counter-increment: legal-list;
}

.legal-section ol li::before {
    content: counter(legal-list, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--legal-font-mono);
    font-size: 0.7615rem;
    color: var(--legal-emerald);
    font-weight: 700;
    font-feature-settings: 'tnum';
    line-height: 1.78;
}

/* Highlighted callout box (key info) */
.legal-callout {
    margin: 22px 0;
    padding: 18px 22px;
    border-left: 3px solid var(--legal-emerald);
    background: linear-gradient(90deg, rgba(74, 157, 120, 0.05), transparent 80%);
    border-radius: 0 12px 12px 0;
}

.legal-callout p {
    margin: 0;
    font-size: 0.9467rem;
    color: var(--legal-text-1);
}

.legal-callout-label {
    display: inline-block;
    font-family: var(--legal-font-display);
    font-size: 0.638rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--legal-emerald);
    margin-bottom: 6px;
}

/* Data table (used in privacy for data categories) */
.legal-table-wrap {
    margin: 18px 0;
    overflow-x: auto;
    border: 1px solid var(--legal-border);
    border-radius: 12px;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9055rem;
}

.legal-table th,
.legal-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--legal-border);
}

.legal-table th {
    font-family: var(--legal-font-display);
    font-size: 0.7203rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--legal-emerald);
    background: rgba(74, 157, 120, 0.04);
}

.legal-table td { color: var(--legal-text-2); }
.legal-table td strong { color: var(--legal-text-1); }
.legal-table tr:last-child td { border-bottom: none; }

/* ============================================
   FOOTER
   ============================================ */
.legal-footer {
    border-top: 1px solid var(--legal-border);
    padding: 32px 0 40px;
    position: relative;
    z-index: 1;
}

.legal-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.8438rem;
    color: var(--legal-text-3);
}

.legal-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.legal-footer-links a {
    color: var(--legal-text-2);
    transition: color 0.25s ease;
}

.legal-footer-links a:hover { color: var(--legal-emerald); }

.legal-footer-divider {
    color: var(--legal-text-3);
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .legal-toc {
        position: static;
        max-height: none;
        padding: 18px;
        border: 1px solid var(--legal-border);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.018);
    }
    .legal-header { padding: 48px 0 36px; }
}

@media (max-width: 600px) {
    .legal-container { padding: 0 18px; }
    .legal-nav-inner { padding: 12px 18px; }
    .legal-nav-spacer { display: none; }
    .legal-header { padding: 36px 0 28px; }
    .legal-section { padding: 24px 0 28px; }
    .legal-section-head { gap: 12px; margin-bottom: 14px; }
    .legal-content p,
    .legal-section ul li,
    .legal-section ol li { font-size: 0.9467rem; }
    .legal-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.001ms !important;
        animation: none !important;
    }
}
