/**
 * Divi Auth AJAX - Styles
 */

/* ========================================
   MODAL STYLES
   ======================================== */

/* Modal - Hidden by default */
.daau-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Modal - Shown when has 'daau-modal-active' class */
.daau-modal.daau-modal-active {
    display: flex;
    opacity: 1;
}

.daau-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.daau-modal-container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.daau-modal.daau-modal-active .daau-modal-container {
    transform: translateY(0);
}

.daau-modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daau-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.daau-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.daau-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.daau-modal-body {
    padding: 25px 30px 30px;
}

/* Body class when modal is open */
body.daau-modal-open {
    overflow: hidden;
}

/* ========================================
   FORM STYLES
   ======================================== */

.daau-form {
    margin: 0;
}

.daau-form-group {
    margin-bottom: 20px;
}

.daau-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.daau-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.daau-input:focus {
    border-color: #2e8bf0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 139, 240, 0.1);
}

.daau-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.daau-button-primary {
    background: #2e8bf0;
    color: #fff;
}

.daau-button-primary:hover {
    background: #1a7ad8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 139, 240, 0.3);
}

.daau-button-block {
    display: block;
    width: 100%;
}

.daau-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Checkbox */
.daau-form-remember {
    margin-bottom: 20px;
}

.daau-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}

.daau-checkbox input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

/* Form Footer */
.daau-form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.daau-form-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
}

.daau-link {
    color: #2e8bf0;
    text-decoration: none;
    font-weight: 600;
}

.daau-link:hover {
    text-decoration: underline;
}

/* Alert Messages */
.daau-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

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

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

.daau-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading State */
.daau-form-loading {
    position: relative;
    pointer-events: none;
}

.daau-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #2e8bf0;
    border-radius: 50%;
    animation: daauSpin 1s linear infinite;
}

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

.daau-button-loading {
    position: relative;
    color: transparent !important;
}

.daau-button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: daauSpin 1s linear infinite;
}

/* Form Description */
.daau-form-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Login Link */
.daau-login-link {
    display: inline-flex;
    align-items: center;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .daau-modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .daau-modal-header {
        padding: 20px 20px 15px;
    }
    
    .daau-modal-body {
        padding: 20px;
    }
}

/* ========================================
   DIVI SPECIFIC STYLES
   ======================================== */

.et_pb_menu__menu .daau-login-link,
.et_pb_fullwidth_menu .daau-login-link {
    padding: 10px 20px !important;
}

/* Hide modal when Divi builder is active */
.et-fb-root-ancestor .daau-modal {
    display: none !important;
}

/* ========================================
   SCROLL TO TOP FEATURE
   ======================================== */

.daau-login-scroll-top {
    cursor: pointer;
}

.daau-login-scroll-top.scrolling {
    opacity: 0.7;
    pointer-events: none;
}

/* ========================================
   WORDPRESS CORE MENU SPECIFIC CLASSES
   ======================================== */

.daau-core-menu-item {}
.daau-user-logged-in {}
.daau-user-logged-out {}
.daau-divi-menu-item {}
.daau-secondary-menu-item {}

.daau-menu-login-link a {
    cursor: pointer;
}

/* Secondary menu styling */
#et-secondary-nav .daau-login-link,
#et-secondary-menu .daau-login-link {
    color: inherit;
    display: inline-flex;
    align-items: center;
}

/* ========================================
   TURNSTILE INTEGRATION
   ======================================== */

.daau-turnstile-container {
    margin-bottom: 20px;
}

.daau-turnstile-container .cf-turnstile,
.daau-turnstile-container .daau-turnstile {
    display: flex;
    justify-content: center;
}

@media (max-width: 480px) {
    .daau-turnstile-container .cf-turnstile iframe,
    .daau-turnstile-container .daau-turnstile iframe {
        max-width: 100% !important;
    }
}

/* ========================================
   CUSTOM FORM COMPATIBILITY
   ======================================== */

/* Container for form content (custom or default) */
.daau-form-content {
    width: 100%;
}

/* Ultimate Member compatibility */
.daau-form-content .um,
.daau-form-content .um-form,
.daau-form-content .ultimate-member {
    max-width: 100%;
}

.daau-form-content .um input[type="text"],
.daau-form-content .um input[type="password"],
.daau-form-content .um input[type="email"] {
    width: 100%;
    box-sizing: border-box;
}

/* Profile Builder compatibility */
.daau-form-content .wppb-user-forms,
.daau-form-content .wppb-login-form {
    max-width: 100%;
}

/* WP User Manager compatibility */
.daau-form-content .wpum-form {
    max-width: 100%;
}

/* General form plugin compatibility */
.daau-form-content form {
    max-width: 100%;
}

.daau-form-content input[type="text"],
.daau-form-content input[type="password"],
.daau-form-content input[type="email"],
.daau-form-content input[type="url"],
.daau-form-content input[type="tel"],
.daau-form-content textarea,
.daau-form-content select {
    max-width: 100%;
    box-sizing: border-box;
}
