/*
 * Gid legal pages
 * Shared presentation for Privacy Policy and Terms of Service.
 * Legal copy stays in the HTML documents; this file only owns presentation.
 */

:root {
    --legal-bg: #0c111a;
    --legal-bg-deep: #080c13;
    --legal-surface: rgba(19, 27, 42, 0.86);
    --legal-surface-quiet: rgba(255, 255, 255, 0.035);
    --legal-border: rgba(255, 255, 255, 0.1);
    --legal-border-strong: rgba(241, 118, 25, 0.38);
    --legal-text: #f4f4f7;
    --legal-text-muted: #b6b6c0;
    --legal-text-soft: #8f96a3;
    --legal-orange: #f17619;
    --legal-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html {
    background: var(--legal-bg-deep);
    scroll-behavior: smooth;
}

body {
    background: var(--legal-bg-deep);
    color: var(--legal-text);
}

::selection {
    color: #ffffff;
    background: rgba(241, 118, 25, 0.72);
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.7rem 1rem;
    color: #ffffff;
    background: var(--legal-orange);
    border-radius: 0.65rem;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.legal-body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding: 7.5rem 0 5rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 5%, rgba(241, 118, 25, 0.13), transparent 24rem),
        radial-gradient(circle at 88% 17%, rgba(148, 163, 184, 0.08), transparent 28rem),
        linear-gradient(145deg, #111a29 0%, var(--legal-bg) 47%, var(--legal-bg-deep) 100%);
}

.legal-body::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 46rem);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 46rem);
}

.legal-body > .container {
    max-width: 1080px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.25rem;
    padding: 0.65rem 0.9rem;
    color: var(--legal-text-muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--legal-border);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.back-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: var(--legal-text);
    background: rgba(241, 118, 25, 0.08);
    border-color: var(--legal-border-strong);
    transform: translateY(-1px);
}

.back-link:hover svg {
    transform: translateX(-2px);
}

.back-link:focus-visible,
.legal-container a:focus-visible {
    outline: 3px solid rgba(241, 118, 25, 0.46);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

.legal-container {
    position: relative;
    width: min(100%, 940px);
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4.5rem);
    overflow: hidden;
    color: var(--legal-text);
    background: var(--legal-surface);
    border: 1px solid var(--legal-border);
    border-radius: 2rem;
    box-shadow: var(--legal-shadow);
    backdrop-filter: blur(24px) saturate(125%);
    -webkit-backdrop-filter: blur(24px) saturate(125%);
}

.legal-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 8%;
    left: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--legal-orange), transparent);
    box-shadow: 0 0 28px rgba(241, 118, 25, 0.42);
}

.legal-header {
    max-width: 760px;
    margin: 0 auto 3rem;
    padding-bottom: 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--legal-border);
}

.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    color: var(--legal-orange);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
}

.legal-eyebrow::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    background: var(--legal-orange);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(241, 118, 25, 0.78);
}

.legal-header h1 {
    margin: 0;
    color: var(--legal-text);
    font-size: clamp(2.45rem, 7vw, 4.6rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.02;
    text-wrap: balance;
}

.legal-summary {
    max-width: 650px;
    margin: 1.2rem auto 0;
    color: var(--legal-text-muted);
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.75;
    text-wrap: balance;
}

.legal-header .update-date {
    display: inline-flex;
    align-items: center;
    margin: 1.5rem 0 0;
    padding: 0.5rem 0.8rem;
    color: var(--legal-text-soft);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--legal-border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.legal-section,
.highlight-box,
.toc,
.contact-info {
    width: min(100%, 760px);
    margin-right: auto;
    margin-left: auto;
}

.legal-section {
    margin-bottom: 3.25rem;
    scroll-margin-top: 7rem;
}

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

.legal-section h2 {
    position: relative;
    margin: 0 0 1.35rem;
    padding: 0 0 0.9rem 1rem;
    color: var(--legal-text);
    border-bottom: 1px solid var(--legal-border);
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
    text-wrap: pretty;
}

.legal-section h2::before {
    content: '';
    position: absolute;
    top: 0.16em;
    bottom: calc(0.9rem + 0.16em);
    left: 0;
    width: 3px;
    min-height: 1rem;
    background: var(--legal-orange);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(241, 118, 25, 0.34);
}

.legal-section h3 {
    margin: 1.8rem 0 0.8rem;
    color: #e7e8ec;
    font-size: clamp(1.02rem, 2vw, 1.16rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.45;
}

.legal-section p,
.legal-section ul,
.legal-section ol,
.contact-info p,
.highlight-box p,
.highlight-box ul {
    color: var(--legal-text-muted);
    font-size: 0.98rem;
    line-height: 1.78;
}

.legal-section p,
.contact-info p,
.highlight-box p {
    margin: 0 0 1rem;
}

.legal-section p:last-child,
.contact-info p:last-child,
.highlight-box p:last-child {
    margin-bottom: 0;
}

.legal-section ul,
.legal-section ol,
.highlight-box ul {
    margin: 0 0 1.2rem;
    padding-left: 1.35rem;
}

.legal-section li,
.highlight-box li {
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
}

.legal-section li:last-child,
.highlight-box li:last-child {
    margin-bottom: 0;
}

.legal-section li::marker,
.highlight-box li::marker,
.toc li::marker {
    color: var(--legal-orange);
    font-weight: 700;
}

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

.legal-container a {
    color: var(--legal-orange);
    font-weight: 600;
    text-decoration-color: rgba(241, 118, 25, 0.5);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.legal-container a:hover {
    color: #ffffff;
    text-decoration-color: var(--legal-orange);
}

.highlight-box,
.toc,
.contact-info {
    position: relative;
    padding: 1.35rem 1.5rem;
    background: var(--legal-surface-quiet);
    border: 1px solid var(--legal-border);
    border-radius: 1rem;
}

.highlight-box {
    margin-top: 1rem;
    margin-bottom: 1.1rem;
    border-left: 3px solid var(--legal-orange);
}

.highlight-box.info,
.highlight-box.critical,
.highlight-box.plain-english {
    background: rgba(241, 118, 25, 0.055);
    border-color: rgba(241, 118, 25, 0.22);
    border-left-color: var(--legal-orange);
}

.highlight-box.plain-english {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.highlight-box.plain-english > p:first-child {
    margin-bottom: 0.9rem;
    color: var(--legal-text);
    font-size: 1.03rem;
}

.highlight-box.plain-english ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.highlight-box.plain-english li {
    margin-bottom: 0.85rem;
    padding: 0;
}

.toc {
    margin-top: 2rem;
    margin-bottom: 3.25rem;
    scroll-margin-top: 7rem;
}

.toc h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.1rem;
    color: var(--legal-text);
    font-size: 1rem;
    font-weight: 700;
}

.toc h3::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    background: var(--legal-orange);
    border-radius: 0.2rem;
    box-shadow: 0 0 14px rgba(241, 118, 25, 0.45);
}

.toc ol {
    margin: 0;
    padding-left: 1.35rem;
    columns: 2;
    column-gap: 2.5rem;
}

.toc li {
    margin: 0 0 0.55rem;
    padding-left: 0.15rem;
    break-inside: avoid;
    color: var(--legal-text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

.toc a {
    font-weight: 500;
    text-decoration: none;
}

.toc a:hover {
    color: var(--legal-text);
    text-decoration: underline;
    text-decoration-color: var(--legal-orange);
}

.contact-info {
    margin-top: 1.25rem;
    margin-bottom: 0;
    border-color: rgba(241, 118, 25, 0.24);
    box-shadow: inset 3px 0 0 var(--legal-orange);
}

.main-footer {
    background: var(--legal-bg-deep);
    border-top: 1px solid var(--legal-border);
}

@media (max-width: 768px) {
    .legal-body {
        padding: 6.4rem 0 3.5rem;
    }

    .legal-body > .container {
        padding: 0 1rem;
    }

    .legal-container {
        padding: 2.25rem 1.4rem;
        border-radius: 1.5rem;
    }

    .legal-header {
        margin-bottom: 2.4rem;
        padding-bottom: 2rem;
    }

    .legal-section {
        margin-bottom: 2.65rem;
    }

    .highlight-box,
    .toc,
    .contact-info {
        padding: 1.2rem;
    }

    .toc ol {
        columns: 1;
    }
}

@media (max-width: 420px) {
    .legal-body > .container {
        padding: 0 0.75rem;
    }

    .back-link {
        margin-left: 0.15rem;
        font-size: 0.82rem;
    }

    .legal-container {
        padding: 2rem 1rem;
        border-radius: 1.25rem;
    }

    .legal-header h1 {
        font-size: 2.35rem;
    }

    .legal-summary {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .legal-header .update-date {
        font-size: 0.72rem;
    }

    .legal-section h2 {
        padding-left: 0.8rem;
        font-size: 1.2rem;
    }

    .legal-section p,
    .legal-section ul,
    .legal-section ol,
    .contact-info p,
    .highlight-box p,
    .highlight-box ul {
        font-size: 0.92rem;
        line-height: 1.72;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .skip-link,
    .back-link,
    .back-link svg,
    .legal-container a {
        transition: none;
    }
}

@media print {
    html,
    body,
    .legal-body {
        color: #111827;
        background: #ffffff !important;
    }

    .main-nav,
    .main-footer,
    .back-link,
    .skip-link {
        display: none !important;
    }

    .legal-body {
        padding: 0;
        overflow: visible;
    }

    .legal-body::before,
    .legal-container::before {
        display: none;
    }

    .legal-container {
        width: 100%;
        max-width: none;
        padding: 0;
        color: #111827;
        background: #ffffff;
        border: 0;
        box-shadow: none;
    }

    .legal-header,
    .legal-section h2 {
        border-color: #d1d5db;
    }

    .legal-header h1,
    .legal-section h2,
    .legal-section h3,
    .legal-container strong,
    .toc h3 {
        color: #111827;
    }

    .legal-summary,
    .legal-header .update-date,
    .legal-section p,
    .legal-section ul,
    .legal-section ol,
    .contact-info p,
    .highlight-box p,
    .highlight-box ul,
    .toc li {
        color: #374151;
    }

    .highlight-box,
    .toc,
    .contact-info {
        background: #f9fafb !important;
        border-color: #d1d5db !important;
        break-inside: avoid;
    }

    .legal-section {
        break-inside: avoid-page;
    }
}
