/* STRCTR legal subsystem — public system surface (aligned with /pricing, /checkout: flat, compressed, blue = action) */

:root {
    --bg: #050506;
    --text: #e5e7eb;
    --muted: #8a9099;
    --dim: rgba(180, 188, 198, 0.92);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.12);
    --surface: #060607;
    --slab-strong-bg: #030304;
    --accent: #2563eb;
    --accent-border: rgba(59, 130, 246, 0.88);
    --tier-frame: rgba(255, 255, 255, 0.175);
    --legal-max: 720px;
    --legal-hub-max: min(1180px, calc(100vw - 40px));
    --lg-pad: clamp(20px, 4vw, 40px);
    --lg-hub-block-gap: clamp(40px, 6vw, 72px);
    --lg-hub-section-gap: clamp(28px, 4vw, 48px);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    overflow-y: auto;
}

body.legal-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background: var(--bg);
    overflow: visible;
}

/* —— Header — same chrome as /pricing (.pr-header) —— */
.lg-header {
    flex: none;
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lg-header-inner {
    max-width: var(--legal-hub-max);
    margin: 0 auto;
    padding: 0 var(--lg-pad);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lg-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.5;
    color: var(--text);
    text-decoration: none;
}

.lg-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    display: grid;
    place-items: center;
    background: #000;
    overflow: hidden;
}

.lg-brand-mark img {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

.lg-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lg-nav a {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    border-bottom: none;
    transition: color 0.14s ease;
}

.lg-nav a:hover {
    color: var(--text);
}

.lg-nav-current {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(200, 208, 218, 0.55);
}

.lg-main-wrap {
    flex: 1;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.legal-main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: var(--legal-max);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 48px) var(--lg-pad) clamp(40px, 7vw, 72px);
}

.legal-doc {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: clamp(22px, 4vw, 32px);
    background: var(--surface);
}

.lg-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.legal-doc h1 {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 3.2vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.25;
    color: var(--text);
}

.legal-updated {
    margin: 0 0 clamp(22px, 3.5vw, 32px);
    font-size: 12px;
    letter-spacing: 0.04em;
    line-height: 1.45;
    color: var(--muted);
}

.legal-scope {
    margin: 0 0 clamp(20px, 3vw, 28px);
    font-size: 13px;
    line-height: 1.6;
    color: var(--dim);
}

.legal-section {
    margin: 0;
    padding: clamp(18px, 2.8vw, 24px) 0;
    border-top: 1px solid var(--line);
}

.legal-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.legal-section h2 {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
}

.legal-section p {
    margin: 0 0 12px;
    color: var(--dim);
    line-height: 1.6;
    font-size: 14px;
}

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

.legal-section ul {
    margin: 8px 0 0;
    padding: 0 0 0 1.2em;
    color: var(--dim);
    line-height: 1.55;
    font-size: 14px;
}

.legal-section li {
    margin-bottom: 6px;
}

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

.legal-doc a:not(.lg-brand) {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.4);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-doc a:not(.lg-brand):hover {
    color: #3b82f6;
    border-bottom-color: rgba(59, 130, 246, 0.55);
}

.legal-contact {
    margin-top: clamp(24px, 4vw, 36px);
    padding-top: clamp(18px, 3vw, 24px);
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--dim);
    line-height: 1.55;
}

.legal-contact a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.4);
}

.legal-contact a:hover {
    border-bottom-color: rgba(59, 130, 246, 0.55);
}

/* —— Legal document subpages (/legal/terms, privacy, refund) —— */

body.legal-doc-page .legal-doc {
    border-radius: 4px;
}

.legal-doc .lg-kicker a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-doc .lg-kicker a:hover {
    color: rgba(229, 231, 235, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.legal-doc-lead {
    margin: 0 0 clamp(14px, 2vw, 18px);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.5;
    color: rgba(168, 176, 186, 0.96);
}

.legal-meta {
    margin: 0 0 clamp(22px, 3.5vw, 30px);
    padding-bottom: clamp(18px, 2.8vw, 22px);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.45;
    color: rgba(138, 144, 153, 0.98);
}

.legal-meta__item {
    white-space: nowrap;
}

.legal-meta__label {
    margin-right: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(156, 162, 172, 0.92);
}

.legal-meta__sep {
    opacity: 0.45;
    user-select: none;
}

.legal-return-gate {
    margin-top: clamp(28px, 5vw, 44px);
    padding-top: clamp(20px, 3vw, 28px);
    border-top: 1px solid rgba(255, 255, 255, 0.065);
    max-width: 100%;
}

.legal-return-gate__line {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.45;
    color: rgba(118, 126, 136, 0.96);
}

.legal-return-gate__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* —— Site footer row —— */
.lg-site-footer {
    flex: none;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px var(--lg-pad) calc(24px + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 5, 6, 0.96);
}

.lg-footer-inner {
    max-width: var(--legal-hub-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.lg-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    color: var(--muted);
}

.lg-footer-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.lg-footer-links a:hover {
    color: rgba(229, 231, 235, 0.88);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.lg-footer-links a[aria-current='page'] {
    color: rgba(229, 231, 235, 0.92);
    border-bottom-color: transparent;
    pointer-events: none;
    cursor: default;
}

.lg-footer-links .lg-sep {
    margin: 0 8px;
    opacity: 0.45;
    user-select: none;
}

.lg-footer-links .lg-nav-current {
    color: var(--text);
    font-weight: 600;
}

.lg-footer-meta {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(138, 144, 153, 0.85);
}

/* —— Checkout success (shared asset) —— */
.success-page .legal-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    max-width: min(736px, calc(100vw - 32px));
    padding: clamp(24px, 4.6vw, 44px) var(--lg-pad) clamp(34px, 6.2vw, 64px);
}

.success-page .legal-doc {
    border-color: var(--line-strong);
    padding: clamp(26px, 4.5vw, 38px);
}

.success-stack {
    text-align: center;
    max-width: 464px;
    margin: 0 auto;
    width: 100%;
}

.success-stack h1 {
    margin: 0 0 14px;
    font-size: clamp(1.28rem, 3.1vw, 1.52rem);
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: none;
    line-height: 1.28;
    color: var(--text);
}

.success-lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: rgba(188, 196, 206, 0.96);
}

.success-actions {
    margin-top: 26px;
}

.success-actions .btn-primary {
    text-decoration: none !important;
    border-bottom: none !important;
}

.success-page .success-actions .btn.btn-primary {
    min-height: 42px;
    padding: 0 20px;
    letter-spacing: 0.055em;
}

.success-hint {
    margin: 18px 0 0;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--muted);
}

@media (max-width: 520px) {
    .legal-doc {
        padding: 18px;
    }

    .success-page .legal-doc {
        padding: 22px 20px;
    }
}

.lg-brand:focus-visible,
.lg-nav a:focus-visible,
.lg-footer-links a:focus-visible,
.success-actions .btn:focus-visible {
    outline: 1px solid rgba(59, 130, 246, 0.72);
    outline-offset: 2px;
}

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

    .lg-nav a,
    .legal-doc a,
    .success-actions .btn,
    .lg-routes-nav a,
    .lg-hub-footer a,
    .btn,
    .btn.btn-ghost,
    .legal-return-gate .btn {
        transition: none;
    }
}

/* —— Legal hub (/legal) — policy route surface — aligned with /access slabs —— */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.legal-main--hub {
    max-width: var(--legal-hub-max);
    padding: clamp(24px, 4vw, 36px) var(--lg-pad) clamp(48px, 8vw, 80px);
}

/* 1. Legal hub intro — same page-start slab as /pricing (.pr-pricing-header) & /access */
.lg-legal-header {
    margin-bottom: var(--lg-hub-block-gap);
    padding: clamp(4px, 0.8vw, 8px) 0 clamp(22px, 3.2vw, 30px)
        clamp(14px, 2.2vw, 22px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.105);
    border-left: 1px solid rgba(255, 255, 255, 0.11);
    max-width: min(38rem, 100%);
}

.lg-legal-header__title {
    margin: 0 0 12px;
    font-size: clamp(1.08rem, 2.35vw, 1.32rem);
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    line-height: 1.22;
    color: rgba(232, 236, 242, 0.97);
}

.lg-legal-header__lead {
    margin: 0 0 11px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.038em;
    line-height: 1.45;
    color: rgba(172, 180, 190, 0.96);
}

.lg-legal-header__truth {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.032em;
    line-height: 1.48;
    color: rgba(128, 136, 146, 0.94);
}

.lg-hub-block {
    margin-top: var(--lg-hub-block-gap);
}

.lg-hub-block:first-of-type {
    margin-top: 0;
}

/* 2. Legal routes — primary slab (tier-surface family; bridges from intro) */
.lg-hub-block--routes {
    margin-top: 0;
}

.lg-routes-slab {
    width: 100%;
    border: 1px solid var(--tier-frame);
    background: var(--slab-strong-bg);
    overflow: visible;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.35);
}

.lg-routes-slab-head {
    padding: clamp(14px, 1.8vw, 18px) clamp(18px, 2.5vw, 28px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    background: transparent;
}

.lg-routes-slab-kicker {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(148, 156, 168, 0.82);
}

.lg-routes-nav {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
}

.lg-routes-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    min-height: 118px;
    padding: clamp(22px, 3vw, 30px) 18px;
    font-weight: 600;
    color: rgba(200, 206, 216, 0.96);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    transition: color 0.15s ease, background 0.15s ease;
}

.lg-routes-nav a:last-child {
    border-bottom: 0;
}

.lg-routes-nav a:hover {
    color: rgba(236, 240, 246, 0.98);
    background: rgba(255, 255, 255, 0.04);
}

.lg-routes-tier {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(138, 146, 158, 0.96);
}

.lg-routes-action {
    font-size: clamp(13px, 1.2vw, 15px);
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(228, 232, 240, 0.98);
}

@media (min-width: 700px) {
    .lg-routes-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 132px;
    }

    .lg-routes-nav a {
        min-height: 140px;
        border-bottom: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.075);
        padding: 28px 16px;
    }

    .lg-routes-nav a:last-child {
        border-right: 0;
    }
}

/* 3. Policy notes — second tier */
.lg-notes-slab {
    border: 1px solid var(--tier-frame);
    background: var(--surface);
    padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 28px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 0 0 1px rgba(0, 0, 0, 0.28);
}

.lg-notes-head {
    padding-bottom: clamp(14px, 2vw, 18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    margin-bottom: clamp(14px, 2vw, 18px);
}

.lg-notes-head h2 {
    margin: 0;
    font-size: clamp(11px, 1.05vw, 12px);
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    line-height: 1.26;
    color: rgba(190, 198, 208, 0.88);
}

.lg-notes-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lg-notes-row {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: 8px 20px;
    align-items: baseline;
    padding: 12px 0 0;
}

.lg-notes-row:first-of-type {
    padding-top: 0;
}

.lg-notes-row:not(:first-of-type) {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.lg-notes-row__label {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(176, 184, 194, 0.9);
}

.lg-notes-row__body {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.48;
    letter-spacing: 0.025em;
    color: rgba(132, 140, 152, 0.98);
}

@media (max-width: 560px) {
    .lg-notes-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* 4. Return gate — quietest */
.lg-hub-block--gate {
    margin-top: calc(var(--lg-hub-block-gap) * 0.78);
}

.lg-return-gate {
    padding: clamp(18px, 2.8vw, 24px) 0 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
    text-align: center;
    max-width: min(26rem, 100%);
    margin-inline: auto;
}

.lg-return-line {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.45;
    color: rgba(118, 126, 136, 0.96);
}

.lg-return-cta {
    display: flex;
    justify-content: center;
}

/* Footer strip */
.lg-hub-footer {
    margin-top: var(--lg-hub-section-gap);
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(138, 144, 153, 0.9);
}

.lg-hub-footer a {
    color: rgba(200, 208, 218, 0.88);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.14s ease;
}

.lg-hub-footer a:hover {
    color: var(--text);
}

.lg-hub-footer a[aria-current='page'] {
    color: var(--text);
    text-decoration: none;
    pointer-events: none;
    cursor: default;
}

.lg-hub-footer-sep {
    opacity: 0.45;
    user-select: none;
}

/* Buttons — blue = activation only (hub gate) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    min-height: 44px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.btn:hover {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.03);
}

.btn-primary {
    background: var(--accent);
    color: #f8fafc;
    border-color: var(--accent-border);
    font-weight: 500;
    letter-spacing: 0.07em;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn.btn-ghost {
    background: transparent;
    color: rgba(200, 208, 218, 0.9);
    border-color: rgba(255, 255, 255, 0.14);
    font-weight: 600;
}

.btn.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.lg-header .lg-nav a:focus-visible,
.lg-brand:focus-visible,
.lg-routes-nav a:focus-visible,
.lg-hub-footer a:focus-visible,
.btn:focus-visible,
.btn.btn-ghost:focus-visible,
.legal-return-gate .btn:focus-visible {
    outline: 1px solid rgba(59, 130, 246, 0.72);
    outline-offset: 2px;
}
