/* Auth Modal Styles */

/* Reset and force visibility for auth modal elements */
#authModal * {
    box-sizing: border-box;
}

#authModal input,
#authModal label,
#authModal button,
#authModal form,
#authModal .form-group,
#authModal .input-wrapper {
    visibility: visible !important;
    opacity: 1 !important;
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    display: flex;
    opacity: 1;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 24px;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-modal-close svg {
    stroke: #333;
}

.auth-modal-inner {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 600px;
    max-height: 90vh;
    overflow: hidden;
}

/* Right Forms Side */
.auth-forms {
    background: #fff;
    padding: 30px 40px;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Left Branding Side */
.auth-branding {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 50px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: brandingPulse 8s ease-in-out infinite;
}

@keyframes brandingPulse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.auth-branding-content {
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 180px;
    height: auto;
    margin-bottom: 30px;
    filter: brightness(0) invert(1);
}

.auth-welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.auth-welcome-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.95;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
}

.auth-feature svg {
    flex-shrink: 0;
    stroke: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Custom Scrollbar */
.auth-forms::-webkit-scrollbar {
    width: 6px;
}

.auth-forms::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.auth-forms::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.auth-forms::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    background: #f5f5f5;
    padding: 6px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #666;
}

.auth-tab.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-tab:hover:not(.active) {
    color: #333;
}

/* Form Containers */
.auth-form-container {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.auth-form-container.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.auth-form-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 30px;
}

/* Auth Form */
.auth-form {
    display: block !important;
    width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    display: block !important;
    visibility: visible !important;
}

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

.input-wrapper {
    position: relative;
    display: flex !important;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
}

.input-icon {
    position: absolute;
    left: 16px;
    stroke: #999;
    pointer-events: none;
}

.form-control {
    width: 100% !important;
    padding: 14px 16px 14px 48px !important;
    border: 2px solid #e5e5e5 !important;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafafa !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

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

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover .eye-icon {
    stroke: #667eea;
}

.form-hint {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

.forgot-password {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Form Messages */
.form-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.form-message.error {
    display: block;
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.form-message.success {
    display: block;
    background: #efe;
    color: #0a0;
    border: 1px solid #cfc;
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn svg {
    transition: transform 0.3s ease;
}

.auth-btn:hover svg {
    transform: translateX(4px);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: #999;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.auth-divider span {
    padding: 0 16px;
}

/* Social Buttons */
.auth-social {
    display: flex;
    gap: 12px;
}

.auth-social-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.auth-social-btn:hover {
    border-color: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.google-btn {
    color: #4285F4;
}

.facebook-btn {
    color: #1877F2;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-modal-inner {
        grid-template-columns: 1fr;
    }
    
    .auth-branding {
        display: none;
    }
    
    .auth-forms {
        padding: 40px 30px;
    }
    
    .auth-modal-content {
        border-radius: 16px;
    }
}

@media (max-width: 600px) {
    .auth-forms {
        padding: 30px 20px;
    }
    
    .auth-form-title {
        font-size: 24px;
    }
    
    .auth-welcome-title {
        font-size: 26px;
    }
    
    .auth-social {
        flex-direction: column;
    }
    
    .auth-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Loading State */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-btn.loading span {
    opacity: 0;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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