/* Recompensated — public legal documents (Terms, Privacy, Cookies, Affiliate,
 * Acceptable Use, Reversals). Rendered by partials/legal/document.blade.php.
 *
 * 2026-07-31 rewrite. Replaces the scattered `.legal-*` rules that used to live
 * in the app.blade.php inline <style> block and the `.legal-language` block in
 * custom.css. Every `.legal-*` class was used ONLY by the two legal partials, so
 * this file is now the single owner of the styling for these pages.
 *
 * Design language follows the .lp-* homepage (landing.css): dark-only, flat
 * surfaces, depth from 1px --border-subtle hairlines, one emerald accent, heavy
 * tight display type. All colours resolve through theme-tokens.css.
 *
 * NOTE: the legacy assets/css/main.css paints bare `p`, `li`, `span`, `td` at
 * 18px/lavender, so every text element below sets its own font-size and color
 * rather than relying on inheritance.
 * ========================================================================== */

.lgl {
    width: min(100%, 72rem);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
    color: var(--text-body);
}

/* --------------------------------------------------------------------------
 * Document head — title + when it was last updated. Nothing else.
 * (Replaces the old .support-hero block, which cost 280-340px of vertical
 * space on a 375px phone before a single word of the policy.)
 * ----------------------------------------------------------------------- */

.lgl__head {
    padding-block: clamp(1.75rem, 5vw, 3rem) clamp(1.1rem, 2.5vw, 1.5rem);
    border-bottom: 1px solid var(--border-subtle);
}

.lgl__title {
    max-width: 14em;
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(1.85rem, 5vw, 3rem);
    font-weight: 850;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

.lgl__stamp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.95rem 0 0;
    padding: 0.34rem 0.72rem;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.lgl__stamp::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
}

.lgl__stamp time {
    color: inherit;
    font-variant-numeric: tabular-nums;
}

/* --- Document language switch (RO / EN) ---------------------------------- */
/* Compact inline control. The old version was a full .panel-card that ate a
   further 203px on mobile. */

.lgl__lang {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    margin-top: 1.15rem;
}

.lgl__lang-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lgl__switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-surface);
}

.lgl__switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.9rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.lgl__switch a:hover,
.lgl__switch a:focus-visible {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.lgl__switch a.is-active {
    background: var(--accent);
    color: var(--bg-base);
}

.lgl__lang-note {
    flex: 1 1 22rem;
    min-width: 0;
    margin: 0;
    color: var(--text-faint);
    font-size: 0.76rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
 * Body: sticky contents rail + the document sheet
 * ----------------------------------------------------------------------- */

.lgl__body {
    display: grid;
    gap: clamp(1.1rem, 3vw, 2.75rem);
    padding-block: clamp(1.25rem, 3vw, 2rem) clamp(3rem, 6vw, 4.5rem);
}

@media (min-width: 1080px) {
    .lgl__body {
        grid-template-columns: 15.5rem minmax(0, 1fr);
        align-items: start;
    }
}

/* --- Contents ------------------------------------------------------------ */
/* Two nav blocks driven by one Blade partial: a sticky rail on wide screens, a
   collapsed <details> on narrow ones. Only links are duplicated (the ids live
   on the section headings), and the hidden one is display:none, so it is out of
   the accessibility tree. This avoids the "force a <details> open with CSS"
   trick, which Chromium's slot-based implementation does not reliably honour. */

.lgl__toc {
    display: none;
}

.lgl__toc-mobile {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

@media (min-width: 1080px) {
    .lgl__toc {
        display: block;
        position: sticky;
        top: 9rem; /* clears the sticky header + ticker bar (128px) */
        max-height: calc(100vh - 11rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .lgl__toc-mobile {
        display: none;
    }
}

.lgl__toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3rem;
    padding: 0.65rem 0.95rem;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.lgl__toc-mobile summary::-webkit-details-marker {
    display: none;
}

/* Chevron is a real <i> element (same pattern as .lp-faq__item on the
   homepage), not a CSS content glyph: if the Font Awesome CDN fails, an empty
   circle degrades gracefully where a ::after glyph would render tofu. */
.lgl__toc-mobile summary i {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.62rem;
    transition: transform 180ms ease;
}

.lgl__toc-mobile[open] summary {
    border-bottom: 1px solid var(--border-subtle);
}

.lgl__toc-mobile[open] summary i {
    transform: rotate(180deg);
}

.lgl__toc-title {
    margin: 0 0 0.7rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lgl__toc-list {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lgl__toc-mobile .lgl__toc-list {
    max-height: 60vh;
    padding: 0.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.lgl__toc-list li {
    color: inherit;
    font-size: inherit;
}

.lgl__toc-list a {
    display: block;
    padding: 0.42rem 0.6rem;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.lgl__toc-list a:hover,
.lgl__toc-list a:focus-visible {
    border-left-color: var(--accent);
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* --- The document sheet -------------------------------------------------- */
/* One continuous surface with hairline-separated sections, instead of 31
   free-floating gradient cards. Flat surface + 1px borders is the current
   house style, and it reads as a single document rather than a stack. */

.lgl__sheet {
    min-width: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
}

/* Anchor jumps must clear BOTH sticky bars. Measured: the site header ends at
   65px on mobile, and on desktop the ticker bar below it ends at 128px, so a
   single 6.5rem offset dropped jumped-to headings behind the ticker. */
.lgl__section {
    padding: clamp(1.15rem, 3.4vw, 2rem);
    scroll-margin-top: 5.5rem;
}

@media (min-width: 768px) {
    .lgl__section {
        scroll-margin-top: 9rem;
    }
}

.lgl__section + .lgl__section {
    border-top: 1px solid var(--border-subtle);
}

/* Heading now outranks body copy. It used to be 16.8px against 18px paragraphs,
   which flattened the whole document into an unscannable wall. */
.lgl__section h2 {
    max-width: 26em;
    margin: 0 0 0.85rem;
    color: var(--text-primary);
    font-size: clamp(1.02rem, 2.2vw, 1.22rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

/* Measure is capped in em, not ch: the body font's "0" glyph is ~0.63em wide,
   so 74ch resolved to ~92 real characters per line. 38em lands near 70. */
.lgl__section p {
    max-width: 38em;
    margin: 0;
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.72;
}

.lgl__section p + p {
    margin-top: 0.85rem;
}

.lgl__list {
    max-width: 38em;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.lgl__list li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.68;
}

.lgl__list li::before {
    content: "";
    position: absolute;
    top: 0.62rem;
    left: 0.3rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.75;
}

.lgl__note {
    max-width: 42em;
    margin: 1rem 0 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-left: 2px solid var(--accent-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.86rem;
    font-style: normal;
    line-height: 1.62;
}

/* --- Tables -------------------------------------------------------------- */
/* The old .table-shell forced `min-width: 620px` on the table but its parent
   card had no `min-width: 0`, so the card stretched to the table instead of the
   table scrolling inside it — /privacy and /cookies scrolled the whole PAGE
   sideways (891px of content on a 375px screen). The wrap owns the scroll now,
   and below 720px rows become stacked label/value blocks so there is nothing to
   scroll at all. */

.lgl__table-wrap {
    min-width: 0;
    margin-top: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    -webkit-overflow-scrolling: touch;
}

.lgl__table {
    width: 100%;
    border-collapse: collapse;
}

.lgl__table th,
.lgl__table td {
    padding: 0.72rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    font-size: 0.85rem;
    line-height: 1.55;
    text-align: left;
    vertical-align: top;
}

.lgl__table th {
    background: var(--bg-card-end);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lgl__table tbody tr:last-child td {
    border-bottom: 0;
}

.lgl__table td:first-child {
    color: var(--text-primary);
    font-weight: 650;
    overflow-wrap: anywhere;
}

@media (min-width: 720px) {
    .lgl__table {
        min-width: 40rem;
    }
}

/* Stacked card rows on phones. Header text comes from data-label, written by
   the Blade partial from the same `headers` array the <thead> uses. */
@media (max-width: 719px) {
    .lgl__table-wrap {
        overflow-x: visible;
        border: 0;
        border-radius: 0;
        background: none;
    }

    .lgl__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .lgl__table,
    .lgl__table tbody,
    .lgl__table tr,
    .lgl__table td {
        display: block;
    }

    .lgl__table tr {
        padding: 0.7rem 0.85rem;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        background: var(--bg-surface);
    }

    .lgl__table tr + tr {
        margin-top: 0.6rem;
    }

    .lgl__table td {
        padding: 0.4rem 0;
        border-bottom: 0;
    }

    .lgl__table td + td {
        border-top: 1px solid var(--border-subtle);
    }

    .lgl__table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        color: var(--text-faint);
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.09em;
        text-transform: uppercase;
    }

    .lgl__table td:empty {
        display: none;
    }
}

/* --- Cookie-settings call to action -------------------------------------- */

.lgl__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 2.85rem;
    margin-top: 1rem;
    padding: 0.65rem 1.35rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--bg-base);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.lgl__cta:hover {
    transform: translateY(-2px);
    background: var(--accent-hover);
    color: var(--bg-base);
}

/* --- Document footer ----------------------------------------------------- */

.lgl__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1.25rem;
    padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1.15rem, 3.4vw, 2rem);
    border-top: 1px solid var(--border-subtle);
}

.lgl__foot p {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.lgl__top {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.lgl__top:hover,
.lgl__top:focus-visible {
    color: var(--accent);
}

/* --- Focus + motion ------------------------------------------------------ */

.lgl a:focus-visible,
.lgl summary:focus-visible,
.lgl button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    .lgl__toc-mobile summary i,
    .lgl__cta,
    .lgl__switch a,
    .lgl__toc-list a {
        transition: none;
    }

    .lgl__cta:hover {
        transform: none;
    }
}
