/* ============================================================================
   Legal pages (Terms, Privacy, Refund) — EN / HE / RU
   ----------------------------------------------------------------------------
   These .legal-* rules were authored for the Business vertical's design system.
   SLAtech.Web uses a different token vocabulary (design-tokens.css), so the
   handful of legacy variable names the block relies on are aliased here.
   None of these names are defined or used elsewhere in SLAtech.Web — safe on :root.
   ========================================================================== */
:root {
    --navy: #1B2566;
    --navy-d: #0F172A;
    --teal: #1AAFAA;
    --teal-d: #13908C;
    --teal-bg: rgba(26,175,170,.12);
    --light: #F8FAFC;
    --border: #E2E8F0;
    --muted: #64748B;
    --dark: #0F172A;
    --white: #ffffff;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 20px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

/* ── Legal pages (Terms, Privacy, Refund) ───────────────────── */

/* Trust pills row in hero */
.legal-pills {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.legal-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    padding: 6px 16px;
    white-space: nowrap;
}

/* Key guarantees grid */
.legal-guarantees {
    padding: 56px 0;
    background: var(--white);
}

.legal-guarantees-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.legal-guarantee-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px 22px;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease;
}

.legal-guarantee-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.legal-guarantee-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.legal-guarantee-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.legal-guarantee-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.55;
}

/* Hero icon */
.legal-hero-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

/* Two-column layout: TOC sidebar + content */
.legal-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 0 60px;
    align-items: start;
}

/* TOC sidebar (sticky on desktop) */
.legal-toc {
    position: sticky;
    top: 110px;
    padding: 0;
    background: transparent;
    border: none;
}

.legal-toc-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.legal-toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-toc-list li {
    border-radius: var(--r-sm);
}

.legal-toc-list a {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    border-left: 2px solid transparent;
    transition: all .2s;
    line-height: 1.4;
}

.legal-toc-list a:hover {
    color: var(--teal);
    background: var(--teal-bg);
}

.legal-toc-list a.active {
    color: var(--teal-d);
    background: var(--teal-bg);
    border-left-color: var(--teal);
    font-weight: 700;
}

.legal-toc-list a .toc-num {
    font-weight: 700;
    color: var(--navy);
    margin-right: 3px;
    font-size: .78rem;
}

/* Section cards column */
.legal-section {
    padding: 0;
}

.legal-content {
    padding: 0;
    min-width: 0;
}

.legal-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px 36px;
    margin-bottom: 24px;
    border-left: 4px solid var(--teal);
    transition: box-shadow .25s ease;
}

.legal-card:hover {
    box-shadow: var(--shadow-sm);
}

.legal-card-alt {
    background: var(--light);
    border-left-color: var(--navy);
}

.legal-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.legal-card-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), #2a3a90);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legal-card-icon {
    font-size: 1.2rem;
}

.legal-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.legal-card p {
    font-size: .95rem;
    line-height: 1.75;
    color: var(--muted);
    margin-bottom: 10px;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

.legal-card ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.legal-card ul li {
    font-size: .92rem;
    line-height: 1.65;
    color: var(--muted);
    padding: 4px 0 4px 20px;
    position: relative;
}

.legal-card ul li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.legal-card a {
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}

.legal-card a:hover {
    border-bottom-color: var(--teal);
}

/* Callout box inside legal card */
.legal-callout {
    background: var(--teal-bg);
    border: 1px solid rgba(26,175,170,.18);
    border-radius: var(--r-md);
    padding: 16px 20px;
    margin: 14px 0;
    font-size: .92rem;
    font-weight: 600;
    color: var(--teal-d);
    line-height: 1.6;
}

/* CTA footer */
.legal-cta {
    background: var(--navy-d);
    padding: 56px 0;
    text-align: center;
}

.legal-cta-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.legal-cta-sub {
    font-size: .95rem;
    color: rgba(255,255,255,.55);
    margin-bottom: 24px;
}

.legal-cta .btn-hero-primary {
    display: inline-flex;
}

/* Company footer note */
.legal-footer-note {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 0 48px;
    font-size: .82rem;
    color: var(--muted);
    text-align: center;
}

.legal-footer-note a {
    color: var(--teal);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 991px) {
    .legal-body {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 0 48px;
    }

    .legal-toc {
        position: static;
        padding: 20px 0;
        border-bottom: 1px solid var(--border);
        background: var(--light);
        margin: 0 -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .legal-toc-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .legal-toc-list::-webkit-scrollbar {
        display: none;
    }

    .legal-toc-list a {
        white-space: nowrap;
        font-size: .76rem;
        padding: 5px 10px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .legal-toc-list a.active {
        border-left: none;
        border-bottom-color: var(--teal);
    }

    .legal-toc-title {
        display: none;
    }

    .legal-content {
        padding: 32px 0 0;
    }
}

@media (max-width: 768px) {
    .legal-guarantees-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-card {
        padding: 24px 20px;
    }

    .legal-pills {
        gap: 8px;
    }

    .legal-pill {
        font-size: .72rem;
        padding: 5px 12px;
    }
}

@media (max-width: 480px) {
    .legal-guarantees-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL adjustments for legal TOC sidebar */
[dir="rtl"] .legal-toc-list a {
    border-left: none;
    border-right: 2px solid transparent;
}

[dir="rtl"] .legal-toc-list a.active {
    border-left: none;
    border-right-color: var(--teal);
}

[dir="rtl"] .legal-toc-list a .toc-num {
    margin-right: 0;
    margin-left: 3px;
}

[dir="rtl"] .legal-card {
    border-left: 1px solid var(--border);
    border-right: 4px solid var(--teal);
}

[dir="rtl"] .legal-card-alt {
    border-right-color: var(--navy);
}

[dir="rtl"] .legal-card ul li {
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .legal-card ul li::before {
    left: auto;
    right: 0;
}
