/* ==== POPUP (минимальный стиль под старый вид) ==== */

/* Когда работаем без Fancybox (fallback), окно занимает вьюпорт */
.reqmod--open {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ВНУТРЕННИЙ overlay по умолчанию выключен; включается только в fallback */
.reqmod__overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}
.reqmod--open .reqmod__overlay { display: block; }

/* Контейнер попапа */
.reqmod { background: transparent !important; }

/* Панель окна */
.reqmod__panel {
    position: relative;
    z-index: 1;
    width: 620px;
    max-width: 96vw;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    padding: 24px;
    font-family: Arial, Helvetica, sans-serif;
}

/* Кнопка закрытия (только наша) */
.reqmod__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}
.reqmod__close:hover { color: #111827; }

.reqmod__head { margin-bottom: 12px; }
.reqmod__title { font-size: 22px; font-weight: 700; color: #111; }

.reqmod__body { position: relative; min-height: 220px; }

/* Форма — плавно исчезает при успехе */
.reqmod__form {
    transition: opacity .28s ease, transform .28s ease;
    opacity: 1;
    transform: translateY(0);
}
.reqmod--success .reqmod__form {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.reqmod__row { margin-bottom: 12px; }
.reqmod__input {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid #d4d7dc;
    border-radius: 8px;
    background: #f3f5f7;
}
.reqmod__input:focus { outline: none; border-color: #c4010c; background: #fff; }
.reqmod__input--ro { color: #111; background: #eee; }

.reqmod__agree { font-size: 13px; color: #2b5c8a; margin: 6px 0 12px; }
.reqmod__note  { text-align: left; font-size: 12px; color: #9aa0a6; margin-top: 8px; }

.reqmod__actions { margin-top: 8px; }
.reqmod__submit {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    cursor: pointer;
    background: linear-gradient(180deg, #d63939 0%, #c4010c 100%);
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
}
.reqmod__submit:hover { filter: brightness(.98); }

/* Результаты (ошибка/статус) */
.reqmod__results {
    min-height: 18px;
    margin: 6px 0 12px;
    font-size: 13px;
}
.reqmod__results--ok  { color: #127a2e; }
.reqmod__results--err { color: #b91c1c; }
/* Прятать статусную строку после успешной отправки */
.reqmod--success .reqmod__results { display: none !important; }

/* SUCCESS overlay — показывается по классу .reqmod--success */
.reqmod__success {
    position: absolute;
    inset: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}
.reqmod--success .reqmod__success {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.reqmod__successIcon {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 2px solid #16a34a;
    color: #16a34a;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 22px;
}
.reqmod__successTitle { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.reqmod__successText  { font-size: 14px; color: #334155; }

/* ==== РЕЖИМ FANCYBOX: убрать «белый лист» и строго отцентрировать ==== */

/* Прозрачный фон у всех обёрток */
.fancybox-container .fancybox-stage,
.fancybox-container .fancybox-slide,
.fancybox-container .fancybox-content {
    background: transparent !important;
}

/* Растягиваем Stage и Slide на весь вьюпорт */
.fancybox-container,
.fancybox-container .fancybox-stage,
.fancybox-container .fancybox-slide,
.fancybox-container .fancybox-slide--inline {
    height: 100vh !important;
    min-height: 100vh !important;
}

/* Центрирование контента по обеим осям */
.fancybox-container .fancybox-slide--inline {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Контент — ровно по размеру панели без внешних отступов/тени */
.fancybox-container .fancybox-content {
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    margin: 0 !important;
    display: inline-block !important;
    max-width: none !important;
}

/* Наш внутренний overlay в режиме fancybox скрыт (страховка) */
.fancybox-active #request_popup .reqmod__overlay { display: none !important; }

/* Прячем системный крестик Fancybox (он отключён и в JS) */
.fancybox-active .fancybox-close-small,
.fancybox-active [data-fancybox-close] { display: none !important; }

/* Гасим легаси-правила ширины (#request_popup { width:50% }) от старых стилей */
#request_popup { width: auto !important; min-width: 0 !important; }
#request_popup .reqmod__panel { width: 620px; max-width: 96vw; }
