/* Legal / policy pages */

.legal-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

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

.legal-nav-panel {
    position: sticky;
    top: 16px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
    padding: 18px 14px;
    opacity: 0;
    transform: translateX(-18px);
    animation: legalEnterLeft 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.legal-nav-label {
    margin: 0 10px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.legal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legal-nav-link {
    position: relative;
    display: block;
    padding: 10px 12px 10px 14px;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0;
    transform: translateX(-8px);
    animation: legalEnterLeft 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(0.12s + var(--i, 0) * 0.06s);
    transition:
        background 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.legal-nav-link::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 3px;
    background: var(--dv-primary);
    transform: translateY(-50%);
    transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-nav-link:hover {
    background: #f1f5f9;
    color: var(--dv-primary);
    transform: translateX(3px);
}

.legal-nav-link.is-active {
    background: rgba(42, 73, 220, 0.1);
    color: var(--dv-primary);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(42, 73, 220, 0.08);
}

.legal-nav-link.is-active::before {
    height: 58%;
}

.legal-shell {
    min-width: 0;
    opacity: 0;
    transform: translateY(16px);
    animation: legalEnterUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.legal-shell .account-shell-header {
    position: relative;
    overflow: hidden;
}

.legal-shell .account-shell-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--dv-primary), var(--dv-primary-light, #6d97e8));
    animation: legalLineGrow 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.legal-shell .account-page-title {
    opacity: 0;
    transform: translateY(8px);
    animation: legalEnterUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}

.legal-shell .account-page-sub,
.legal-shell .account-back-link {
    opacity: 0;
    animation: legalFadeIn 0.45s ease 0.22s forwards;
}

.legal-body {
    padding: 22px 28px 32px;
    color: #334155;
    font-size: 15px;
    line-height: 1.7;
}

.legal-section + .legal-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}

.legal-section {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.legal-section h2 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.35;
}

.legal-section p {
    margin: 0 0 10px;
}

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

.legal-section ul {
    margin: 0 0 10px;
    padding-left: 1.25rem;
}

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

.legal-closing {
    margin-top: 14px !important;
}

@keyframes legalEnterLeft {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes legalEnterUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes legalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes legalLineGrow {
    from { width: 0; }
    to { width: 100%; }
}

/* Site footer */
.site-footer {
    background: #162075;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 0;
    padding: 36px 0 22px;
}

.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 28px;
}

.site-footer-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.site-footer-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    max-width: 340px;
}

.site-footer-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.site-footer-links a:hover,
.site-footer-links a.is-active {
    color: #fabe3e;
    transform: translateX(3px);
}

.site-footer-contact {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

.site-footer-contact a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer-contact a:hover {
    color: #fabe3e;
}

.site-footer-bottom {
    max-width: 1180px;
    margin: 24px auto 0;
    padding: 16px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.page-legal .main-layout {
    height: auto !important;
    min-height: calc(100vh - var(--dv-header-h, 120px));
    overflow: visible !important;
    padding: 12px 16px 24px !important;
}

.page-legal .site-footer {
    margin-top: auto;
}

@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-nav-panel {
        position: static;
        transform: translateY(12px);
        animation-name: legalEnterUp;
    }

    .legal-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .legal-nav-link {
        transform: translateY(8px);
        animation-name: legalEnterUp;
    }

    .legal-nav-link:hover {
        transform: translateY(-1px);
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

@media (max-width: 576px) {
    .legal-nav {
        grid-template-columns: 1fr;
    }

    .legal-body {
        padding: 18px 18px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legal-nav-panel,
    .legal-nav-link,
    .legal-shell,
    .legal-shell .account-page-title,
    .legal-shell .account-page-sub,
    .legal-shell .account-back-link,
    .legal-shell .account-shell-header::after,
    .legal-section {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .legal-shell .account-shell-header::after {
        width: 100%;
    }

    .legal-nav-link.is-active::before {
        height: 58%;
    }
}
