﻿/* ============================================================
   LEGAL PAGES — Premium Design
   Modern, sleek, with glassmorphism and micro-interactions
   ============================================================ */

:root {
    --legal-primary: #F58220;
    --legal-secondary: #56C4F8;
    --legal-dark: #1A1D20;
    --legal-muted: #6C757D;
    --legal-bg: #F4F7F9;
    --legal-white: #FFFFFF;
    --legal-border: rgba(0,0,0,0.07);
    --legal-shadow-sm: 0 2px 12px rgba(0,0,0,0.05);
    --legal-shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
    --legal-radius: 24px;
    --legal-radius-sm: 16px;
}

/* ── SCROLLING FOUNDATION ──
   html & body must be full-height with overflow so the page scrolls.
   The sticky topbar remains fixed at top; only the document body scrolls. */
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    overflow-y: auto;
}

/* Layout */
.legal-page {
    min-height: 100%;
    background: var(--legal-bg);
    font-family: 'Outfit', sans-serif;
}

/* Top Bar */
.legal-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--legal-border);
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.legal-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.legal-topbar-logo {
    height: 40px;
    width: auto;
}

.legal-topbar-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--legal-muted);
}

.legal-topbar-back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--legal-primary);
    text-decoration: none;
    padding: 8px 20px;
    border: 1.5px solid rgba(245,130,32,0.25);
    border-radius: 60px;
    transition: all 0.25s ease;
}

    .legal-topbar-back:hover {
        background: var(--legal-primary);
        color: white;
        border-color: var(--legal-primary);
        transform: translateY(-1px);
    }

/* ─────────────────────────────────────────
   HERO — Ultra-compact Premium Redesign
   Single-line bar with badge · title · meta tags
   Replaces the two-column layout with a lean strip.
───────────────────────────────────────── */
.legal-hero {
    background: linear-gradient(100deg, #0F172A 0%, #1A2540 60%, #1E293B 100%);
    padding: 0;
    position: relative;
    overflow: hidden;
}

    /* Subtle ambient glow — top-right orange */
    .legal-hero::before {
        content: '';
        position: absolute;
        top: -80px;
        right: -40px;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(245,130,32,0.10) 0%, transparent 70%);
        pointer-events: none;
    }

    /* Bottom-left blue glow */
    .legal-hero::after {
        content: '';
        position: absolute;
        bottom: -60px;
        left: 5%;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(86,196,248,0.07) 0%, transparent 70%);
        pointer-events: none;
    }

/* Compact modifier — activates the strip layout */
.legal-hero--compact {
    padding: 0;
}

.legal-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── Strip layout: single flex row ── */
.legal-hero-inner--row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 28px;
    min-height: 52px;
}

.legal-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.legal-hero-right {
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Badge — inline pill ── */
.legal-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245,130,32,0.13);
    border: 1px solid rgba(245,130,32,0.28);
    color: var(--legal-primary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 60px;
    white-space: nowrap;
    flex-shrink: 0;
    /* Remove bottom margin — strip layout uses flex gap */
    margin-bottom: 0;
}

/* ── Title — compact, single line ── */
.legal-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: white;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .legal-hero h1 em {
        font-style: italic;
        background: linear-gradient(135deg, var(--legal-primary), var(--legal-secondary));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

/* Subheading hidden in strip — too much text for a compact bar */
.legal-hero p {
    display: none;
}

/* ── Meta pills — horizontal row of tags ── */
.legal-hero-meta-grid {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.legal-hero-meta-pill {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

    .legal-hero-meta-pill:hover {
        background: rgba(255,255,255,0.10);
    }

.legal-hero-meta-pill--accent {
    background: rgba(245,130,32,0.10);
    border-color: rgba(245,130,32,0.22);
}

.legal-hero-meta-pill--blue {
    background: rgba(86,196,248,0.07);
    border-color: rgba(86,196,248,0.14);
}

.legal-hero-meta-pill--blue-accent {
    background: rgba(86,196,248,0.12);
    border-color: rgba(86,196,248,0.28);
}

.legal-hero-meta-pill-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
}

    /* Separator between label and value */
    .legal-hero-meta-pill-label::after {
        content: ':';
        margin-right: 1px;
    }

.legal-hero-meta-pill-val {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    line-height: 1;
}

/* Legacy meta (fallback, hidden in compact mode) */
.legal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 32px;
}

.legal-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
}

.legal-hero-meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--legal-primary);
}

/* Layout Container */
.legal-layout {
    max-width: 1200px;
    margin: -40px auto 0;
    padding: 0 40px 80px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* TOC Sidebar */
.legal-toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: var(--legal-white);
    border-radius: var(--legal-radius);
    border: 1px solid var(--legal-border);
    padding: 28px;
    box-shadow: var(--legal-shadow-sm);
}

.legal-toc-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--legal-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--legal-border);
}

.legal-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .legal-toc-list li {
        margin-bottom: 6px;
    }

.legal-toc-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--legal-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    line-height: 1.35;
    overflow-wrap: break-word;
}

    /* Keep the number marker fixed-width so wrapped (longer-language) titles
       align cleanly beneath the first line rather than under the digit. */
    .legal-toc-link .legal-toc-num {
        flex-shrink: 0;
    }

    .legal-toc-link:hover,
    .legal-toc-link.active {
        color: var(--legal-primary);
        background: rgba(245,130,32,0.06);
        border-left-color: var(--legal-primary);
    }

.legal-toc-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--legal-primary);
    background: rgba(245,130,32,0.1);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legal-toc-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--legal-border);
    font-size: 0.72rem;
    color: var(--legal-muted);
}

/* Main Content */
.legal-content {
    min-width: 0;
}

.legal-intro-card {
    background: var(--legal-white);
    border-radius: var(--legal-radius);
    border: 1px solid var(--legal-border);
    padding: 36px 40px;
    margin-bottom: 32px;
    box-shadow: var(--legal-shadow-sm);
}

    .legal-intro-card p {
        font-size: 1rem;
        color: #374151;
        line-height: 1.75;
    }

        .legal-intro-card p + p {
            margin-top: 16px;
        }

/* Section */
.legal-section {
    background: var(--legal-white);
    border-radius: var(--legal-radius);
    border: 1px solid var(--legal-border);
    padding: 36px 40px;
    margin-bottom: 24px;
    box-shadow: var(--legal-shadow-sm);
    scroll-margin-top: 90px;
}

.legal-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--legal-border);
}

.legal-section-number {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--legal-primary), #ff9f4d);
    color: white;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245,130,32,0.25);
}

.legal-section-title-group h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--legal-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}

.legal-section-sub {
    font-size: 0.8rem;
    color: var(--legal-muted);
    font-weight: 500;
}

/* Law Tags */
.legal-law-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.legal-law-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 40px;
    border: 1px solid;
}

    .legal-law-tag.popia {
        color: #16a34a;
        background: rgba(22,163,74,0.08);
        border-color: rgba(22,163,74,0.2);
    }

    .legal-law-tag.ecta {
        color: #2563eb;
        background: rgba(37,99,235,0.08);
        border-color: rgba(37,99,235,0.2);
    }

    .legal-law-tag.cpa {
        color: #9333ea;
        background: rgba(147,51,234,0.08);
        border-color: rgba(147,51,234,0.2);
    }

    .legal-law-tag.paia {
        color: #0891b2;
        background: rgba(8,145,178,0.08);
        border-color: rgba(8,145,178,0.2);
    }

    .legal-law-tag.rica {
        color: #dc2626;
        background: rgba(220,38,38,0.08);
        border-color: rgba(220,38,38,0.2);
    }

/* Text Styling */
.legal-section p {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.75;
    margin-bottom: 16px;
}

.legal-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--legal-dark);
    margin: 24px 0 12px;
}

.legal-section ul,
.legal-section ol {
    padding-left: 0;
    list-style: none;
    margin-bottom: 20px;
}

.legal-section li {
    /* Hanging-indent bullet via absolute positioning.
       Previously this was display:flex; gap:12px — which made the ›
       marker AND every inline <strong> law citation (e.g. "PEPUDA
       (Act 4 of 2000) §6", "Constitution §9") each become a separate
       flex item, squeezing them into broken vertical mini-columns
       (the 14S.3 misalignment). With position/relative the citations
       now flow inline within the sentence as intended. */
    position: relative;
    padding-left: 24px;
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.65;
    margin-bottom: 10px;
    overflow-wrap: break-word;
}

    .legal-section li::before {
        content: '›';
        position: absolute;
        left: 4px;
        top: 0;
        color: var(--legal-primary);
        font-weight: 700;
        font-size: 1.1rem;
        line-height: 1.65;
    }

    /* Keep statute references from breaking mid-citation across lines */
    .legal-section li strong {
        overflow-wrap: normal;
        word-break: keep-all;
    }

/* Info Boxes */
.legal-info-box {
    background: rgba(86,196,248,0.06);
    border: 1px solid rgba(86,196,248,0.2);
    border-left: 4px solid var(--legal-secondary);
    border-radius: var(--legal-radius-sm);
    padding: 18px 24px;
    margin: 24px 0;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.65;
}

    .legal-info-box.warning {
        background: rgba(245,130,32,0.06);
        border-color: rgba(245,130,32,0.2);
        border-left-color: var(--legal-primary);
    }

    .legal-info-box.danger {
        background: rgba(220,38,38,0.05);
        border-color: rgba(220,38,38,0.15);
        border-left-color: #dc2626;
    }

/* Rights Grid */
.legal-rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.legal-right-card {
    background: rgba(245,130,32,0.04);
    border: 1px solid rgba(245,130,32,0.12);
    border-radius: var(--legal-radius-sm);
    padding: 18px;
}

.legal-right-card-icon {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.legal-right-card h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--legal-dark);
    margin-bottom: 4px;
}

.legal-right-card p {
    font-size: 0.75rem;
    color: var(--legal-muted);
    margin: 0;
}

/* Table */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.85rem;
}

    .legal-table th {
        text-align: left;
        padding: 12px 16px;
        background: rgba(0,0,0,0.03);
        font-weight: 700;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--legal-muted);
        border-bottom: 1px solid var(--legal-border);
    }

    .legal-table td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--legal-border);
        color: #374151;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    .legal-table tr:hover td {
        background: rgba(245,130,32,0.02);
    }

/* Contact Card */
.legal-contact-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: var(--legal-radius);
    padding: 36px 40px;
    margin-top: 32px;
    color: white;
    position: relative;
    overflow: hidden;
}

    .legal-contact-card::before {
        content: '';
        position: absolute;
        top: -40px;
        right: -40px;
        width: 220px;
        height: 220px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(245,130,32,0.2) 0%, transparent 70%);
    }

    .legal-contact-card h3 {
        font-family: 'Playfair Display', serif;
        font-size: 1.5rem;
        margin-bottom: 12px;
        position: relative;
    }

    .legal-contact-card p {
        font-size: 0.9rem;
        color: rgba(255,255,255,0.7);
        margin-bottom: 24px;
        position: relative;
    }

.legal-contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    position: relative;
}

.legal-contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 10px 22px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 60px;
    transition: all 0.25s ease;
}

    .legal-contact-link:hover {
        background: var(--legal-primary);
        border-color: var(--legal-primary);
        transform: translateY(-2px);
    }

/* Acceptance Banner */
.legal-acceptance-banner {
    background: linear-gradient(135deg, rgba(245,130,32,0.08), rgba(86,196,248,0.08));
    border: 1.5px solid rgba(245,130,32,0.2);
    border-radius: var(--legal-radius-sm);
    padding: 50px 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.legal-acceptance-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.legal-acceptance-text {
    font-size: 0.88rem;
    color: var(--legal-dark);
    line-height: 1.7;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

    .legal-acceptance-text strong {
        color: var(--legal-primary);
    }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 1024px) {
    .legal-hero-inner--row {
        padding: 10px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .legal-hero-meta-grid {
        gap: 5px;
    }

    .legal-hero--compact {
        padding: 0;
    }
}

@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
        padding: 0 20px 60px;
    }

    .legal-toc {
        display: none;
    }

    .legal-hero--compact {
        padding: 0;
    }

    .legal-section,
    .legal-intro-card {
        padding: 24px;
    }

    .legal-topbar {
        padding: 12px 20px;
    }

    .legal-rights-grid {
        grid-template-columns: 1fr 1fr;
    }

    .legal-contact-card {
        padding: 24px;
    }

    .legal-hero-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .legal-hero--compact {
        padding: 0;
    }

    .legal-hero-inner--row {
        flex-wrap: wrap;
        padding: 8px 14px;
        gap: 8px;
        min-height: 44px;
    }

    .legal-hero h1 {
        font-size: 0.9rem;
    }

    .legal-hero-meta-grid {
        gap: 4px;
        flex-wrap: wrap;
    }

    .legal-hero-meta-pill {
        padding: 3px 8px;
    }

        /* Hide last 2 meta pills on very small screens to keep it clean */
        .legal-hero-meta-pill:nth-child(n+3) {
            display: none;
        }

    .legal-hero-meta-pill-val {
        font-size: 0.68rem;
    }

    .legal-section,
    .legal-intro-card {
        padding: 18px 16px;
    }

    .legal-section-header {
        flex-direction: column;
        gap: 10px;
    }

    .legal-section-number {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .legal-rights-grid {
        grid-template-columns: 1fr;
    }

    .legal-contact-card {
        padding: 20px 18px;
    }

    .legal-contact-links {
        flex-direction: column;
    }

    .legal-contact-link {
        justify-content: center;
    }

    .legal-acceptance-banner {
        padding: 14px 16px;
        gap: 10px;
    }

    .legal-acceptance-icon {
        font-size: 1.3rem;
    }

    .legal-acceptance-text {
        font-size: 0.83rem;
    }

    .legal-table {
        font-size: 0.78rem;
    }

        .legal-table th,
        .legal-table td {
            padding: 10px 10px;
        }

    .legal-layout {
        padding: 0 12px 48px;
        margin-top: -24px;
    }
}

@media (max-width: 400px) {
    .legal-hero h1 {
        font-size: 0.85rem;
    }

    .legal-hero-meta-grid {
        gap: 4px;
    }

    .legal-topbar {
        padding: 10px 14px;
    }
}


/* ============================================================
   PDF EXPORT — Action bar + button + loading + toast
   ============================================================
   Used by all legal pages (Privacy, Terms, PAIA, Refund) at the
   top of <main class="legal-content">. Wired via legal-pdf-export.js
   which auto-detects [data-pdf-export] buttons.
   ============================================================ */

/* ── Action bar wrapper above legal sections ── */
.legal-page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    margin: 0 0 24px 0;
    background: linear-gradient(135deg, rgba(245,130,32,0.04), rgba(86,196,248,0.03));
    border: 1px solid rgba(245,130,32,0.15);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(245,130,32,0.04);
}

.legal-page-actions-meta {
    font-size: 0.7rem;
    color: var(--legal-muted, #6B7280);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Premium export-to-PDF button ── */
.legal-export-btn {
    appearance: none;
    border: none;
    background: linear-gradient(135deg, #F58220 0%, #ff9f4a 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(245,130,32,0.28), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
    line-height: 1.25;
    /* Longer translations (isiZulu / Sesotho labels run ~40% longer than the
       English "Export to PDF") must wrap and grow the button rather than
       spilling out of it. Was white-space:nowrap. */
    white-space: normal;
    text-align: center;
    min-height: 40px;
    max-width: 100%;
}

    .legal-export-btn > i,
    .legal-export-btn .legal-export-icon {
        flex-shrink: 0;
    }

    .legal-export-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(245,130,32,0.38), inset 0 1px 0 rgba(255,255,255,0.25);
        filter: brightness(1.04);
    }

    .legal-export-btn:active {
        transform: translateY(0);
        box-shadow: 0 3px 8px rgba(245,130,32,0.25), inset 0 1px 2px rgba(0,0,0,0.08);
    }

    .legal-export-btn:focus-visible {
        outline: 2px solid var(--legal-secondary, #56C4F8);
        outline-offset: 3px;
    }

    .legal-export-btn:disabled,
    .legal-export-btn[aria-busy="true"] {
        opacity: 0.7;
        cursor: wait;
        transform: none;
    }

.legal-export-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.legal-export-btn:hover .legal-export-icon {
    transform: translateY(2px);
}

/* ── Spinning state during PDF generation ── */
.legal-export-btn .legal-export-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: legalExportSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes legalExportSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Loading overlay (shown during PDF generation) ── */
.legal-export-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 32, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

    .legal-export-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

.legal-export-overlay-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    min-width: 240px;
    text-align: center;
}

.legal-export-overlay-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(245,130,32,0.15);
    border-top-color: #F58220;
    border-radius: 50%;
    animation: legalExportSpin 0.8s linear infinite;
}

.legal-export-overlay-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A1D20;
    letter-spacing: -0.01em;
}

.legal-export-overlay-sub {
    font-size: 0.72rem;
    color: #6B7280;
    font-weight: 500;
}

/* ── Toast (shared with cookies.js) ── */
.ikb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1A1D20;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 40px);
}

    .ikb-toast.is-visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .ikb-toast.is-success {
        background: linear-gradient(135deg, #16a34a, #22c55e);
    }

    .ikb-toast.is-error {
        background: linear-gradient(135deg, #dc2626, #ef4444);
    }

    .ikb-toast.is-info {
        background: linear-gradient(135deg, #1A1D20, #2a2d31);
    }

/* ── Mobile polish ── */
@media (max-width: 768px) {
    .legal-page-actions {
        padding: 12px 14px;
        margin-bottom: 18px;
        border-radius: 14px;
    }

    .legal-page-actions-meta {
        font-size: 0.65rem;
        order: 2;
        width: 100%;
        text-align: center;
    }

    .legal-export-btn {
        font-size: 0.78rem;
        padding: 9px 16px 9px 12px;
        flex: 1 1 auto;
        justify-content: center;
        order: 1;
    }
}

@media (max-width: 480px) {
    .legal-page-actions {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .legal-export-btn {
        width: 100%;
    }
}


/* ============================================================
   STICKY HEADER + BACK-TO-SITE + BREADCRUMB (Premium Polish)
   ============================================================
   Fixes for the unstyled .legal-sticky-header, .legal-back-btn,
   and .legal-breadcrumb elements rendered by the legal pages.
   These weren't covered by the v1 .legal-topbar-* selectors which
   target a different DOM. Both work side-by-side.
   ============================================================ */

/* ── Sticky header container (wraps topbar) ── */
.legal-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 16px -8px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

    .legal-sticky-header.is-scrolled {
        background: rgba(255,255,255,0.96);
        box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 10px 24px -10px rgba(0,0,0,0.10);
    }

    /* Make the inner topbar honour the sticky wrapper instead of stacking sticky */
    .legal-sticky-header .legal-topbar {
        position: static !important;
        background: transparent;
        backdrop-filter: none;
        border-bottom: none;
        padding: 10px 24px;
        box-shadow: none;
    }

/* ── Right-side controls (back btn + lang picker) ── */
.legal-topbar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.legal-topbar-tagline-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

/* ── Back-to-Site button (premium pill) ── */
.legal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--legal-primary, #F58220);
    text-decoration: none;
    padding: 8px 16px 8px 14px;
    background: rgba(245,130,32,0.06);
    border: 1.5px solid rgba(245,130,32,0.25);
    border-radius: 999px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

    .legal-back-btn i {
        font-size: 0.95rem;
        transition: transform 0.25s ease;
    }

    .legal-back-btn:hover {
        background: linear-gradient(135deg, var(--legal-primary, #F58220), #ff9f4a);
        border-color: transparent;
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(245,130,32,0.28);
    }

        .legal-back-btn:hover i {
            transform: translateX(-3px);
        }

    .legal-back-btn:focus-visible {
        outline: 2px solid var(--legal-secondary, #56C4F8);
        outline-offset: 3px;
    }

    .legal-back-btn:active {
        transform: translateY(0);
    }

/* ── Breadcrumb (kills <ol> numbering, gives premium chip look) ── */
.legal-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 40px 0;
}

.legal-breadcrumb-list {
    list-style: none !important;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--legal-muted, #6B7280);
}

    .legal-breadcrumb-list li {
        list-style: none !important;
        display: inline-flex;
        align-items: center;
    }

        /* Belt-and-braces: kill ::marker on every level */
        .legal-breadcrumb-list li::marker {
            content: '' !important;
        }

.legal-breadcrumb-item {
    line-height: 1.2;
}

.legal-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--legal-muted, #6B7280);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease;
}

    .legal-breadcrumb-link:hover {
        background: rgba(245,130,32,0.08);
        color: var(--legal-primary, #F58220);
    }

    .legal-breadcrumb-link i {
        font-size: 0.85rem;
    }

.legal-breadcrumb-sep {
    color: rgba(0,0,0,0.25);
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
}

    .legal-breadcrumb-sep i {
        font-size: 0.7rem;
    }

.legal-breadcrumb-item--current {
    color: var(--legal-dark, #1A1D20);
    font-weight: 700;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(245,130,32,0.10), rgba(86,196,248,0.06));
    border: 1px solid rgba(245,130,32,0.18);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
}

    .legal-breadcrumb-item--current i {
        color: var(--legal-primary, #F58220);
        font-size: 0.85rem;
    }

/* ── Mobile polish ── */
@media (max-width: 768px) {
    .legal-sticky-header .legal-topbar {
        padding: 8px 14px;
        gap: 10px;
    }

    .legal-back-btn {
        font-size: 0.76rem;
        padding: 7px 13px 7px 11px;
    }

    .legal-back-btn-text {
        display: none;
    }

    .legal-back-btn i {
        font-size: 1rem;
    }

    .legal-breadcrumb {
        padding: 10px 16px 0;
    }

    .legal-breadcrumb-list {
        font-size: 0.7rem;
        gap: 4px;
    }

    .legal-breadcrumb-link,
    .legal-breadcrumb-item--current {
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .legal-breadcrumb {
        padding: 8px 12px 0;
    }

    /* Hide 'Home' label on mobile, keep just the icon */
    .legal-breadcrumb-link span:not(.bi) {
        display: none;
    }

    .legal-breadcrumb-link {
        padding: 4px 7px;
    }
}

/* ── Sticky-on-scroll JS hook ── */
@supports not (backdrop-filter: blur(1px)) {
    .legal-sticky-header {
        background: #ffffff;
    }
}
