/* --- СТИЛИ ДЛЯ ПОПАПА И ФОРМЫ (ФИНАЛЬНАЯ ВЕРСИЯ) --- */

/* 1. Блокируем скролл основной страницы, когда попап открыт */
body.scf-popup-open {
    overflow: hidden !important;
}

/* 2. Оверлей (фон) попапа */
.scf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 18, 29, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center; /* <-- ИСПРАВЛЕНО: 'center' вместо 'space-between' */
    padding: 20px; /* Добавим отступы для безопасности на мобильных */
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.scf-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

/* 3. Контентная часть попапа */
.scf-popup-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%; /* <-- ИСПРАВЛЕНО: '100%' вместо '80%' для лучшей адаптивности */
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.scf-popup-overlay.active .scf-popup-content {
    transform: scale(1);
}

/* Стили для мобильных устройств, где попап может быть шире */
#scf-popup-calculator .scf-popup-content {
    max-width: 800px;
}

/* Крестик для закрытия */
.scf-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.scf-popup-close:hover {
    color: #333;
}

/* Заголовки попапа */
.scf-popup-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    text-align: center;
    color: #0d121d;
}

.scf-popup-description {
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    font-size: 15px;
}

/* --- СТИЛИ ДЛЯ ФОРМЫ ВНУТРИ ПОПАПА --- */
.scf-popup-content .scf-form {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin: 0;
    max-width: 100%;
}

.scf-field {
    margin-bottom: 15px;
}

.scf-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.scf-form input[type="text"],
.scf-form input[type="email"],
.scf-form input[type="tel"],
.scf-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s;
}

.scf-form input:focus {
    border-color: #ffd450;
    outline: none;
}

/* --- КНОПКА, СОГЛАСИЕ И ДРУГОЕ --- */
.scf-consent-field { display: flex; align-items: center; font-size: 13px; color: #777; }
.scf-consent-field input[type="checkbox"] { margin-right: 10px; flex-shrink: 0; }
.scf-consent-field a { color: #0d121d; text-decoration: underline; }

.scf-submit-btn { width: 100%; background-color: #FFD450; color: #0d121d; padding: 15px; border: 1px solid #FFD450; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: 600; transition: all 0.3s; }
.scf-submit-btn:hover { background-color: #fff; color: #FFD450; }
.scf-submit-btn:disabled { background-color: #ccc; border-color: #ccc; color: #666; cursor: not-allowed; }

.scf-messages { padding: 15px; margin-bottom: 15px; border-radius: 5px; display: none; }
.scf-messages.scf-success { display: block; background-color: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }
.scf-messages.scf-error { display: block; background-color: #f2dede; color: #a94442; border: 1px solid #ebccd1; }

.scf-honeypot-field { position: absolute; left: -5000px; visibility: hidden; }
.grecaptcha-badge { visibility: hidden !important; }
.scf-recaptcha-notice { font-size: 12px; color: #888; line-height: 1.4; text-align: center; margin: -5px 0 15px; }
.scf-recaptcha-notice a { color: #777; text-decoration: underline; }
.scf-recaptcha-notice a:hover { color: #333; }