/* 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;
    width: 27.86vw;
    max-width: 90vw;
    padding: 2.08vw;
    position: relative;
    box-shadow: 0 0.52vw 2.08vw rgba(0, 0, 0, 0.1);
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 2vw;
    right: 2vw;
    background: none;
    border: none;
    cursor: pointer;
    width: 1.3vw;
    height: 1.3vw;
    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;
    font-weight: 500;
    color: rgba(82, 82, 82, 1);
    margin-bottom: 2vw;
    margin-top: 2vw;
}

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

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

.form-input {
    width: 100%;
    padding: 0.63vw 1.04vw;
    border: 0.05vw solid #ddd;
    border-radius: 1.56vw;
    font-size: 0.83vw;
    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;
    margin-top: 0.26vw;
    margin-left: 1.04vw;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.52vw;
    margin-top: 0.52vw;
    cursor: pointer;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox-popup {
    position: relative;
    width: 0.94vw;
    height: 0.94vw;
    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;
    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;
    padding: 0.83vw 1vw;
    font-size: 0.83vw;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.52vw;
    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;
    height: 1.04vw;
    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;
    border-radius: 0.52vw;
    margin-top: 0.83vw;
    font-size: 0.73vw;
    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;
}

@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;
    }

    .checkbox-group {
        gap: 3vw;
        margin-top: 3vw;
    }

    .submit-btn {
        font-size: 4.6vw;
        border-radius: 7vw;
    }

    .message {
        font-size: 3.5vw;
        margin-top: 3vw;
        margin-bottom: 3vw;
    }
}
