/* ════════════════════════════════════════════════════
   legal-modal.css — модальное окно правовых документов
   ════════════════════════════════════════════════════ */

/* Оверлей */
.lm_overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(1, 20, 30, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lm_overlay.lm_active {
    opacity: 1;
    visibility: visible;
}

/* Окно */
.lm_modal {
    background: var(--white, #fff);
    border-radius: 24px;
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 120px rgba(1, 63, 84, 0.28);
    transform: scale(0.94) translateY(16px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    overflow: hidden;
}
.lm_overlay.lm_active .lm_modal {
    transform: scale(1) translateY(0);
}

/* Шапка попапа */
.lm_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    flex-shrink: 0;
}
.lm_header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main, #222);
    line-height: 1.3;
}
.lm_close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-secondary, #858585);
}
.lm_close:hover {
    background: rgba(0, 190, 162, 0.12);
    color: var(--accent, #00BEA2);
}
.lm_close svg {
    width: 16px;
    height: 16px;
}

/* Тело — прокручиваемый контент */
.lm_body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Скроллбар в теле */
.lm_body::-webkit-scrollbar { width: 5px; }
.lm_body::-webkit-scrollbar-track { background: transparent; }
.lm_body::-webkit-scrollbar-thumb { background: rgba(0,190,162,0.3); border-radius: 100px; }
.lm_body::-webkit-scrollbar-thumb:hover { background: rgba(0,190,162,0.6); }

/* Лоадер */
.lm_loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 40px;
    color: var(--text-secondary, #858585);
    font-size: 14px;
}
.lm_spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 190, 162, 0.15);
    border-top-color: var(--accent, #00BEA2);
    border-radius: 50%;
    animation: lm_spin 0.7s linear infinite;
}
@keyframes lm_spin {
    to { transform: rotate(360deg); }
}

/* Ошибка загрузки */
.lm_error {
    padding: 40px 32px;
    text-align: center;
    color: var(--text-secondary, #858585);
    font-size: 14px;
    line-height: 1.6;
}
.lm_error strong {
    display: block;
    font-size: 16px;
    color: var(--text-main, #222);
    margin-bottom: 8px;
}

/* Контент документа внутри попапа */
.lm_body .legal_wrap {
    padding: 28px 28px 40px;
    max-width: 100%;
}
.lm_body .legal_title {
    font-size: 20px;
}
.lm_body .legal_meta {
    margin-bottom: 24px;
    padding-bottom: 18px;
}
.lm_body .legal_section {
    margin-bottom: 24px;
}

/* Адаптив */
@media (max-width: 600px) {
    .lm_overlay { padding: 12px; align-items: flex-end; }
    .lm_modal {
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(40px);
    }
    .lm_overlay.lm_active .lm_modal { transform: translateY(0); }
    .lm_header { padding: 16px 20px; }
    .lm_body .legal_wrap { padding: 20px 20px 32px; }
}
