/* Затемнение фона */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Само модальное окно */
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 650px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px 40px 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Кнопка закрытия - исправлено (видимая) */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    background: #f0f0f0;
    border: none;
    line-height: 1;
    transition: all 0.3s;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #000;
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Заголовок */
.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #2B587A;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-right: 40px;
}

.modal-title i {
    margin-right: 10px;
    color: #01b8b8;
}

/* Группы полей */
.modal-group {
    margin-bottom: 22px;
}

.modal-group-label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.modal-group-label .highlight {
    color: #01b8b8;
}

/* Способы связи - сетка */
.contact-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.contact-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.contact-option:hover {
    background: #eef1f5;
}

.contact-option input[type="radio"] {
    margin-right: 8px;
    accent-color: #01b8b8;
    width: 16px;
    height: 16px;
}

.contact-option label {
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.contact-option input[type="radio"]:checked + label {
    color: #01b8b8;
    font-weight: 600;
}

/* Поля ввода */
.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #01b8b8;
    box-shadow: 0 0 0 3px rgba(1, 184, 184, 0.1);
}

/* Три поля в ряд */
.contact-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Дополнительное поле (логин) */
.modal-input-group {
    margin-top: 10px;
}

.modal-input-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

/* Информация для WhatsApp */
.whatsapp-info {
    background: #e8f5e9;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
}

.whatsapp-info i {
    color: #4caf50;
    margin-right: 8px;
}

.whatsapp-info span {
    color: #2e7d32;
    font-size: 14px;
}

/* Информационный текст */
.modal-info {
    background: #f8f9fa;
    padding: 15px 18px;
    border-radius: 6px;
    border-left: 4px solid #01b8b8;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.modal-info i {
    color: #01b8b8;
    margin-right: 8px;
}

/* Кнопки */
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-primary {
    background: #01b8b8;
    color: #fff;
}

.modal-btn-primary:hover {
    background: #019a9a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(1, 184, 184, 0.3);
}

.modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-btn-secondary {
    background: #e9ecef;
    color: #555;
}

.modal-btn-secondary:hover {
    background: #dde1e6;
}

/* Сообщения */
.modal-success {
    display: none;
    padding: 12px 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

.modal-success.show {
    display: block;
}

.modal-error {
    display: none;
    padding: 12px 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.modal-error.show {
    display: block;
}

.modal-loader {
    display: none;
    text-align: center;
    padding: 10px 0;
}

.modal-loader.show {
    display: block;
}

.modal-loader i {
    font-size: 28px;
    color: #01b8b8;
}

/* ============================================ */
/* КНОПКИ В БЛОКЕ "СПАСИБО!" */
/* ============================================ */
.alert-buttons-wrapper {
    margin-top: 20px;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.alert-buttons-wrapper .alert-btn-wrap {
    flex: 1 1 calc(50% - 6px);
    min-width: 200px;
}

.alert-buttons-wrapper .alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #01b8b8;
    color: #fff !important;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.alert-buttons-wrapper .alert-btn:hover {
    background: #019a9a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(1, 184, 184, 0.3);
}

.alert-buttons-wrapper .alert-btn-secondary {
    background: #e9ecef;
    color: #333 !important;
}

.alert-buttons-wrapper .alert-btn-secondary:hover {
    background: #dde1e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-buttons-wrapper .alert-btn i {
    font-size: 16px;
}

/* ============================================ */
/* АДАПТИВ */
/* ============================================ */
@media (max-width: 600px) {
    .modal-content {
        padding: 25px 20px;
    }
    
    .contact-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-fields-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        text-align: center;
    }
    
    .alert-buttons-wrapper .alert-btn-wrap {
        flex: 1 1 100%;
        min-width: unset;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
        top: 10px;
        right: 12px;
    }
}