/* ============================================================================
 * popup-v2.css — лид-попап, новый дизайн (этап 3.3)
 * Селекторы с префиксом popup-v2-* чтобы не конфликтовать со старым modalForm.
 * ========================================================================== */

.popup-v2-overlay {
    --pv2-color-dark: #1D1D1D;
    --pv2-color-text: #333;
    --pv2-color-text-light: #666;
    --pv2-color-accent: #00838F;
    --pv2-color-primary: #00BCD4;
    --pv2-color-error: #D32F2F;

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 200ms ease;
    font-family: 'Arial Rounded MT Pro Cyr', Arial, sans-serif;
}

.popup-v2-overlay.is-active {
    display: flex;
    opacity: 1;
}

.popup-v2-overlay.is-closing {
    opacity: 0;
}

.popup-v2-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 36px 36px 28px;
    transform: scale(0.95);
    transition: transform 200ms ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
}

.popup-v2-overlay.is-active .popup-v2-card {
    transform: scale(1);
}

.popup-v2-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
    transition: background 150ms ease, color 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.popup-v2-close:hover {
    background: #f5f5f5;
    color: #333;
}

.popup-v2-close svg {
    width: 18px;
    height: 18px;
}

.popup-v2-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pv2-color-dark);
    margin: 0 0 8px;
    text-align: center;
    text-transform: none;
}

.popup-v2-subtitle {
    font-size: 14px;
    color: var(--pv2-color-text-light);
    text-align: center;
    margin: 0 0 18px;
}

.popup-v2-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}

.popup-v2-perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--pv2-color-text);
}

.popup-v2-perks li::before {
    content: '';
    width: 18px;
    height: 18px;
    background-color: var(--pv2-color-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / contain;
    flex-shrink: 0;
}

/* ----- Минимальная стилизация CF7 внутри попапа ----- */
.popup-v2-card .wpcf7-form p {
    margin: 0 0 14px;
}

.popup-v2-card .wpcf7-form input[type="text"],
.popup-v2-card .wpcf7-form input[type="email"],
.popup-v2-card .wpcf7-form input[type="tel"],
.popup-v2-card .wpcf7-form textarea {
    width: 100%;
    height: 44px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--pv2-color-text);
    background: #fff;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    box-sizing: border-box;
}

.popup-v2-card .wpcf7-form textarea {
    height: auto;
    min-height: 70px;
    padding: 10px 14px;
    resize: vertical;
    line-height: 1.5;
}

.popup-v2-card .wpcf7-form input[type="text"]:focus,
.popup-v2-card .wpcf7-form input[type="email"]:focus,
.popup-v2-card .wpcf7-form input[type="tel"]:focus,
.popup-v2-card .wpcf7-form textarea:focus {
    border-color: var(--pv2-color-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

/* Тема задаёт глобально .form-box_input::placeholder белым — внутри белой
   карточки попапа плейсхолдеры были невидимы. Перебиваем. */
.popup-v2-card .wpcf7-form input::placeholder,
.popup-v2-card .wpcf7-form textarea::placeholder {
    color: #AAAAAA;
    opacity: 1;
}

.popup-v2-card .wpcf7-form input[type="submit"],
.popup-v2-card .wpcf7-form button[type="submit"] {
    width: 100%;
    height: 48px;
    background: var(--pv2-color-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    margin-top: 4px;
}

.popup-v2-card .wpcf7-form input[type="submit"]:hover,
.popup-v2-card .wpcf7-form button[type="submit"]:hover {
    background: #006970;
    box-shadow: 0 4px 12px rgba(0, 131, 143, 0.3);
    transform: translateY(-1px);
}

.popup-v2-card .iti {
    width: 100%;
    display: block;
}

.popup-v2-card .wpcf7-form input.uf-v2-input-error,
.popup-v2-card .wpcf7-form textarea.uf-v2-input-error {
    border-color: var(--pv2-color-error) !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

.popup-v2-trust {
    text-align: center;
    font-size: 12px;
    color: var(--pv2-color-text-light);
    margin: 12px 0 0;
    line-height: 1.45;
}

.popup-v2-trust a {
    color: var(--pv2-color-primary);
    text-decoration: underline;
}

/* Cloudflare Turnstile имеет фикс. ширину ~300px — на узких экранах выходит
   за контент-зону карточки. Разрешаем виджету сжиматься. */
.popup-v2-card .cf-turnstile,
.popup-v2-card .cf-turnstile iframe {
    max-width: 100%;
}

/* ----- Адаптив ----- */
@media (max-width: 480px) {
    .popup-v2-card {
        padding: 28px 18px 22px;
        border-radius: 14px;
    }

    .popup-v2-title {
        font-size: 20px;
    }

    /* Масштабируем Turnstile чтобы влез в карточку на узких экранах */
    .popup-v2-card .cf-turnstile {
        transform: scale(0.92);
        transform-origin: center;
    }
}
