/* Overlay (Dark Background) */
.auth-overlay {
    display: none; /* Hidden by default */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px); /* Glass effect */
    z-index: 9999;
    align-items: center; justify-content: center;
}
.auth-overlay.open { display: flex; animation: fadeIn 0.2s; }

/* The Modal Box */
.auth-box {
    background: var(--bl-surface); /* Theme support */
    width: 800px; max-width: 95%;
    border-radius: 12px; overflow: hidden;
    display: flex; position: relative;
    box-shadow: var(--bl-shadow); /* Theme support */
    border: 1px solid var(--bl-border); /* Added to prevent dark mode blending */
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Close Button */
.auth-close {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; font-size: 30px; cursor: pointer; 
    color: var(--bl-text-muted); /* Theme support */
    z-index: 10;
    transition: color 0.2s ease;
}
.auth-close:hover {
    color: var(--bl-text-main);
}

/* Left Side (Brand) */
/* Note: Kept the static dark gradient to preserve the brand hero look. */
.auth-brand {
    width: 40%; background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff; padding: 40px; display: flex; align-items: center;
}
.auth-brand h3 { font-size: 2rem; margin: 0 0 10px; }

/* Right Side (Forms) */
.auth-forms { 
    width: 60%; padding: 40px; 
    background: var(--bl-surface); /* Theme support */
    transition: background-color 0.3s ease;
}

/* Tabs */
.auth-tabs { 
    display: flex; gap: 20px; margin-bottom: 30px; 
    border-bottom: 2px solid var(--bl-border); /* Theme support */
    transition: border-color 0.3s ease;
}
.auth-tab {
    background: none; border: none; padding: 10px 0;
    font-size: 1.1rem; font-weight: 600; 
    color: var(--bl-text-muted); /* Theme support */
    cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.auth-tab.active { 
    color: var(--bl-text-main); /* Theme support */
    border-color: var(--bl-primary); 
}

/* Views */
.auth-view { display: none; }
.auth-view.active { display: block; animation: slideUp 0.3s; }

/* Social Login */
.social-login-wrap { text-align: center; margin-bottom: 20px; }

/* Divider */
.auth-divider { text-align: center; margin: 20px 0; position: relative; }
.auth-divider span { 
    background: var(--bl-surface); /* Theme support */
    padding: 0 10px; 
    color: var(--bl-text-sub); /* Theme support */
    font-size: 12px; position: relative; z-index: 1; 
    transition: background-color 0.3s ease, color 0.3s ease;
}
.auth-divider::before {
    content: ""; position: absolute; left: 0; top: 50%; width: 100%;
    height: 1px; 
    background: var(--bl-border); /* Theme support */
    z-index: 0;
    transition: background-color 0.3s ease;
}

/* Form Styles */
.form-group { margin-bottom: 15px; }
.form-group label { 
    display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; 
    color: var(--bl-text-main); /* Theme support */
    transition: color 0.3s ease;
}
.form-group input {
    width: 100%; padding: 12px; 
    border: 1px solid var(--bl-border); /* Theme support */
    border-radius: 6px;
    font-size: 0.95rem; 
    background: var(--bl-surface-alt); /* Theme support */
    color: var(--bl-text-main); /* Required for text visibility in dark mode */
    transition: border-color 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}
.form-group input:focus { 
    border-color: var(--bl-primary); 
    background: var(--bl-surface); 
    outline: none; 
}

/* Buttons */
.btn-auth-submit {
    width: 100%; padding: 12px; 
    background: var(--bl-text-main); /* Theme support */
    color: var(--bl-bg); /* Theme support - uses background color for high contrast text */
    border: none;
    border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 10px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn-auth-submit:hover { transform: translateY(-2px); }

.btn-register { background: var(--bl-primary); color: #fff; }
.btn-register:hover { background: var(--bl-primary-dark); }

.form-actions { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 20px; }
.forgot-link { 
    color: var(--bl-text-sub); /* Theme support */
    text-decoration: none; 
    transition: color 0.2s ease;
}
.forgot-link:hover { color: var(--bl-primary); }

/* Mobile */
@media(max-width: 600px) {
    .auth-brand { display: none; } /* Hide image on mobile */
    .auth-forms { width: 100%; padding: 25px; }
    .auth-box { height: 100%; border-radius: 0; border: none; } /* Drop border on full screen mobile */
}

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