/* Арт-Тур Формы — попап без сдвига страницы + служебные элементы.
   Стили полей форм (.cf7-order-*, .cf7-modern и т.д.) берутся из style.css темы. */

/* Резервируем место под скроллбар всегда — при открытии попапа страница не дёргается */
html { scrollbar-gutter: stable; }
html.artform-lock { overflow: hidden; }

/* ---- Оверлей ---- */
.artform-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 16px;
    background: rgba(28, 30, 34, .78);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    overflow: hidden;               /* свой скролл у оверлея не появляется */
}
.artform-overlay.is-open { display: flex; }

/* ---- Окно ---- */
.artform-window {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;               /* длинная форма скроллится внутри окна */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    animation: artform-pop .18s ease;
}
@keyframes artform-pop {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.artform-window-inner { padding: 26px 26px 22px; }

/* ---- Кнопка закрытия ---- */
.artform-close {
    position: sticky;
    top: 0;
    float: right;
    margin: 8px 8px -34px 0;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.artform-close:hover { background: #378ADD; color: #fff; }

/* ---- Honeypot (скрытая ловушка для ботов) ---- */
.artform-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---- Капча (арифметика) ---- */
.artform-captcha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.artform-captcha-label { font-weight: 600; white-space: nowrap; }
.artform-captcha .artform-q { color: #378ADD; }
.artform-captcha .artform-answer {
    width: 120px; padding: 9px 12px;
    border: 1px solid #cfd6e0; border-radius: 8px;
    font-size: 15px;
}

/* ---- Ответ (успех/ошибка) ---- */
.artform-response { margin-top: 12px; font-size: 14px; }
.artform-response.is-error   { color: #c0392b; }
.artform-response.is-success { color: #1e874b; font-weight: 600; }

/* ---- Кнопка отправки (фолбэк — если селектор темы не поймает <button>) ---- */
.artform-submit {
    display: inline-block;
    padding: 12px 28px;
    border: 0;
    border-radius: 8px;
    background: #378ADD;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .15s;
}
.artform-submit:hover { background: #2b6fb3; }

/* ---- Состояние отправки ---- */
.artform-submit[disabled] { opacity: .6; cursor: default; }
.artform-form.is-sending { opacity: .75; pointer-events: none; }

/* подсветка незаполненного обязательного поля */
.artform-invalid { border-color: #c0392b !important; box-shadow: 0 0 0 1px rgba(192,57,43,.25); }

/* ---- Успешная отправка: прячем поля, показываем сообщение ---- */
.artform-form.is-done .cf7-order,
.artform-form.is-done .cf7-modern,
.artform-form.is-done .artform-captcha { display: none; }
.artform-form.is-done .artform-response {
    font-size: 17px; text-align: center; padding: 24px 8px;
}

@media (max-width: 480px) {
    .artform-window-inner { padding: 20px 16px 18px; }
    .artform-overlay { padding: 2vh 10px; }
}
