/* ── Login Page ─────────────────────────────────────────── */



/* Force body theme color from variables — do NOT set solid background here
   The aurora-bg div (position:fixed, z-index:0 in base.html) provides the
   actual page background so the animated aurora effect remains visible. */

body {
    background: transparent !important;
    color: var(--text) !important;
}

.auth-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    margin-top:150px !important;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 2rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Dark-mode corrections for login page elements */
.dark-theme .auth-card,
.dark-theme .login-col,
.dark-theme .dropdown-menu-custom,
.dark-theme .info-note {
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

.dark-theme .login-page-wrapper {
    background: transparent !important;
}

.dark-theme .quick-col {
    background: var(--bg-light) !important;
    color: var(--text) !important;
}

/* Light-mode explicit corrections (in case main body has light-theme class) */
.light-theme .auth-card,
.light-theme .login-col,
.light-theme .quick-col,
.light-theme .dropdown-menu-custom,
.light-theme .info-note {
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

.light-theme .login-page-wrapper {
    background: transparent !important;
}

.light-theme .quick-col {
    background: var(--bg-light) !important;
    color: var(--text) !important;
}

.light-theme .login-col .btn-primary {
    background: var(--primary) !important;
    border: 1px solid var(--primary-dark) !important;
    color: #ffffff !important;
}

.light-theme .login-col .btn-primary:hover {
    background: var(--primary-dark) !important;
}

.light-theme .forgot-link,
.light-theme .register-link,
.light-theme .dropdown-quick-btn,
.light-theme .theme-toggle {
    color: var(--primary) !important;
}


.dark-theme .auth-card {
    background: var(--card-bg) !important;
    border-color: var(--border) !important;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-theme .brand-icon {
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 14px -6px rgba(139, 92, 246, 0.4);
}

.dark-theme .login-col .btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary-dark);
    color: #ffffff;
}

.dark-theme .login-col .btn-primary:hover {
    background: var(--primary-dark);
}

.dark-theme .forgot-link,
.dark-theme .register-link,
.dark-theme .dropdown-quick-btn,
.dark-theme .theme-toggle {
    color: var(--secondary) !important;
}

.dark-theme .quick-login-table .text-secondary {
    color: #9ca3af !important;
}

.dark-theme .dropdown-menu-custom .bg-light,
.dark-theme .dropdown-menu-custom .text-muted {
    background: var(--bg-light) !important;
    color: var(--text-light) !important;
}

.row-gap-custom {
    --bs-gutter-x: 0;
}

/* ── Left Column – Login Form ─────────────────────────── */

.login-col {
    padding: 2.5rem 2rem 2.5rem 2.5rem;
    background: var(--card-bg);
}

/* ── Right Column – Quick Login ──────────────────────── */

.quick-col {
    padding: 2.5rem 2.5rem 2.5rem 2rem;
    background: var(--bg-light);
    border-left: 1px solid var(--border);
}

/* Dark theme adjustments for right column */
.dark-theme .quick-col {
    background: var(--bg-light);
    border-left-color: var(--border);
}

/* ── Brand icon ───────────────────────────────────────── */

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #0d6efd, #0a58ca);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 14px -6px rgba(13, 110, 253, 0.25);
}

.brand-icon i {
    font-size: 26px;
    color: white;
}

/* ── Welcome text ─────────────────────────────────────── */

.welcome-text h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.welcome-text p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
}

/* ── Form labels ──────────────────────────────────────── */

.login-col .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ── Form inputs (works with Django-rendered inputs with no extra class) ── */

#loginForm input[type="text"],
#loginForm input[type="password"] {
    width: 100%;
    display: block;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
    outline: none;
}

#loginForm input[type="text"]:focus,
#loginForm input[type="password"]:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

/* ── Invalid state – fields turn red on failed login ─── */

#loginForm.has-error input[type="text"],
#loginForm.has-error input[type="password"] {
    border-color: #dc3545;
    color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

#loginForm.has-error input[type="text"]::placeholder,
#loginForm.has-error input[type="password"]::placeholder {
    color: rgba(220, 53, 69, 0.5);
}

/* ── Submit button ────────────────────────────────────── */

.login-col .btn-primary {
    background: #0d6efd;
    border: none;
    border-radius: 40px;
    padding: 0.8rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.login-col .btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.25);
}

/* Dark theme button adjustments */
.dark-theme .login-col .btn-primary {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* ── Forgot / register links ──────────────────────────── */

.forgot-link,
.register-link {
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover,
.register-link:hover {
    text-decoration: underline;
}

/* Dark theme link adjustments */
.dark-theme .forgot-link,
.dark-theme .register-link {
    color: #3b82f6 !important;
}

/* ── Quick login dropdown section ────────────────────── */

.quick-dropdown-section {
    margin-bottom: 2rem;
}

.section-badge {
    display: inline-block;
    background: rgba(13, 110, 253, 0.1);
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 1rem;
}

.dark-theme .section-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.dropdown-quick-btn {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 60px;
    padding: 0.85rem 1.2rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dropdown-quick-btn:hover,
.dropdown-quick-btn:focus,
.dropdown-quick-btn.show {
    background: var(--bg-light);
    border-color: #0d6efd;
    color: #0d6efd;
}

.dark-theme .dropdown-quick-btn {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text);
}

.dark-theme .dropdown-quick-btn:hover,
.dark-theme .dropdown-quick-btn:focus,
.dark-theme .dropdown-quick-btn.show {
    background: var(--bg-light);
    border-color: #3b82f6;
    color: #60a5fa;
}

/* ── Dropdown menu with scrollbar ─────────────────────── */

.dropdown-menu-custom {
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.18);
    margin-top: 10px;
    background: var(--card-bg);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom scrollbar styling */
.dropdown-menu-custom::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu-custom::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.dropdown-menu-custom::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.dropdown-menu-custom::-webkit-scrollbar-thumb:hover {
    background: #0d6efd;
}

/* Firefox scrollbar */
.dropdown-menu-custom {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-light);
}

.dark-theme .dropdown-menu-custom::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark-theme .dropdown-menu-custom::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark-theme .dropdown-menu-custom::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* ── Credentials table inside dropdown ───────────────── */

.quick-login-table {
    width: 100%;
    margin: 0;
    font-size: 0.85rem;
}

.quick-login-table th {
    background: var(--bg-light);
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dark-theme .quick-login-table th {
    background: #1f2937;
    color: #e5e7eb;
    border-bottom-color: #374151;
}

.quick-login-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.dark-theme .quick-login-table td {
    border-bottom-color: #374151;
    color: #e5e7eb;
}

/* Badge styling for dark theme */
.dark-theme .quick-login-table .badge.bg-light {
    background: #374151 !important;
    color: #e5e7eb !important;
}

.dark-theme .quick-login-table .badge.bg-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

.dark-theme .quick-login-table .badge.bg-success {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

.dark-theme .quick-login-table .badge.bg-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

.dark-theme .quick-login-table .badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Code styling for dark theme */
.dark-theme .quick-login-table code {
    background: #1f2937;
    color: #60a5fa;
    border: 1px solid #374151;
}

.quick-login-table code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #0d6efd;
}

.btn-sm-outline {
    border-radius: 30px;
    padding: 0.3rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid var(--border);
    color: #0d6efd;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.btn-sm-outline:hover {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.dark-theme .btn-sm-outline {
    background: rgba(59, 130, 246, 0.15);
    border-color: #374151;
    color: #60a5fa;
}

.dark-theme .btn-sm-outline:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Footer section in dropdown */
.dropdown-menu-custom .bg-light {
    background: var(--bg-light) !important;
    border-top-color: var(--border) !important;
}

.dark-theme .dropdown-menu-custom .bg-light {
    background: #1f2937 !important;
}

.dark-theme .dropdown-menu-custom .text-muted {
    color: #9ca3af !important;
}

/* ── Info note ────────────────────────────────────────── */

.info-note {
    margin-top: 2rem;
    background: var(--bg-light);
    border-radius: 20px;
    padding: 1rem 1.2rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-left: 3px solid #0d6efd;
}

.dark-theme .info-note {
    background: #1f2937;
    color: #9ca3af;
}

.info-note i {
    margin-right: 6px;
    color: #0d6efd;
}

.dark-theme .info-note i {
    color: #60a5fa;
}

/* ── Highlight effect on quick-fill ──────────────────── */

.highlight-field {
    box-shadow: 0 0 0 2px #28a745 !important;
    border-color: #28a745 !important;
}

.dark-theme .highlight-field {
    box-shadow: 0 0 0 2px #22c55e !important;
    border-color: #22c55e !important;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 992px) {
    .quick-col {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .login-page-wrapper {
        padding: 1rem;
    }

    .login-col,
    .quick-col {
        padding: 1.8rem;
    }

    .welcome-text h1 {
        font-size: 1.5rem;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
    }

    .dropdown-quick-btn {
        font-size: 0.9rem;
    }
    
    .dropdown-menu-custom {
        max-height: 350px;
    }
}

/* Ensure consistent spacing */
.auth-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--border);
}

.dark-theme .auth-card {
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.5);
}