/* ===== Универсальная модалка юридических документов ===== */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.legal-modal.is-open { display: flex; }

.legal-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: legalFade .25s ease both;
}

.legal-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: legalPop .3s cubic-bezier(.2,.9,.3,1.15) both;
}
@keyframes legalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes legalPop {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 23, 42, 0.05);
    color: #475569;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
    z-index: 2;
}
.legal-modal__close:hover { background: rgba(15, 23, 42, 0.10); color: #0f172a; }

.legal-modal__head {
    padding: 24px 28px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    flex: 0 0 auto;
}
.legal-modal__eyebrow {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #7c3aed;
    font-weight: 600;
    margin-bottom: 6px;
}
.legal-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    padding-right: 40px;
}

.legal-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 28px 24px;
    color: #334155;
    font-size: 15px;
    line-height: 1.65;
    scrollbar-gutter: stable;
}
.legal-modal__body h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 22px 0 8px;
}
.legal-modal__body h2:first-child { margin-top: 0; }
.legal-modal__body p { margin: 0 0 12px; }
.legal-modal__body ul, .legal-modal__body ol {
    margin: 8px 0 14px;
    padding-left: 22px;
}
.legal-modal__body li { margin-bottom: 6px; }
.legal-modal__body a { color: #2563eb; text-decoration: underline; }
.legal-modal__body a:hover { color: #1d4ed8; }
.legal-modal__body strong { color: #0f172a; font-weight: 600; }
.legal-modal__body .legal-doc__date {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 18px;
    font-style: italic;
}

.legal-modal__foot {
    padding: 14px 28px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    background: #f8fafc;
}
.legal-modal__foot a {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
}
.legal-modal__foot a:hover { text-decoration: underline; }
.legal-modal__foot-close {
    padding: 9px 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.30);
    transition: transform .15s ease, box-shadow .2s ease;
}
.legal-modal__foot-close:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124, 58, 237, 0.38); }

.legal-modal__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: #94a3b8;
}
.legal-modal__loader::after {
    content: '';
    width: 28px; height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: legalSpin .8s linear infinite;
}
@keyframes legalSpin { to { transform: rotate(360deg); } }

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

@media (max-width: 600px) {
    .legal-modal { padding: 0; }
    .legal-modal__dialog { max-height: 100vh; border-radius: 0; }
    .legal-modal__head { padding: 22px 18px 14px; }
    .legal-modal__title { font-size: 19px; padding-right: 44px; }
    .legal-modal__body { padding: 14px 18px 18px; font-size: 14.5px; }
    .legal-modal__foot { padding: 12px 18px; flex-direction: column-reverse; align-items: stretch; }
    .legal-modal__foot-close { width: 100%; }
    .legal-modal__foot a { text-align: center; }
}
