/* ============================================================
 * Atlas modal — lead magnet dialog.
 * Связан с atlas-modal.php / atlas-modal.js
 * Использует CSS-переменные темы softstyle (см. assets/css/style.css :root)
 * ============================================================ */

.atlas-modal[hidden] { display: none !important; }

.atlas-modal {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.atlas-modal.is-open { opacity: 1; }

.atlas-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(10, 20, 20, 0.72);
    cursor: pointer;
}

.atlas-modal__dialog {
    position: relative;
    width: 100%; max-width: 980px;
    max-height: calc(100vh - 40px);
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    overflow: hidden;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.25s ease;
}
.atlas-modal.is-open .atlas-modal__dialog { transform: translateY(0) scale(1); }

.atlas-modal__close {
    position: absolute; top: 10px; right: 12px;
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.92);
    border: 0; border-radius: 50%;
    font-size: 26px; line-height: 1; color: var(--black);
    cursor: pointer; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.2s ease, color 0.2s ease;
}
.atlas-modal__close:hover { background: var(--ss-accent, #8B7B6D); color: var(--white); }
.atlas-modal__close:focus-visible { outline: 2px solid var(--ss-accent, #8B7B6D); outline-offset: 2px; }

.atlas-modal__inner {
    display: grid;
    grid-template-columns: 55% 45%;
    max-height: calc(100vh - 40px);
}

.atlas-modal__media {
    position: relative;
    background: var(--beige, #B2A298);
    max-height: calc(100vh - 40px);
    overflow: hidden;
}
.atlas-modal__photo {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    min-height: 280px;
}
.atlas-modal__tags {
    position: absolute; left: 12px; bottom: 12px;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.atlas-modal__tags span {
    padding: 5px 12px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px; font-weight: 500;
    color: var(--white);
    background: rgba(10, 50, 49, 0.78);
    border-radius: 999px;
}

.atlas-modal__body {
    padding: 32px 32px 28px;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.atlas-modal__title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 26px; font-weight: 500; line-height: 1.2;
    color: var(--black);
    margin: 0 0 8px;
}

.atlas-modal__lead {
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px; line-height: 1.5;
    color: var(--ss-accent, #8B7B6D);
    margin: 0 0 20px;
}
.atlas-modal__lead:empty { display: none; }

.atlas-modal__form { display: flex; flex-direction: column; gap: 12px; }
.atlas-modal__hp   { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

.atlas-modal__field { display: flex; flex-direction: column; gap: 4px; }
.atlas-modal__field span {
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px; font-weight: 500;
    color: var(--grey3, #555);
    letter-spacing: 0.02em;
}
.atlas-modal__field input {
    height: 44px; padding: 0 14px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 15px;
    color: var(--black);
    background: var(--grey, #F9F9F9);
    border: 1px solid var(--grey2, #CDCDCD);
    border-radius: 2px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.atlas-modal__field input:focus {
    outline: none;
    border-color: var(--ss-accent, #8B7B6D);
    background: var(--white);
}
.atlas-modal__field input[aria-invalid="true"] { border-color: #c44; }

.atlas-modal__submit {
    height: 48px;
    margin-top: 4px;
    font-family: "Montserrat", sans-serif;
    font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
    color: var(--white);
    background: var(--ss-accent, #8B7B6D);
    border: 0; border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.atlas-modal__submit:hover  { background: var(--black); }
.atlas-modal__submit:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.atlas-modal__submit[disabled] { opacity: 0.5; cursor: progress; }

.atlas-modal__status {
    min-height: 18px; margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 13px; line-height: 1.4;
}
.atlas-modal__status.is-ok    { color: #2a7f3a; }
.atlas-modal__status.is-error { color: #c44; }

.atlas-modal__legal {
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 11px; line-height: 1.4;
    color: var(--grey3, #777);
}
.atlas-modal__legal a { color: var(--ss-accent, #8B7B6D); text-decoration: underline; }

.atlas-modal__alt {
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--grey2, #CDCDCD);
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    font-family: "Roboto", Arial, sans-serif; font-size: 13px;
    color: var(--grey3, #555);
}
.atlas-modal__phone,
.atlas-modal__wa {
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    border-bottom: 1px solid var(--ss-accent, #8B7B6D);
    transition: color 0.15s ease;
}
.atlas-modal__phone:hover,
.atlas-modal__wa:hover { color: var(--ss-accent, #8B7B6D); }

.atlas-modal__trust {
    list-style: none; padding: 0; margin: 18px 0 0;
    display: flex; flex-direction: column; gap: 6px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px; line-height: 1.4;
    color: var(--grey3, #666);
}
.atlas-modal__trust li { padding-left: 18px; position: relative; }
.atlas-modal__trust li::before {
    content: "✓";
    position: absolute; left: 0; top: 0;
    color: var(--ss-accent, #8B7B6D); font-weight: 700;
}

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

/* Mobile */
@media (max-width: 767px) {
    .atlas-modal { padding: 0; align-items: stretch; }
    .atlas-modal__dialog { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .atlas-modal__inner { grid-template-columns: 1fr; max-height: 100vh; overflow-y: auto; }
    .atlas-modal__media { max-height: 40vh; }
    .atlas-modal__photo { max-height: 40vh; object-fit: cover; }
    .atlas-modal__body  { padding: 22px 20px 24px; max-height: none; }
    .atlas-modal__title { font-size: 22px; }
}
