@charset "UTF-8";
/* FlexVPN legal pages — stylesheet for /privacy, /terms, /offer.

   Optimised for long-form reading: type-first hierarchy, generous
   line-height, max-width 65–70ch, sticky TOC sidebar with active-section
   highlighting, reading progress bar, reveal-on-scroll, print-clean.

   Same brand world as the landing (charcoal + magenta), so once a
   visitor scrolls into the consent line on /signup and clicks
   «оферта», they don't feel they left FlexVPN.

   PR-24, 2026-05-06.
*/

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    background: var(--bg);
    overscroll-behavior-y: none;       /* PR-165: no rubber-band bounce */
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body.legal-page {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    font-feature-settings: 'ss01' on, 'kern' on;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100svh;
}

/* Atmospheric backdrop — subtle radial wash, like the auth page. */
/* Liquid Glass polish (2026-05-16): aurora opacity 0.55 → 0.32. */
body.legal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 700px at 92% -8%, var(--aurora-1), transparent 60%),
        radial-gradient(700px 600px at 0% 100%, var(--aurora-2), transparent 65%);
    opacity: 0.32;
}

body.legal-page > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Reading progress bar — full-width magenta scrubber pinned to top.   */
/* ─────────────────────────────────────────────────────────────────── */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 99;
    transition: transform 0.05s linear;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Top nav — sticky, glassy, same wordmark+dot as landing.             */
/* ─────────────────────────────────────────────────────────────────── */

/* Apple Liquid Glass — clean edge (2026-05-17): top specular only,
   no border-bottom stroke, no outer drop shadow. */
.legal-nav {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 18px var(--container-pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 50;
}
@media (prefers-reduced-transparency: reduce) {
    .legal-nav {
        background: var(--bg-elev-1);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
@supports not (backdrop-filter: blur(1px)) {
    .legal-nav {
        background: var(--bg-elev-1);
    }
}
.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--text);
    transition: color var(--t-fast);
    touch-action: manipulation;
}
.legal-brand:hover { color: var(--accent); }
.legal-brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 8px 14px;
    border: 1px solid var(--border-bright);
    border-radius: var(--r-md);
    background: transparent;
    transition: color var(--t-fast), background var(--t-fast),
        border-color var(--t-fast);
    touch-action: manipulation;
}
.legal-back:hover {
    color: var(--text);
    background: var(--bg-elev-1);
    border-color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Layout grid — content + sticky TOC sidebar. Mobile collapses to    */
/* single column with TOC on top.                                     */
/* ─────────────────────────────────────────────────────────────────── */

.legal-layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 64px var(--container-pad) 120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-areas: "content toc";
    gap: 80px;
    align-items: start;
}
.legal-container {
    grid-area: content;
    max-width: 720px;
}
.legal-toc-wrapper {
    grid-area: toc;
    position: sticky;
    top: 96px;
}

@media (max-width: 960px) {
    .legal-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "toc" "content";
        padding: 32px 20px 80px;
        gap: 32px;
    }
    .legal-toc-wrapper {
        position: static;
    }
}

/* ─────────────────────────────────────────────────────────────────── */
/* TOC sidebar */
/* ─────────────────────────────────────────────────────────────────── */

.toc-heading {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-bright);
}
.toc-list {
    list-style: none;
    counter-reset: toc-counter;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toc-list li {
    counter-increment: toc-counter;
    position: relative;
    padding-left: 36px;
}
.toc-list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 2px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}
.toc-list a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.45;
    transition: color var(--t-fast);
}
.toc-list a:hover { color: var(--text); }
.toc-list a.active {
    color: var(--text);
    font-weight: 600;
}
.toc-list a.active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 7px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: toc-dot 0.4s var(--spring);
}
@keyframes toc-dot {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@media (max-width: 960px) {
    .toc-list a.active::before { display: none; }
    .toc-list {
        background: var(--bg-elev-1);
        border: 1px solid var(--border-bright);
        border-radius: var(--r-lg);
        padding: 18px 18px 18px 22px;
        box-shadow: var(--depth-2);
    }
    .toc-heading {
        border: none;
        padding-bottom: 0;
        margin-bottom: 12px;
    }
}

/* ─────────────────────────────────────────────────────────────────── */
/* Draft banner — magenta-tinted alert that appears when the operator */
/* metadata is empty (документы помечены как черновик).                 */
/* ─────────────────────────────────────────────────────────────────── */

.legal-draft-banner {
    position: relative;
    background: var(--bg-elev-1);
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: var(--r-md);
    padding: 18px 22px;
    margin-bottom: 56px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    box-shadow: 0 6px 24px rgba(233, 66, 153, 0.08);
}
.legal-draft-banner strong {
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Page header */
/* ─────────────────────────────────────────────────────────────────── */

.legal-kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.legal-kicker::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 1.5px;
    background: var(--accent);
}

.legal-container h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5.5vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 20px;
    text-wrap: balance;
}

.legal-subtitle {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    padding-bottom: 32px;
    margin-bottom: 56px;
    border-bottom: 1px solid var(--border-bright);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.legal-subtitle time { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────────── */
/* Prose body — typography-first reading style */
/* ─────────────────────────────────────────────────────────────────── */

.legal-prose {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    counter-reset: section-counter;
}

/* Lead paragraph — slightly larger, softer leading */
.legal-prose > p:first-of-type {
    font-size: 19px;
    line-height: 1.55;
    color: var(--text);
    text-wrap: pretty;
}

/* Drop-cap — magenta capital that anchors the first paragraph */
.legal-prose > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 4em;
    line-height: 0.85;
    float: left;
    padding: 6px 14px 0 0;
    color: var(--accent);
    font-weight: 700;
}

.legal-prose p {
    margin-bottom: 1.15em;
    text-wrap: pretty;
}
.legal-prose p em {
    font-style: italic;
    color: var(--accent);
}
.legal-prose strong {
    font-weight: 600;
    color: var(--text);
}
.legal-prose a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.legal-prose a:hover {
    color: var(--accent);
    text-decoration-thickness: 2px;
}

.legal-prose ul, .legal-prose ol {
    margin: 0 0 1.2em 0;
    padding-left: 26px;
}
.legal-prose li {
    margin-bottom: 0.55em;
    padding-left: 4px;
    line-height: 1.65;
}
.legal-prose ul li::marker {
    color: var(--accent);
}
.legal-prose ol li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-variant-numeric: tabular-nums;
}

.legal-prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-elev-2);
    color: var(--text);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Numbered h2 sections — "01 /" kicker drawn from CSS counter */
.legal-prose h2 {
    counter-increment: section-counter;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.6vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text);
    margin: 80px 0 22px;
    padding-top: 32px;
    border-top: 1px solid var(--border-bright);
    scroll-margin-top: 96px;
    text-wrap: balance;
}
.legal-prose h2::before {
    content: counter(section-counter, decimal-leading-zero) " /";
    font-family: var(--font-mono);
    font-size: 0.55em;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 14px;
}
.legal-prose h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 36px 0 14px;
    color: var(--text);
}

/* Inline note callout — magenta-edged disclosure */
.legal-note {
    background: var(--bg-elev-1);
    border: 1px solid var(--border-bright);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    padding: 20px 24px;
    margin: 36px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
}
.legal-note strong {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Contact sheet — operator details card */
/* ─────────────────────────────────────────────────────────────────── */

.legal-contact {
    margin-top: 96px;
    padding: 36px 32px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-bright);
    border-radius: var(--r-xl);
    box-shadow: var(--depth-3);
    position: relative;
}
.legal-contact::before {
    content: "";
    position: absolute;
    top: -2px;
    left: var(--space-6);
    width: 56px;
    height: 4px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.legal-contact h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 26px;
    border: 0;
    padding: 0;
    color: var(--text);
}
.legal-contact h2::before { display: none; }
.legal-contact dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 14px 26px;
    font-size: 14.5px;
    align-items: baseline;
}
.legal-contact dt {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.legal-contact dd {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.55;
}
.legal-contact dd a {
    color: var(--text);
    border-bottom: 1px solid var(--accent);
    text-decoration: none;
    padding-bottom: 1px;
    transition: color var(--t-fast);
}
.legal-contact dd a:hover { color: var(--accent); }

@media (max-width: 540px) {
    .legal-contact dl { grid-template-columns: 1fr; gap: 4px 0; }
    .legal-contact dt { margin-top: 14px; }
}

/* ─────────────────────────────────────────────────────────────────── */
/* Page footer */
/* ─────────────────────────────────────────────────────────────────── */

.legal-footer {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--border-bright);
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.legal-footer a {
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-fast);
    padding-bottom: 1px;
}
.legal-footer a:hover { border-bottom-color: var(--accent); }
.legal-footer nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Reveal-on-scroll for h2 + contact sheet */
/* ─────────────────────────────────────────────────────────────────── */

.legal-prose h2,
.legal-contact {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--t), transform 0.6s var(--t);
}
.legal-prose h2.in-view,
.legal-contact.in-view {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .legal-prose h2, .legal-contact {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─────────────────────────────────────────────────────────────────── */
/* Print — strip chrome, light-on-white, keep content */
/* ─────────────────────────────────────────────────────────────────── */

@media print {
    body.legal-page {
        background: #fff;
        color: #000;
    }
    body.legal-page::before,
    .reading-progress,
    .legal-nav,
    .legal-toc-wrapper { display: none; }
    .legal-layout {
        display: block;
        max-width: 100%;
        padding: 0;
    }
    .legal-container { max-width: 100%; }
    .legal-prose,
    .legal-prose p,
    .legal-prose li,
    .legal-prose strong,
    .legal-contact dd { color: #000; }
    .legal-prose h2,
    .legal-prose h3,
    .legal-container h1 { color: #000; }
    .legal-prose h2 { break-after: avoid; border-top-color: #999; }
    .legal-prose h2::before,
    .legal-prose p em,
    .legal-kicker { color: #b0006e; }
    .legal-contact {
        break-inside: avoid;
        box-shadow: none;
        background: #f8f8f8;
        border-color: #ddd;
    }
    .legal-prose a {
        color: #000;
        text-decoration-color: #b0006e;
    }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #666;
    }
}
