/* Модальні вікна юридичних документів (Cookie / Privacy Policy / Disclaimer) */

button.footer-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}


.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.legal-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.legal-modal-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 16px auto;
    background: var(--card-bg, #fff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.legal-modal-overlay.open .legal-modal-card {
    transform: translateY(0) scale(1);
}

.legal-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #F1F3F6;
    color: #6C757D;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.legal-modal-close:hover,
.legal-modal-close:focus-visible {
    background: #E4E6EB;
    color: #1c1e21;
}

.legal-modal-header {
    padding: 24px 52px 16px 24px;
    border-bottom: 1px solid #EDEFF2;
    flex-shrink: 0;
}

.legal-modal-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1c1e21;
    line-height: 1.3;
}

.legal-modal-updated {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-sub, #6C757D);
}

.legal-modal-body {
    padding: 20px 24px 28px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #1c1e21;
}

.legal-modal-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 6px;
}

.legal-modal-body h3:first-child {
    margin-top: 0;
}

.legal-modal-body p {
    margin-bottom: 10px;
}

.legal-modal-body ul {
    margin: 0 0 10px 18px;
}

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

body.legal-modal-locked {
    overflow: hidden;
}

@media (min-width: 640px) {
    .legal-modal-overlay {
        align-items: center;
    }

    .legal-modal-card {
        max-height: calc(100vh - 64px);
    }
}
