/**
 * Ultimate Member AJAX Login - Styles
 * Styling for AJAX login error messages and states
 */

/* CRITICAL: Force all form fields to stay visible in popups */
.elementor-location-popup .um-form .um-field,
.elementor-location-popup .um-form .um-field-group,
.elementor-location-popup .um-form .um-field-area,
[data-elementor-type="popup"] .um-form .um-field,
[data-elementor-type="popup"] .um-form .um-field-group,
[data-elementor-type="popup"] .um-form .um-field-area,
.elementor-location-popup .um-form .um-field-password,
[data-elementor-type="popup"] .um-form .um-field-password,
.elementor-location-popup .um-form .um-field-username,
[data-elementor-type="popup"] .um-form .um-field-username {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Prevent UM from hiding fields - even more aggressive */
.elementor-location-popup .um-form .um-field-hide,
[data-elementor-type="popup"] .um-form .um-field-hide,
.elementor-location-popup .um-form [style*="display: none"],
[data-elementor-type="popup"] .um-form [style*="display: none"],
.elementor-location-popup .um-form [style*="visibility: hidden"],
[data-elementor-type="popup"] .um-form [style*="visibility: hidden"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Field-specific error messages */
.um-field .um-field-error {
    display: block;
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #ffebee;
    border-left: 3px solid #f44336;
    color: #c62828;
    font-size: 14px;
    line-height: 1.4;
}

/* Error state for input fields */
.um-field input.um-error,
.um-field select.um-error,
.um-field textarea.um-error {
    border-color: #f44336 !important;
    background-color: #fff5f5;
}

/* General form error message */
.um-form-error-general {
    margin-bottom: 15px;
    padding: 12px 15px;
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 2px;
}

/* Loading state for form */
.um.um-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.um.um-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: um-ajax-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes um-ajax-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message (optional) */
.um-form-success-general {
    margin-bottom: 15px;
    padding: 12px 15px;
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .um-field-error,
    .um-form-error-general,
    .um-form-success-general {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Ensure errors are visible in popups/modals */
.popup .um-field-error,
.modal .um-field-error,
.um-modal .um-field-error,
[role="dialog"] .um-field-error {
    z-index: 10001;
    position: relative;
}

/* Submit button disabled state */
.um-form input[type="submit"]:disabled,
.um-form input[type="submit"].um-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Prevent double-click while processing */
.um-loading .um-form input[type="submit"] {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

