/* ===== AUTH MODAL STYLES ===== */

/* Overlay Background */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Container */
.auth-modal {
    background: #1a1a1a;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.auth-modal-overlay.active .auth-modal {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Content */
.auth-modal-content {
    padding: 30px;
    max-height: calc(95vh - 150px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal Close Button */
.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-close:hover {
    color: #D4AF37;
}

/* Modal Header */
.auth-modal-header {
    display: flex;
    border-bottom: 1px solid #3a3a3a;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-tab:hover {
    color: #ffffff;
    background: rgba(212, 175, 55, 0.05);
}

.auth-tab.active {
    color: #D4AF37;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #D4AF37;
}

/* Modal Body */
.auth-modal-body {
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.auth-form {
    display: none !important;
    animation: fadeIn 0.3s ease;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
}

.auth-form.active {
    display: block !important;
    visibility: visible;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Elements */
.auth-form-group {
    margin-bottom: 15px;
}

.auth-form-group:last-of-type {
    margin-bottom: 15px;
}

.auth-form-input {
    width: 100%;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.auth-form-input:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.auth-form-input.error {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.05);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #b0b0b0;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #D4AF37;
}

/* Form Actions */
.auth-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    margin: 0;
}

.remember-me span {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.forgot-password {
    color: #D4AF37;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #E8C95A;
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    border: none;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #E8C95A, #D4AF37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit-btn.loading {
    position: relative;
    color: transparent;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(26, 26, 26, 0.3);
    border-radius: 50%;
    border-top-color: #1a1a1a;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #3a3a3a;
}

.auth-divider span {
    padding: 0 15px;
}

/* Social Login */
.auth-social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.social-login-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-login-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: #D4AF37;
    color: #D4AF37;
}

.social-login-btn.google i {
    color: #DB4437;
}

.social-login-btn.facebook i {
    color: #4267B2;
}

/* Form Footer */
.auth-form-footer {
    text-align: center;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-top: 20px;
}

.auth-form-footer a {
    color: #D4AF37;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-form-footer a:hover {
    color: #E8C95A;
    text-decoration: underline;
}

/* Error Messages */
.auth-error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid #ff4757;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #ff4757;
    font-size: 0.9rem;
    display: none;
    animation: slideInDown 0.3s ease;
}

.auth-error-message.active {
    display: block;
}

.auth-error-message.success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    color: #4CAF50;
}

/* Success State */
.auth-success-state {
    text-align: center;
    padding: 30px;
    display: none;
}

.auth-success-state.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon i {
    font-size: 2.5rem;
    color: #4CAF50;
}

.auth-success-state h3 {
    color: #ffffff;
    margin-bottom: 10px;
}

.auth-success-state p {
    color: #b0b0b0;
    margin-bottom: 25px;
}

/* Form Validation Messages */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.form-error {
    color: #ff4757;
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

.form-error.active {
    display: block;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #3a3a3a;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ff4757;
}

.password-strength-bar.fair {
    width: 66%;
    background: #ffa502;
}

.password-strength-bar.strong {
    width: 100%;
    background: #4CAF50;
}

/* Forgot Password Modal */
.forgot-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.forgot-password-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.forgot-password-content {
    background: #1a1a1a;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.forgot-password-header {
    margin-bottom: 20px;
    text-align: center;
}

.forgot-password-header h3 {
    color: #D4AF37;
    margin-bottom: 10px;
}

.forgot-password-header p {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Close Button */
.auth-modal-close,
.forgot-password-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    z-index: 1;
}

.auth-modal-close:hover,
.forgot-password-close:hover {
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-modal {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .auth-modal-content {
        width: 95%;
        margin: 0 auto;
        max-height: 95vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .auth-modal-body {
        padding: 20px;
        max-height: calc(95vh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .auth-social-buttons {
        flex-direction: column;
    }
    
    .auth-form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .auth-tab {
        padding: 14px;
        font-size: 1rem;
    }
    
    .auth-modal-body {
        padding: 15px;
    }
    
    .auth-form-input {
        padding: 12px 14px;
    }
    
    .auth-submit-btn {
        padding: 12px;
    }
}