/* Полный экран блокировки (Оверлей) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

/* Контейнер модального окна */
.modal-container {
    position: relative;
    width: 100%;
    max-width: 872px;
    background-color: #00a2eb;
    color: #ffffff;
    border-radius: 64px;
    padding: 30px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* Кнопка-крестик */
.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 64px;
    height: 64px;
    transition: opacity 0.2s ease;
    z-index: 5;
}
.modal-close-btn:hover {
    opacity: 0.75;
}
.modal-close-btn svg {
    width: 100%;
    height: 100%;
}

/* Заголовки */
.modal-title {
    text-align: center;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 300;
    margin-top: 0;
    margin-bottom: 24px;
    line-height: 1.3;
}
.modal-title span {
    font-weight: 400;
}
.modal-title.uppercase {
    text-transform: uppercase;
}

/* Элементы форм */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.modal-form input[type="text"],
.modal-form textarea {
    width: 100%;
    padding: 14px 24px;
    border: none;
    background-color: #ffffff;
    color: #333333;
    font-size: 16px;
    font-family: 'Lato';
    box-sizing: border-box;
    outline: none;
    transition: box-shadow 0.2s ease;
}
.modal-form input[type="text"] {
    border-radius: 50px;
}
.modal-form textarea {
    border-radius: 25px;
    resize: none;
}
.modal-form input::placeholder,
.modal-form textarea::placeholder {
    color: #00a2eb;
    opacity: 0.8;
}
.modal-form input:focus,
.modal-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* Стилизация вывода ошибок от FormIt */
.error-message {
    color: #ffcbd2;
    font-size: 13px;
    margin-top: 4px;
    padding-left: 20px;
}

/* Чекбокс */
.captcha-group {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}
.captcha-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    line-height: 1;
}
.captcha-label input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.captcha-label span {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.captcha-label span::before {
    content: "";
    min-width: 30px;
    height: 30px;
    flex: 0 0 20px;
    border: 2px solid #fff;
    background-color: transparent;
    box-sizing: border-box;
}

.captcha-label input:checked + span::before {
    background-color: #fff;
    box-shadow: inset 0 0 0 4px #00a2eb;
}

.captcha-label input:focus-visible + span::before {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

.captcha-label:hover span::before {
    background-color: rgba(255, 255, 255, 0.15);
}

.captcha-label input:checked:hover + span::before {
    background-color: #fff;
}

.captcha-label:active span::before {
    transform: scale(0.96);
}

.captcha-label input:disabled + span {
    opacity: 0.55;
    cursor: default;
}

.captcha-label input:disabled + span::before {
    cursor: default;
}

/* Кнопка "Отправить" */
.btn-container {
    text-align: center;
}
.submit-btn {
    display: inline-block;
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 64px;
    padding: 16px 40px;
    font-size: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.submit-btn:hover {
    background-color: #ffffff;
    color: #00a2eb;
}

/* Нижний текст дисклеймера */
.privacy-text {
    text-align: center;
    font-size: 17px;
    opacity: 0.8;
    margin: 8px 0 0 0;
    line-height: 1.4;
}
.privacy-text a {
    color: #ffffff;
    text-decoration: underline;
}

/* Экран благодарности */
.modal-success {
    margin: 100px 0;
}
.text-center {
    text-align: center;
}
.success-icon {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    animation: mailFloat 3s ease-in-out infinite;
}
.success-icon img {
    max-width: 120px;
}
.success-text {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 420px;
}
.success-text strong {
    font-weight: 400;
}
.modal-text {
    max-width: 400px;
    margin: auto;
}

/* Сервисный класс скрытия */
.hidden {
    display: none !important;
}

/* Анимации появления */
.modal-step {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes mailFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-container {
        max-width: 480px;
    }
    .modal-form {
        gap: 6px;
    }
    .modal-form input[type="text"], .modal-form textarea { 
        padding: 6px 16px;
    }
    .modal-form textarea {
        border-radius: 16px;
    }
    .captcha-group {
        padding: 8px 0;
    }
    .captcha-label {
        font-size: 12px;
    }
    .captcha-label span::before { 
        min-width: 20px;
        height: 20px;
    }
    .modal-container {
        padding: 24px 20px;
        border-radius: 40px;
    }
    .modal-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    .submit-btn {
        padding: 14px 40px;
        font-size: 18px;
    }
    .modal-close-btn {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
    }
    .privacy-text {
        font-size: 12px;
        margin: 0px 0 0 0;
        text-wrap-style: balance;
    }
    .modal-success {
        margin: 80px 0;
    }
    .success-icon {
        margin: 30px 0;
    }
}
