/* =============================================
   FONDOSTECH LEGAL PAGES — TERMS / POLICY LAYOUT
   ============================================= */

.legal-hero {
    background-color: var(--bg-light, #F5FAFF);
    background-image:
        radial-gradient(circle at 50% -20%, rgba(219, 234, 254, 0.75) 0%, rgba(245, 250, 255, 0.88) 55%, rgba(255, 255, 255, 0.96) 100%);
    padding: 8.25rem 0 3.75rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-active, #CEE4FD);
}

.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(8, 106, 216, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(8, 106, 216, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 75%);
    pointer-events: none;
}

.legal-glow-orb {
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(8, 106, 216, 0.16) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(70px);
    pointer-events: none;
}

.legal-glow-orb-1 {
    top: -120px;
    left: 8%;
}

.legal-glow-orb-2 {
    bottom: -140px;
    right: 6%;
}

.legal-breadcrumb {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 1.35rem;
}

.legal-breadcrumb a {
    color: #64748b;
}

.legal-breadcrumb a:hover {
    color: #086ad8;
}

.legal-hero-badge {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #cee4fd;
    border-radius: 2.5rem;
    padding: 0.4rem 0.95rem;
    box-shadow: 0 2px 8px rgba(33, 37, 41, 0.04);
    color: #086ad8;
    font-size: 0.78125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.15rem;
}

.legal-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #086ad8;
    box-shadow: 0 0 0 0 rgba(8, 106, 216, 0.5);
    animation: legalBadgePulse 2s infinite;
}

@keyframes legalBadgePulse {
    0% { box-shadow: 0 0 0 0 rgba(8, 106, 216, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(8, 106, 216, 0); }
    100% { box-shadow: 0 0 0 0 rgba(8, 106, 216, 0); }
}

.legal-hero-title {
    position: relative;
    z-index: 2;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.5px;
    color: #212529;
    margin-bottom: 1.15rem;
    max-width: 18ch;
}

.legal-hero-lead {
    position: relative;
    z-index: 2;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #495057;
    max-width: 760px;
    margin-bottom: 1.5rem;
}

.legal-hero-meta {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.legal-meta-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #cee4fd;
    border-radius: 2.5rem;
    padding: 0.55rem 0.95rem;
    color: #212529;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33, 37, 41, 0.04);
    max-width: 100%;
    white-space: normal;
    line-height: 1.45;
}

.legal-meta-chip svg {
    color: #086ad8;
    flex-shrink: 0;
}

.legal-body-section {
    padding: 3.5rem 0 6rem;
    background: #f5faff;
}

.legal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.legal-sidebar {
    align-self: start;
    z-index: 20;
    will-change: transform;
}

.legal-toc-card {
    background: #ffffff;
    border: 1px solid #cee4fd;
    border-radius: 1.5rem;
    padding: 1.35rem 1.15rem;
    box-shadow: 0 6px 24px rgba(33, 37, 41, 0.04);
    max-height: calc(100vh - 8.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.legal-sidebar.is-stuck .legal-toc-card {
    box-shadow: 0 12px 32px rgba(8, 106, 216, 0.12);
}

.legal-toc-title {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #086ad8;
    margin-bottom: 0.85rem;
    padding: 0 0.4rem 0.75rem;
    border-bottom: 1px solid #eef0f1;
}

.legal-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.legal-toc-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.65rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    border-left: 2px solid transparent;
}

.legal-toc-link span {
    flex-shrink: 0;
    width: 1.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
}

.legal-toc-link:hover,
.legal-toc-link.active {
    color: #086ad8;
    background: #eff6ff;
    border-left-color: #086ad8;
}

.legal-toc-link.active span,
.legal-toc-link:hover span {
    color: #086ad8;
}

.legal-document {
    background: #ffffff;
    border: 1px solid #cee4fd;
    border-radius: 1.5rem;
    padding: 2.5rem 2.75rem 2.75rem;
    box-shadow: 0 6px 24px rgba(8, 106, 216, 0.06);
}

.legal-mobile-toc {
    background: #f5faff;
    border: 1px solid #cee4fd;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.75rem;
    z-index: 30;
    will-change: transform;
}

.legal-mobile-toc.is-stuck {
    box-shadow: 0 10px 24px rgba(8, 106, 216, 0.12);
}

.legal-mobile-toc summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #086ad8;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.legal-mobile-toc summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #086ad8;
    border-bottom: 2px solid #086ad8;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.legal-mobile-toc[open] summary::after {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

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

.legal-mobile-toc nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.legal-mobile-toc nav a {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 0;
}

.legal-document h2 {
    scroll-margin-top: 7rem;
}

.legal-block {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eef0f1;
    scroll-margin-top: 7rem;
}

.legal-block-last {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.legal-block h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    color: #212529;
    margin-bottom: 1rem;
}

.legal-block h3 {
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.4;
    color: #212529;
    margin: 1.35rem 0 0.65rem;
}

.legal-inline-link {
    color: #086ad8;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 0.4rem;
    border-radius: 0.7rem;
    background: #eff6ff;
    border: 1px solid #cee4fd;
    color: #086ad8;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.legal-block p {
    font-size: 1.0125rem;
    line-height: 1.75;
    color: #495057;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
}

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

.legal-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0.25rem 0 0.5rem;
    padding: 0;
    list-style: none;
}

.legal-list li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 1.0125rem;
    line-height: 1.7;
    color: #495057;
    overflow-wrap: break-word;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #086ad8;
}

.legal-callout,
.legal-law-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f5faff 100%);
    border: 1px solid #cee4fd;
    border-left: 4px solid #086ad8;
    border-radius: 0 1rem 1rem 0;
    padding: 1.15rem 1.25rem;
    margin-top: 0.5rem;
}

.legal-callout-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #086ad8;
    margin-bottom: 0.4rem;
}

.legal-callout p,
.legal-law-card p {
    margin-bottom: 0;
    color: #212529;
}

.legal-notice {
    margin-top: 1.15rem;
    background: #f8fafc;
    border: 1px solid #cee4fd;
    border-radius: 1rem;
    padding: 1.15rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #212529;
}

.legal-contact-card {
    background: #f5faff;
    border: 1px solid #cee4fd;
    border-radius: 1.25rem;
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.legal-contact-name {
    font-size: 1.0625rem;
    font-weight: 800;
    color: #212529;
}

.legal-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: #212529;
    font-size: 0.9875rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.legal-contact-row img,
.legal-contact-row svg {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.legal-contact-row:hover {
    color: #086ad8;
}

@media (max-width: 1199.98px) {
    .legal-hero-title {
        font-size: 2.5rem;
        max-width: none;
    }

    .legal-layout {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 1.5rem;
    }

    .legal-document {
        padding: 2rem 1.75rem;
    }
}

@media (max-width: 991.98px) {
    .legal-hero {
        padding: 6.75rem 0 2.5rem;
    }

    .legal-hero-title {
        font-size: 2.15rem;
        max-width: none;
    }

    .legal-hero-lead {
        font-size: 1.0625rem;
        margin-bottom: 1.25rem;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .legal-sidebar {
        display: none;
    }

    .legal-body-section {
        padding: 1.75rem 0 4rem;
    }

    .legal-document {
        padding: 1.75rem 1.35rem 2rem;
    }

    .legal-block h2 {
        align-items: flex-start;
    }

    .legal-mobile-toc {
        transform: none !important;
        max-height: none;
        overflow: visible;
    }

    .legal-block,
    .legal-document h2 {
        scroll-margin-top: 6.25rem;
    }
}

@media (max-width: 575.98px) {
    .legal-hero {
        padding: 6.25rem 0 2rem;
    }

    .legal-hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.9rem;
    }

    .legal-hero-lead {
        font-size: 0.9875rem;
        line-height: 1.65;
    }

    .legal-meta-chip {
        width: 100%;
        border-radius: 1rem;
        font-size: 0.8125rem;
        padding: 0.6rem 0.85rem;
    }

    .legal-document {
        padding: 1.25rem 1rem 1.5rem;
        border-radius: 1.15rem;
    }

    .legal-block {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .legal-block h2 {
        font-size: 1.2rem;
        gap: 0.6rem;
    }

    .legal-block p,
    .legal-list li {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .legal-section-num {
        min-width: 2.05rem;
        height: 2.05rem;
        font-size: 0.75rem;
        margin-top: 0.1rem;
    }

    .legal-callout,
    .legal-law-card,
    .legal-notice,
    .legal-contact-card {
        padding: 1rem 1.05rem;
        border-radius: 0.9rem;
    }

    .legal-notice {
        font-size: 0.8125rem;
        letter-spacing: 0;
    }

    .legal-contact-name {
        font-size: 1rem;
    }

    .legal-contact-row {
        font-size: 0.9rem;
    }
}
