/* ═══════════════════════════════════════════
   Design Tokens
   ═══════════════════════════════════════════ */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --bg-gradient: linear-gradient(135deg, #162c4e 0%, #272566 30%, #1a3570 70%, #162c4e 100%);

    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(255, 255, 255, 0.45);
    --card-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-gold: #fbbf24;

    --input-border: #e2e8f0;
    --input-focus: #4f46e5;
    --input-focus-shadow: rgba(79, 70, 229, 0.12);
    --input-bg: rgba(248, 250, 252, 0.65);

    /* Mobile dark overrides (used as reference) */
    --mobile-card-bg: rgba(15, 23, 42, 0.65);
    --mobile-text: #e2e8f0;
    --mobile-text-muted: #94a3b8;
    --mobile-accent: #818cf8;
    --mobile-input-bg: rgba(15, 23, 42, 0.4);
    --mobile-input-border: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(15, 23, 42, 0.75);
        --card-border: rgba(255, 255, 255, 0.08);
        --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);

        --text-main: #f8fafc;
        --text-muted: #94a3b8;

        --input-border: rgba(255, 255, 255, 0.1);
        --input-focus: #6366f1;
        --input-focus-shadow: rgba(99, 102, 241, 0.2);
        --input-bg: rgba(15, 23, 42, 0.4);
    }
}

/* ═══════════════════════════════════════════
   Base Reset & Body Override
   ═══════════════════════════════════════════ */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #f8fafc !important;
}

#nprogress,
#nprogress .bar,
#nprogress .spinner {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* ═══════════════════════════════════════════
   Left Branding Panel
   ═══════════════════════════════════════════ */
.login-left {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animated blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: blobFloat 12s ease-in-out infinite;
    mix-blend-mode: plus-lighter;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #fbbf24;
    top: -80px;
    left: -80px;
    animation-delay: 0s;
}

.blob-2 {
    width: 320px;
    height: 320px;
    background: #60a5fa;
    bottom: -60px;
    right: -60px;
    animation-name: blobFloatAlternate;
    animation-delay: 3s;
}

.blob-3 {
    width: 240px;
    height: 240px;
    background: #c084fc;
    bottom: 100px;
    left: 60px;
    animation-delay: 6s;
}

.blob-4 {
    width: 180px;
    height: 180px;
    background: #38bdf8;
    top: 40%;
    right: 20%;
    animation-name: blobFloatAlternate;
    animation-delay: 9s;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(40px, -45px) scale(1.08) rotate(90deg);
    }
}

@keyframes blobFloatAlternate {

    0%,
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(-30px, 35px) scale(1.06) rotate(-90deg);
    }
}

.login-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 2rem;
    max-width: 850px;
}

.login-left-content img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.4));
    }
}

.login-left-content h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.login-left-content .tagline {
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 8px rgba(251, 191, 36, 0.35);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.login-left-content .session-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3px 12px;
    margin-top: 0.4rem;
}

/* ─── Feature Grid (3-column) ─── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 1.5rem;
    text-align: left;
}

.feature-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    transition: all 0.3s ease;
}

.feature-tile:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-tile .tile-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.feature-tile .tile-icon.icon-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.feature-tile .tile-icon.icon-green {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.feature-tile .tile-icon.icon-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.feature-tile .tile-icon.icon-gold {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.feature-tile .tile-icon.icon-rose {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

.feature-tile .tile-icon.icon-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.feature-tile .tile-icon.icon-amber {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.feature-tile .tile-icon.icon-emerald {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.feature-tile .tile-icon.icon-indigo {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.feature-tile .tile-icon.icon-teal {
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
}

.feature-tile span {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════
   Right Login Panel
   ═══════════════════════════════════════════ */
.login-right {
    flex: 1;
    max-width: 680px;
    min-width: 480px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 1.5rem;
    position: relative;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.03);
    z-index: 2;
    transition: background 0.3s ease;
    overflow-y: auto;
    max-height: 100vh;
}

@media (prefers-color-scheme: dark) {
    .login-right {
        background: #090d16;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    }
}

/* ─── Login Card ─── */
.login-card-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 460px;
    margin: auto;
    min-height: 560px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s, border-color 0.3s;
    animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.1);
}

/* ─── Portal Badge ─── */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(79, 70, 229, 0.07);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(79, 70, 229, 0.12);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .portal-badge {
        background: rgba(99, 102, 241, 0.15);
        color: #a5b4fc;
        border-color: rgba(99, 102, 241, 0.25);
    }
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* ─── Card Header Icon ─── */
.card-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.login-card-container h3 {
    font-size: 1.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.2rem;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .login-card-container h3 {
        background: linear-gradient(135deg, #ffffff 0%, #818cf8 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

.login-card-container .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    text-align: center;
}

/* ═══════════════════════════════════════════
   Floating Label Inputs
   ═══════════════════════════════════════════ */
.form-floating-group {
    position: relative;
    margin-bottom: 1.15rem;
    width: 100%;
}

.form-floating-group .input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-floating-group input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 2.75rem;
    border: 2px solid var(--input-border);
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-main);
}

@media (prefers-color-scheme: dark) {
    .form-floating-group input {
        background: rgba(15, 23, 42, 0.4);
    }
}

.form-floating-group input:focus {
    border-color: var(--input-focus);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

.form-floating-group label {
    position: absolute;
    top: 50%;
    left: 2.75rem;
    transform: translateY(-50%) scale(1);
    transform-origin: left top;
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.22s ease;
    z-index: 2;
}

.form-floating-group input:focus+label,
.form-floating-group input:not(:placeholder-shown)+label {
    transform: translate3d(-1.6rem, -1.95rem, 0) scale(0.8);
    color: var(--input-focus);
    background: var(--card-bg);
    padding: 0 6px;
    font-weight: 500;
}

.form-floating-group input:focus~.input-icon {
    color: var(--input-focus);
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
    z-index: 3;
}

.password-toggle:hover {
    color: var(--input-focus);
    transform: translateY(-50%) scale(1.1);
}

/* ═══════════════════════════════════════════
   Custom Toggle Switch (Remember Me)
   ═══════════════════════════════════════════ */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: var(--input-border);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-input:checked+.toggle-track {
    background: var(--primary-gradient);
    border-color: transparent;
}

.toggle-input:checked+.toggle-track::after {
    transform: translateX(20px);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.toggle-input:focus-visible+.toggle-track {
    outline: 2px solid var(--input-focus);
    outline-offset: 2px;
}

.toggle-label-text {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Login Button
   ═══════════════════════════════════════════ */
.btn-login {
    width: 100%;
    padding: 0.95rem;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
}

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

.btn-login::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-25deg);
    transition: none;
}

.btn-login:hover::after {
    left: 150%;
    transition: left 0.8s ease-in-out;
}

/* ─── Trust Badge ─── */
.trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.trust-badge i {
    font-size: 0.7rem;
    color: #22c55e;
}

/* ═══════════════════════════════════════════
   Error Message
   ═══════════════════════════════════════════ */
.error-msg {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.16);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .error-msg {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.25);
    }
}

/* ─── Caps Lock Warning ─── */
.caps-warning {
    font-size: 0.8rem;
    margin-top: -5px;
    margin-bottom: 0.75rem;
    color: #f59e0b;
    text-align: left;
    width: 100%;
}

.caps-warning i {
    margin-right: 4px;
}

/* ═══════════════════════════════════════════
   Forgot Password Modal
   ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

@media (prefers-color-scheme: dark) {
    .modal-card {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
    }
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.modal-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.modal-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.modal-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.modal-close-btn {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.modal-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */
.login-footer {
    position: absolute;
    bottom: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    z-index: 2;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Demo Credentials Widget
   ═══════════════════════════════════════════ */
.d-none {
    display: none !important;
}

.demo-widget-container {
    width: 100%;
    border-top: 1px dashed var(--input-border);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

#demoToggleBtn {
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid var(--input-border);
    color: var(--text-muted);
    background: rgba(248, 250, 252, 0.5);
    transition: all 0.2s;
}

@media (prefers-color-scheme: dark) {
    #demoToggleBtn {
        background: rgba(15, 23, 42, 0.3);
    }
}

#demoToggleBtn:hover {
    background: rgba(241, 245, 249, 0.8);
    color: var(--text-main);
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    #demoToggleBtn:hover {
        background: rgba(30, 41, 59, 0.6);
    }
}

.btn-demo-fill {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px;
}

.btn-demo-fill:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.25);
    color: var(--primary-color);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.08);
}

.btn-demo-fill:active {
    transform: translateY(0);
}

.demo-panel-card {
    background: rgba(248, 250, 252, 0.4);
    border-radius: 12px;
    border: 1px solid var(--input-border);
    text-align: center;
    padding: 1rem;
}

@media (prefers-color-scheme: dark) {
    .demo-panel-card {
        background: rgba(15, 23, 42, 0.2);
    }
}

/* ═══════════════════════════════════════════
   Floating Background Icons
   ═══════════════════════════════════════════ */
.floating-bg-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    z-index: 1;
    animation: floatUp 15s linear infinite;
    bottom: -100px;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-120vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════
   Mobile Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    body {
        background: var(--bg-gradient);
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .login-left {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        flex: none;
    }

    .login-left-content {
        display: none;
    }

    .login-right {
        width: 100%;
        min-width: unset;
        padding: 1.5rem 1.5rem 3rem 1.5rem;
        box-shadow: none;
        background: transparent;
        position: relative;
        z-index: 2;
        justify-content: center;
        overflow: visible;
        max-height: none;
    }

    /* ─── Mobile Branding Header ─── */
    .mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 1.25rem;
        animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .mobile-brand img {
        width: 48px;
        height: 48px;
        object-fit: contain;
        filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
        margin-bottom: 0.5rem;
    }

    .mobile-brand h2 {
        font-size: 1.1rem;
        font-weight: 700;
        color: #fff;
        margin-bottom: 0.15rem;
        text-align: center;
    }

    .mobile-brand .mobile-tagline {
        font-size: 0.75rem;
        color: var(--accent-gold);
        font-weight: 500;
    }

    /* ─── Card Dark Glass Override ─── */
    .login-card-container {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 2.5rem 1.75rem;
        min-height: 560px;
        background: var(--mobile-card-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        margin: 1.5rem auto;
    }

    .login-card-container h3 {
        background: linear-gradient(135deg, #ffffff 0%, #818cf8 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .login-card-container .subtitle {
        color: var(--mobile-text-muted);
    }

    /* ─── Card Header Icon ─── */
    .card-header-icon {
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    }

    /* ─── Input Fields ─── */
    .form-floating-group input {
        background: var(--mobile-input-bg);
        border-color: var(--mobile-input-border);
        color: #fff;
    }

    .form-floating-group input:focus {
        background: rgba(15, 23, 42, 0.6);
        border-color: #6366f1;
    }

    .form-floating-group label {
        color: var(--mobile-text-muted);
    }

    .form-floating-group input:focus+label,
    .form-floating-group input:not(:placeholder-shown)+label {
        background: #0f172a;
        color: var(--mobile-accent);
    }

    /* ─── Remember Me + Forgot Password Contrast ─── */
    .toggle-label-text {
        color: var(--mobile-text) !important;
    }

    .toggle-track {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.25);
    }

    .toggle-input:checked+.toggle-track {
        border-color: transparent;
    }

    .forgot-link {
        color: var(--mobile-accent) !important;
    }

    .forgot-link:hover {
        color: #a5b4fc !important;
    }

    /* ─── Caps Lock Warning ─── */
    .caps-warning {
        color: #fbbf24;
    }

    /* ─── Trust Badge ─── */
    .trust-badge {
        color: rgba(255, 255, 255, 0.5);
    }

    /* ─── Portal Badge ─── */
    .portal-badge {
        background: rgba(99, 102, 241, 0.15);
        color: #a5b4fc;
        border-color: rgba(99, 102, 241, 0.25);
    }

    /* ─── Error Message ─── */
    .error-msg {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.25);
    }

    /* ─── Demo Widget ─── */
    #demoToggleBtn {
        background: rgba(15, 23, 42, 0.3);
        color: var(--mobile-text-muted);
        border-color: var(--mobile-input-border);
    }

    .demo-panel-card {
        background: rgba(15, 23, 42, 0.3);
        border-color: var(--mobile-input-border);
    }

    .btn-demo-fill {
        background: rgba(15, 23, 42, 0.4);
        border-color: var(--mobile-input-border);
        color: var(--mobile-text-muted);
    }

    /* ─── Footer ─── */
    .login-footer {
        color: rgba(255, 255, 255, 0.4);
    }

    .login-footer a {
        color: var(--mobile-accent);
    }
}

/* Hide mobile brand on desktop */
@media (min-width: 901px) {
    .mobile-brand {
        display: none;
    }
}

/* ═══════════════════════════════════════════
   Quranic Ayah of Knowledge Card
   ═══════════════════════════════════════════ */
.ayah-quote-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 20px;
    margin: 12px auto;
    max-width: 420px;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ayah-quote-box:hover {
    transform: translateY(-2px) scale(1.01);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.18);
}

.ayah-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 4px;
    direction: rtl;
    line-height: 1.35;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.ayah-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 0.95rem;
    color: #f1f5f9;
    margin-bottom: 2px;
    font-weight: 500;
    direction: rtl;
    line-height: 2.0;
}

.ayah-english {
    font-size: 0.78rem;
    color: #cbd5e1;
    font-style: italic;
    margin-bottom: 4px;
    line-height: 1.35;
}

.ayah-reference {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════
   UX Polish & Animations
   ═══════════════════════════════════════════ */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.login-card-container.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes pulseGreen {
    0% {
        border-color: var(--input-border);
        box-shadow: var(--card-shadow);
    }

    50% {
        border-color: #22c55e;
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
    }

    100% {
        border-color: var(--input-border);
        box-shadow: var(--card-shadow);
    }
}

.pulse-green {
    animation: pulseGreen 1s ease;
}

.login-card-container:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
}

@media (max-height: 720px) and (min-width: 901px) {
    .login-right {
        padding: 1.5rem 1.5rem;
    }

    .login-card-container {
        padding: 2rem 2.5rem;
        min-height: 480px;
        margin: auto;
    }
}

/* ═══════════════════════════════════════════
   Interactive Animated TaleemDesk Logo
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   Interactive Animated Nizam-e-School Logo
   ═══════════════════════════════════════════ */
.nizameschool-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    margin: 1.5rem auto;
    user-select: none;
}

.book-wrap {
    position: relative;
    width: 210px;
    height: 140px;
}

.book-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* ─── 3D Floating Book & Dynamic Shadow ─── */
@keyframes floatBook {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@keyframes scaleShadow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(0.85);
        opacity: 0.15;
    }
}

.floating-book-graphic {
    animation: floatBook 4s ease-in-out infinite;
    transform-origin: 105px 70px;
}

.book-shadow {
    animation: scaleShadow 4s ease-in-out infinite;
    transform-origin: 105px 138px;
}

.book-page-l,
.book-page-r {
    transition: transform 0.5s cubic-bezier(.4, 0, .2, 1);
    transform-origin: 105px 70px;
}

.nizameschool-logo:hover .book-page-l {
    transform: rotate(-18deg);
}

.nizameschool-logo:hover .book-page-r {
    transform: rotate(18deg);
}

.pencil {
    transition: transform 0.5s cubic-bezier(.4, 0, .2, 1);
    transform-origin: 50% 50%;
}

.nizameschool-logo:hover .pencil {
    transform: translateY(-10px) rotate(8deg);
}

/* ─── Idle Pencil Shine Glint ─── */
@keyframes shineSweep {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.95;
        filter: brightness(1.2);
    }
}

.pencil-shine {
    animation: shineSweep 2.5s ease-in-out infinite;
}

/* ─── Star Explosions on Hover ─── */
.star {
    transition: transform 0.5s cubic-bezier(.4, 0, .2, 1), opacity 0.5s;
    opacity: 0;
    transform: translate(0, 0) scale(0);
}

/* Left Star drifts outward left */
.nizameschool-logo:hover .star:nth-of-type(1) {
    opacity: 1;
    transform: translate(-12px, -12px) scale(1.15) rotate(-15deg);
}

/* Right Star drifts outward right */
.nizameschool-logo:hover .star.star2 {
    opacity: 1;
    transform: translate(14px, -10px) scale(1.15) rotate(15deg);
}

/* Center Star drifts straight up */
.nizameschool-logo:hover .star.star3 {
    opacity: 1;
    transform: translate(0, -14px) scale(1.15);
}

.star2 {
    transition-delay: 0.08s;
}

.star3 {
    transition-delay: 0.15s;
}

.word-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: -4px;
}

.nizam {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 48px;
    color: #2563eb;
    letter-spacing: -1px;
    transition: color 0.4s, letter-spacing 0.4s, transform 0.4s, text-shadow 0.4s;
    line-height: 1;
}

.bar-sep {
    width: 14px;
    height: 4px;
    background: #f59e0b;
    border-radius: 4px;
    margin: 0 4px 6px;
    transition: background 0.4s, transform 0.4s, width 0.4s;
    flex-shrink: 0;
}

.e-letter {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 42px;
    color: #f59e0b;
    margin-bottom: 6px;
    line-height: 1;
    transition: color 0.4s, transform 0.4s;
}

.school {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 48px;
    color: #059669;
    letter-spacing: -1px;
    transition: color 0.4s, letter-spacing 0.4s, transform 0.4s, text-shadow 0.4s;
    line-height: 1;
}

/* ─── Wordmark Bounce & Glow ─── */
.nizameschool-logo:hover .nizam {
    color: #1d4ed8;
    letter-spacing: 1px;
    transform: translateY(-2px);
    text-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.nizameschool-logo:hover .school {
    color: #047857;
    letter-spacing: 1px;
    transform: translateY(-2px);
    text-shadow: 0 4px 15px rgba(5, 150, 105, 0.35);
}

.nizameschool-logo:hover .e-letter {
    color: #ef4444;
    transform: translateY(-2px) scale(1.05);
}

.nizameschool-logo:hover .bar-sep {
    background: #ef4444;
    width: 20px;
}

.rule-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
}

.rule-seg {
    height: 4px;
    border-radius: 4px;
    transition: width 0.45s cubic-bezier(.4, 0, .2, 1);
}

.rs1 {
    width: 30px;
    background: #2563eb;
}

.rs2 {
    width: 16px;
    background: #f59e0b;
}

.rs3 {
    width: 30px;
    background: #059669;
}

.nizameschool-logo:hover .rs1 {
    width: 70px;
}

.nizameschool-logo:hover .rs2 {
    width: 10px;
}

.nizameschool-logo:hover .rs3 {
    width: 70px;
}

/* Mobile responsive logo scaling */
.mobile-brand .nizameschool-logo {
    transform: scale(0.75);
    margin: 0.5rem auto;
}

/* ═══════════════════════════════════════════
   Compact Developer Quick Logins Bar
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   Compact Developer Quick Logins Bar
   ═══════════════════════════════════════════ */
.quick-login-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--input-bg);
    border: 1px dashed var(--input-border);
    border-radius: 14px;
    padding: 10px 16px;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.quick-login-bar:hover {
    border-style: solid;
    border-color: var(--input-focus);
    background: var(--card-bg);
}

.quick-login-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.quick-login-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-login-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.quick-login-btn:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.quick-login-btn:active {
    transform: translateY(0) scale(0.96);
}

/* Role Specific Color Schemes */
.quick-login-btn.ql-superadmin {
    color: #d97706;
    background: #fffbe6;
    border-color: #fde68a;
}
.quick-login-btn.ql-superadmin:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 5px 14px rgba(245, 158, 11, 0.3);
}

.quick-login-btn.ql-admin {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.quick-login-btn.ql-admin:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.3);
}

.quick-login-btn.ql-teacher {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.quick-login-btn.ql-teacher:hover {
    background: #d1fae5;
    border-color: #10b981;
    box-shadow: 0 5px 14px rgba(16, 185, 129, 0.3);
}

.quick-login-btn.ql-student {
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}
.quick-login-btn.ql-student:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.3);
}

@media (max-width: 480px) {
    .quick-login-bar {
        justify-content: center;
        text-align: center;
        padding: 10px 12px;
    }
    .quick-login-actions {
        gap: 10px;
    }
}

@media (prefers-color-scheme: dark) {
    .quick-login-btn.ql-superadmin {
        background: rgba(217, 119, 6, 0.2);
        border-color: rgba(245, 158, 11, 0.4);
        color: #fbbf24;
    }
    .quick-login-btn.ql-admin {
        background: rgba(37, 99, 235, 0.2);
        border-color: rgba(59, 130, 246, 0.4);
        color: #60a5fa;
    }
    .quick-login-btn.ql-teacher {
        background: rgba(5, 150, 105, 0.2);
        border-color: rgba(16, 185, 129, 0.4);
        color: #34d399;
    }
    .quick-login-btn.ql-student {
        background: rgba(2, 132, 199, 0.2);
        border-color: rgba(56, 189, 248, 0.4);
        color: #38bdf8;
    }
    .quick-login-toast code {
        background: rgba(255, 255, 255, 0.1);
        color: #f1f5f9;
    }
}