/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Modal Container */
.modal {
    background: white;
    border-radius: 0.4vw; /* 20px at 1920px */
    width: 27.86vw; /* 535px at 1920px */
    max-width: 90vw;
    padding: 2.08vw; /* 40px at 1920px */
    position: relative;
    box-shadow: 0 0.52vw 2.08vw rgba(0, 0, 0, 0.1);
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 2vw; /* 20px at 1920px */
    right: 2vw; /* 20px at 1920px */
    background: none;
    border: none;
    cursor: pointer;
        width: 1.3vw; /* 30px at 1920px */
    height: 1.3vw; /* 30px at 1920px */
    display: flex;
    align-items: center;
    justify-content: center;
    
}
.close-btn img{
    width: 100%;
}

.close-btn:hover {
    color: #333;
}

/* Title */
.modal-title {
    text-align: center;
    font-size: 1.25vw; /* 24px at 1920px */
    font-weight: 500;
    color: rgba(82, 82, 82, 1);
    margin-bottom: 2vw; /* 30px at 1920px */
    margin-top: 2vw;
}

/* Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.83vw; /* 16px at 1920px */
}

/* Input Fields */
.input-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.63vw 1.04vw; /* 16px 20px at 1920px */
    border: 0.05vw solid #ddd; /* 1px at 1920px */
    border-radius: 1.56vw; /* 30px at 1920px */
    font-size: 0.83vw; /* 16px at 1920px */
    background-color: #f9f9f9;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: rgba(52, 186, 236, 1);
    background-color: white;
}

.form-input::placeholder {
    color: #999;
}

/* Error styling */
.form-input.error {
    border-color: #ff4444;
    background-color: #fff5f5;
}

.error-message {
    color: #ff4444;
    font-size: 0.73vw; /* 14px at 1920px */
    margin-top: 0.26vw; /* 5px at 1920px */
    margin-left: 1.04vw; /* 20px at 1920px */
}

/* Checkbox - ИСПРАВЛЕННЫЕ СТИЛИ */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.52vw; /* 10px at 1920px */
    margin-top: 0.52vw; /* 10px at 1920px */
    cursor: pointer;
}

/* Скрываем оригинальный чекбокс */
.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Кастомный чекбокс */
.custom-checkbox-popup {
    position: relative;
    width: 0.94vw; /* 18px at 1920px */
    height: 0.94vw; /* 18px at 1920px */
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 0.1vw; /* выравнивание с текстом */
}

.custom-checkbox-popup img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s ease;
}

.checkbox-popup-checked {
    opacity: 0;
}

.checkbox-popup-unchecked {
    opacity: 1;
}

/* Состояние когда чекбокс отмечен */
.checkbox-input:checked + .custom-checkbox-popup .checkbox-popup-checked {
    opacity: 1;
}

.checkbox-input:checked + .custom-checkbox-popup .checkbox-popup-unchecked {
    opacity: 0;
}

.checkbox-label {
    font-size: 0.6vw; /* 14px at 1920px */
    color: #666;
    line-height: 1.4;
    cursor: pointer;
    margin-top: 0.1vw;
    
}

.checkbox-label a {
    color: rgba(52, 186, 236, 1);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    background: rgba(52, 186, 236, 1);
    color: white;
    border: none;
    border-radius: 1.56vw; /* 30px at 1920px */
    padding: 0.83vw 1vw; /* 16px 30px at 1920px */
    font-size: 0.83vw; /* 16px at 1920px */
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.52vw; /* 10px at 1920px */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 94%;
    margin: 0 auto;
    margin-top: 1vw;
}

.submit-btn:hover {
    transform: translateY(-0.1vw);
    box-shadow: 0 0.26vw 0.83vw rgba(52, 186, 236, 0.3);
}

label.checkbox-group{
    width: 94%;
    margin: 0 auto;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.04vw; /* 20px at 1920px */
    height: 1.04vw; /* 20px at 1920px */
    border: 0.1vw solid rgba(255, 255, 255, 0.3);
    border-top: 0.1vw solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 0.83vw; /* 16px at 1920px */
    border-radius: 0.52vw; /* 10px at 1920px */
    margin-top: 0.83vw; /* 16px at 1920px */
    font-size: 0.73vw; /* 14px at 1920px */
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 0.05vw solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 0.05vw solid #f5c6cb;
}

/* Demo button to open modal */
.open-modal-btn {
    background: rgba(52, 186, 236, 1);
    color: white;
    border: none;
    border-radius: 1.56vw;
    padding: 0.83vw 1.56vw;
    font-size: 0.83vw;
    font-weight: 500;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal {
        width: 90vw;
        padding: 5vw;
    }
    
    .modal-title {
        font-size: 6vw;
        margin-bottom: 8vw;
        margin-top: 14vw;
    }
    
    .form-input {
        font-size: 4vw;
        padding: 3vw 5vw;
        border-radius: 7vw;
        border: 0.25vw solid rgba(180, 177, 177, 1);
    }
    
    .submit-btn {
        font-size: 3.5vw;
        padding: 3vw 5vw;
        border-radius: 4vw;
    }
    
    .checkbox-label {
        font-size: 3vw;
    }
    
    .custom-checkbox-popup {
        width: 4vw;
        height: 4vw;
    }
    
    .close-btn {
        font-size: 4vw;
        width: 6vw;
        height: 6vw;
        top: 7vw;
        right: 7vw;
    }
    .contact-form {
        display: flex;
        flex-direction: column;
        gap: 4vw; /* 16px at 1920px */
    }
    .checkbox-group {
        gap: 3vw; /* 10px at 1920px */
        margin-top: 3vw; /* 10px at 1920px */
        
    }

    .submit-btn{
        font-size: 4.6vw;
        border-radius: 7vw;
    }
    
    .message{
        font-size: 3.5vw;
        margin-top: 3vw;
        margin-bottom: 3vw; 
    }
    
}