/* --- Global Styles --- */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow: auto;
}

.hidden {
    display: none !important;
}

/* ========================================= */
/* --- SPLIT-SCREEN LOGIN STYLES ---         */
/* ========================================= */
#login-view.split-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- Left Side (Premium Branding) --- */
#login-view .login-left {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Animated Background Glows */
#login-view .bg-glow {
    position: absolute;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* Fallback generic glows if specific ones are missing */
#login-view .glow-1,
#login-view .student-glow-1 {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    left: -100px;
    animation: drift 15s infinite alternate ease-in-out;
}

#login-view .glow-2,
#login-view .student-glow-2 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -100px;
    right: -100px;
    animation: drift 20s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 40px);
    }
}

#login-view .branding-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 600px;
}

#login-view .huge-logo {
    width: 130px;
    height: 130px;
    margin-bottom: 25px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

#login-view .huge-logo:hover {
    transform: scale(1.05);
}

#login-view .branding-content h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
}

#login-view .branding-content h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    margin: 10px 0 20px 0;
    color: #d4af37;
    letter-spacing: 2px;
}

#login-view .branding-content p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.7;
}

/* Badge for Student Portal */
#login-view .badge-container {
    margin: 1.5rem 0;
}

#login-view .portal-badge {
    background: rgba(56, 189, 248, 0.1);
    color: #d4af37;
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Right Side (100% Height Panel, No Border Radius) --- */
#login-view .login-right {
    width: 100%;
    max-width: 550px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.1);
    z-index: 20;
    height: 100vh;
}

/* Base form container fitting exactly to the right pane */
#login-view .form-container {
    padding: 60px 50px;
    margin: auto 0;
    width: 100%;
    box-sizing: border-box;
}

/* Override glass-panel if it exists in Student HTML, so it doesn't float */
#login-view .form-container.glass-panel {
    background: transparent !important;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

#login-view .form-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #0f172a;
    margin: 0 0 5px 0;
    font-weight: 700;
}

#login-view .form-header p {
    color: #64748b;
    margin: 0 0 30px 0;
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
}

#login-view .form-group {
    text-align: left;
    margin-bottom: 24px;
}

#login-view .form-group label {
    display: block;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
    text-transform: uppercase;
}

#login-view .input-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

#login-view .input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: #94a3b8;
    transition: color 0.3s ease;
}

/* Premium Input Styles */
#login-view .form-group input,
#login-view .form-group select {
    width: 100%;
    padding: 14px 15px 14px 48px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#login-view .input-wrapper:focus-within i {
    color: #0f172a;
}

#login-view .form-group input:focus,
#login-view .form-group select:focus {
    background: #ffffff;
    border-color: #d4af37;
    box-shadow: 0 10px 20px -10px rgba(56, 189, 248, 0.2);
}

#login-view .form-group select option {
    background: #ffffff;
    color: #0f172a;
}

/* Premium Button Lift */
#login-view .login-btn {
    width: 100%;
    padding: 16px;
    background: #0f172a;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#login-view .login-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

#login-view .login-btn:hover,
#login-view .hover-lift:hover {
    background: #1e293b;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
}

#login-view .hover-lift:hover i {
    transform: translateX(4px);
}

/* Form Options (Remember Me / Forgot Pwd) */
#login-view .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

#login-view .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #64748b;
}

#login-view .forgot-password {
    color: #0f172a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

#login-view .forgot-password:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* Footer Links */
#login-view .footer-links,
#login-view .footer-text {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

#login-view .footer-links a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

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

#login-view .copyright {
    margin-top: 10px;
    font-size: 0.75rem;
}

/* Alerts */
#login-view .error-box {
    display: none;
    padding: 14px;
    margin-bottom: 25px;
    border-radius: 10px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #ef4444;
}

#login-view .error-box.alert-success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.alert-success {
    display: block !important;
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 12px;
    border-radius: 10px;
}

.alert-error {
    display: block !important;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px;
    border-radius: 10px;
}

/* --- Password Eye Icon Styles --- */
#login-view .pwd-wrapper {
    position: relative;
}

#login-view .pwd-toggle-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
}

#login-view .pwd-toggle-btn i {
    position: static !important;
    transform: none !important;
    color: #94a3b8 !important;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

#login-view .pwd-toggle-btn i:hover {
    color: #0f172a !important;
}

input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

/* ========================================= */
/* TEMPORARY PASSWORD CHANGE PANEL           */
/* ========================================= */
#temporaryPasswordPanel {
    animation: authPanelFadeIn 0.25s ease-out;
}

@keyframes authPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.password-change-header {
    margin-bottom: 24px;
}

.security-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    color: #b78c17;
    font-size: 1.45rem;
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.08);
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.5;
}

.security-note > i {
    margin-top: 2px;
    color: #b78c17;
    font-size: 1.1rem;
}

.security-note strong,
.security-note span {
    display: block;
}

.security-note strong {
    margin-bottom: 2px;
    color: #0f172a;
}

.password-requirements {
    margin: -4px 0 22px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.55;
}

.password-requirements p {
    margin: 0 0 6px;
    color: #334155;
    font-weight: 600;
}

.password-requirements ul {
    margin: 0;
    padding-left: 18px;
}

.password-action-stack {
    display: grid;
    gap: 12px;
}

.secondary-login-btn {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-login-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.secondary-login-btn:disabled,
#login-view .login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#login-view .pwd-toggle-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#login-view .pwd-wrapper input {
    padding-right: 52px;
}

/* ========================================= */
/* --- SUCCESSFUL LOGIN TRANSITION ---       */
/* ========================================= */

#login-view.authentication-success .login-left {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transition:
        flex-basis 550ms cubic-bezier(0.4, 0, 0.2, 1),
        width 550ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 250ms ease;
}

#login-view.authentication-success .login-right {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    height: 100vh;
    background: #0f172a;
    color: #ffffff;
    box-shadow: none;
    transition:
        flex-basis 550ms cubic-bezier(0.4, 0, 0.2, 1),
        width 550ms cubic-bezier(0.4, 0, 0.2, 1),
        max-width 550ms cubic-bezier(0.4, 0, 0.2, 1),
        background-color 250ms ease;
}

#login-view.authentication-success .form-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

#login-view.authentication-success .branding-content {
    opacity: 0;
    pointer-events: none;
}

#login-view.authentication-success .login-left {
    transition:
        flex-basis 550ms cubic-bezier(0.4, 0, 0.2, 1),
        width 550ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 250ms ease;
}

#login-view.authentication-success .huge-logo {
    animation: login-logo-pulse 700ms ease-out;
}

#login-view.authentication-loading .login-right {
    background: #0f172a;
}

.login-transition-loader {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
    color: #ffffff;
    animation: login-loader-appear 250ms ease-out both;
}

.login-transition-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
}

.login-transition-branding .huge-logo {
    width: 130px;
    height: 130px;
    margin-bottom: 25px;
    animation: login-logo-pulse 700ms ease-out;
}

.login-transition-branding h1 {
    color: #ffffff;
}

.login-transition-branding h2 {
    color: #d4af37;
}

.login-transition-branding p {
    display: none;
}

.login-transition-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: login-transition-spin 700ms linear infinite;
}

.login-transition-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.login-transition-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    line-height: 1.4;
}

@keyframes login-logo-pulse {
    0% {
        transform: scale(1);
    }

    55% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1.04);
    }
}

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

@keyframes login-loader-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ========================================= */
/* --- MOBILE RESPONSIVENESS ---             */
/* ========================================= */
@media (max-width: 900px) {
    #login-view.split-layout {
        flex-direction: column;
    }

    #login-view .login-left {
        flex: none;
        padding: 40px 20px;
        height: auto;
    }

    #login-view .login-right {
        max-width: 100%;
        flex: 1;
        height: auto;
    }

    #login-view .form-container {
        height: auto;
        padding: 40px 30px;
    }

    #login-view .huge-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
    }

    .security-note {
        font-size: 0.8rem;
    }

    .password-requirements {
        font-size: 0.75rem;
    }
}

/* --- Successful Login Transition: Mobile --- */
@media (max-width: 900px) {
    #login-view.authentication-success {
        display: block;
        position: relative;
    }

    #login-view.authentication-success .login-left {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 100vh;
        opacity: 0;
        z-index: 1;
    }

    #login-view.authentication-success .login-right {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        min-height: 100vh;
        height: 100vh;
        z-index: 20;
    }

    #login-view.authentication-success .branding-content {
        left: 50%;
        top: 50%;
    }
}
