/*
 * Стили попап-формы веб-форм Bitrix для Аспро Максимум.
 * Подключается из popup_forms.php.
 */

/* ─────── Скрытые контейнеры с формами ───────
   Используем off-screen позиционирование вместо display:none —
   так JS Аспро Максимум корректно инициализирует кастомные UI-элементы
   формы (toggle-чекбоксы, маски телефона, селекты). */
.ptf-source {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
}

/* ─────── Оверлей ─────── */
.ptf-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity .2s ease;
}
.ptf-overlay.is-open { display: block; opacity: 1; }

/* ─────── Модальное окно ─────── */
.ptf-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -48%);
    background: #fff;
    padding: 40px 40px 36px;
    border-radius: 16px;
    width: 92%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    z-index: 10001;
    display: none;
    opacity: 0;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.22);
    font-family: 'Montserrat', 'Arial', sans-serif;
    transition: opacity .2s ease, transform .2s ease;
}
.ptf-modal.is-open {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%);
}
.ptf-modal__close {
    position: absolute; top: 16px; right: 18px;
    width: 32px; height: 32px;
    background: transparent; border: 0;
    font-size: 26px; line-height: 1;
    color: #b0b0b0;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}
.ptf-modal__close:hover { color: #000; }
.ptf-modal__title {
    margin: 0 0 24px;
    font-weight: 600;
    font-size: 26px;
    line-height: 1.2;
    color: #1a1a1a;
    padding-right: 30px;
}
.ptf-modal__body { visibility: visible; }

/* Скрываем встроенный заголовок формы — чтобы не дублировал заголовок попапа */
.ptf-modal__body h1,
.ptf-modal__body h2,
.ptf-modal__body h3,
.ptf-modal__body h4,
.ptf-modal__body h5,
.ptf-modal__body h6,
.ptf-modal__body .form-title,
.ptf-modal__body .form-header,
.ptf-modal__body .form-name,
.ptf-modal__body .web-form-title,
.ptf-modal__body .web-form-name { display: none !important; }

@media (max-width: 600px) {
    .ptf-modal { padding: 28px 20px 24px; border-radius: 14px; }
    .ptf-modal__title { font-size: 22px; margin-bottom: 20px; }
}
