/* Contact Form Enhancements */

/* Loader Spinner */
.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error field styling */
.error-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Success and Error Messages */
.ajax-response {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.4;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.ajax-response.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ajax-response.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button disabled state */
button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Form validation improvements */
.tp-contact-form-input {
    position: relative;
}

.tp-contact-form-input input:focus,
.tp-contact-form-input textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
}

/* Error field focus state */
.tp-contact-form-input input.error-field:focus,
.tp-contact-form-input textarea.error-field:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ajax-response {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .loader {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
}

/* Dark theme support */
.agntix-dark .ajax-response.success {
    background-color: rgba(212, 237, 218, 0.1);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.3);
}

.agntix-dark .ajax-response.error {
    background-color: rgba(248, 215, 218, 0.1);
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.3);
}

.agntix-dark .error-field {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 0.2rem rgba(244, 67, 54, 0.25) !important;
}

/* Loading state for different button styles */
.tp-btn-gradient:disabled {
    background: linear-gradient(45deg, #ccc, #999) !important;
}

.tp-btn-gradient .loader {
    border-color: #ffffff;
    border-top-color: transparent;
}

/* Smooth transitions */
.tp-contact-form-input input,
.tp-contact-form-input textarea {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

button[type="submit"] {
    transition: opacity 0.15s ease-in-out;
}

/* Success checkmark animation (optional enhancement) */
.success-checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    position: relative;
}

.success-checkmark::after {
    content: '✓';
    color: #155724;
    font-weight: bold;
    font-size: 14px;
}

/* reCAPTCHA v3 styling */
/* reCAPTCHA v3 is invisible, so no specific styling needed */
/* The reCAPTCHA badge will appear automatically in the bottom-right corner */

/* Optional: Hide reCAPTCHA badge if needed (not recommended) */
/*
.grecaptcha-badge {
    visibility: hidden;
}
*/

/* reCAPTCHA v3 loading indicator (optional) */
.recaptcha-loading {
    opacity: 0.7;
    pointer-events: none;
}

.recaptcha-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
