/* =========================================================
   LOGIN.CSS
   Student Performance Analytics Portal
   Login Page
   ========================================================= */


/* ==================== LOGIN PAGE ==================== */

.auth-section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;

    background:
        radial-gradient(circle at 15% 20%,
            rgba(79, 70, 229, 0.08),
            transparent 35%),
        radial-gradient(circle at 85% 80%,
            rgba(99, 102, 241, 0.07),
            transparent 35%),
        #f8fafc;
}


/* ==================== LOGIN CARD ==================== */

.auth-card {
    width: min(100%, 460px);
    padding: 34px;

    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.10);

    position: relative;
    overflow: hidden;
}


.auth-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 4px;

    background: linear-gradient(90deg,
            #312e81,
            #4f46e5,
            #6366f1);
}


/* ==================== BRAND ==================== */

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
    padding-top: 4px;
}


.auth-logo h1 {
    margin: 0;

    color: #111827;

    font-size: 2rem;
    font-weight: 700;

    line-height: 1.2;
    letter-spacing: -0.5px;
}


.auth-logo p {
    margin: 8px 0 18px;

    color: #64748b;

    font-size: 0.84rem;
    line-height: 1.6;
}


/* ==================== THEME BUTTON ==================== */

.auth-logo .theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;

    padding: 8px 15px;

    border: 1px solid #dbe2ea;
    border-radius: 9px;

    background: #f8fafc;
    color: #334155;

    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


.auth-logo .theme-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #312e81;
}


.auth-logo .theme-btn:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.18);
    outline-offset: 2px;
}


/* ==================== FORM ==================== */

.auth-form {
    width: 100%;
}


.auth-group {
    margin-bottom: 19px;
}


.auth-group>label {
    display: block;

    margin-bottom: 7px;

    color: #1e293b;

    font-size: 0.82rem;
    font-weight: 600;
}


/* ==================== INPUTS ==================== */

.auth-group input[type="email"],
.auth-group input[type="password"] {
    width: 100%;
    min-height: 47px;

    padding: 11px 13px;

    border: 1px solid #d7dee8;
    border-radius: 10px;

    background: #ffffff;
    color: #0f172a;

    font-family: inherit;
    font-size: 0.84rem;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.auth-group input::placeholder {
    color: #94a3b8;
}


.auth-group input:hover {
    border-color: #a5b4fc;
}


.auth-group input:focus {
    border-color: #4f46e5;

    box-shadow:
        0 0 0 3px rgba(79, 70, 229, 0.09);
}


/* ==================== PASSWORD ==================== */

.password-group {
    width: 100%;
    position: relative;
}


.password-group input {
    padding-right: 50px !important;
}


.password-toggle {
    position: absolute;

    top: 50%;
    right: 6px;

    width: 38px;
    height: 38px;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: #64748b;

    font-size: 0.95rem;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.password-toggle:hover {
    background: #eef2ff;
    color: #312e81;
}


.password-toggle:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.18);
    outline-offset: 1px;
}


/* ==================== REMEMBER ME ==================== */

.remember-box {
    display: flex;
    align-items: center;

    gap: 8px;

    margin: 3px 0 15px;
}


.remember-box input {
    width: 16px;
    height: 16px;

    margin: 0;

    accent-color: #4f46e5;

    cursor: pointer;
}


.remember-box label {
    color: #475569;

    font-size: 0.77rem;
    font-weight: 500;

    cursor: pointer;
}


/* ==================== LOGIN INFORMATION ==================== */

.auth-info {
    margin-bottom: 18px;

    padding: 11px 13px;

    background: #f8faff;

    border: 1px solid #dbeafe;
    border-left: 3px solid #4f46e5;

    border-radius: 9px;
}


.auth-info p {
    margin: 0;

    color: #64748b;

    font-size: 0.69rem;
    line-height: 1.65;
}


/* ==================== LOGIN BUTTON ==================== */

.auth-btn {
    width: 100%;
    min-height: 48px;

    border: 0;
    border-radius: 10px;

    background: linear-gradient(135deg,
            #312e81,
            #4f46e5);

    color: #ffffff;

    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 7px 16px rgba(49, 46, 129, 0.18);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}


.auth-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 22px rgba(49, 46, 129, 0.23);

    filter: brightness(1.03);
}


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


.auth-btn:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.22);
    outline-offset: 3px;
}


/* ==================== AUTH LINKS ==================== */

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 10px 20px;

    margin-top: 18px;
}


.auth-links a {
    color: #4f46e5;

    font-size: 0.75rem;
    font-weight: 600;

    text-decoration: none;

    transition: color 0.2s ease;
}


.auth-links a:hover {
    color: #312e81;
    text-decoration: underline;
}


.auth-links a:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}


/* ==================== LOGIN FOOTER ==================== */

.auth-card .site-footer {
    margin-top: 30px;
    padding-top: 22px;

    background: transparent;
    border-top: 1px solid #e5e7eb;
}


.auth-card .footer-container {
    display: grid;

    grid-template-columns: 1fr;

    gap: 18px;

    padding: 0;
}


.auth-card .footer-brand {
    text-align: center;
}


.auth-card .footer-logo {
    display: inline-block;

    margin-bottom: 6px;

    color: #312e81;

    font-size: 0.92rem;
    font-weight: 700;

    text-decoration: none;
}


.auth-card .footer-description {
    max-width: 330px;

    margin: 0 auto;

    color: #64748b;

    font-size: 0.65rem;
    line-height: 1.6;
}


.auth-card .footer-navigation {
    text-align: center;
}


.auth-card .footer-navigation h3 {
    margin: 0 0 8px;

    color: #334155;

    font-size: 0.72rem;
    font-weight: 650;
}


.auth-card .footer-links {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 8px 15px;
}


.auth-card .footer-links a {
    color: #64748b;

    font-size: 0.65rem;

    text-decoration: none;
}


.auth-card .footer-links a:hover {
    color: #4f46e5;
}


.auth-card .footer-bottom {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 5px;

    margin-top: 18px;
    padding-top: 13px;

    border-top: 1px solid #eef2f7;

    text-align: center;
}


.auth-card .footer-status,
.auth-card .footer-copyright,
.auth-card .footer-developer {
    margin: 0;

    color: #64748b;

    font-size: 0.61rem;
}


/* ==================== LOADING OVERLAY ==================== */

.loading-overlay {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 12px;

    background: rgba(15, 23, 42, 0.60);

    backdrop-filter: blur(5px);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


.loading-overlay.active,
.loading-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


.loading-overlay p {
    margin: 0;

    color: #ffffff;

    font-size: 0.82rem;
    font-weight: 600;
}


.loader-circle {
    width: 40px;
    height: 40px;

    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;

    border-radius: 50%;

    animation: loginLoaderSpin 0.8s linear infinite;
}


@keyframes loginLoaderSpin {

    to {
        transform: rotate(360deg);
    }

}


/* ==================== TOAST ==================== */

.toast {
    position: fixed;

    left: 50%;
    bottom: 22px;

    z-index: 10000;

    max-width: min(90%, 420px);

    padding: 11px 17px;

    transform: translate(-50%, 20px);

    background: #1e293b;

    color: #ffffff;

    border-radius: 9px;

    font-size: 0.73rem;

    text-align: center;

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.20);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}


.toast.show,
.toast.active {
    opacity: 1;
    visibility: visible;

    transform: translate(-50%, 0);
}


/* ==================== DARK THEME ==================== */

.dark-theme .auth-section {
    background:
        radial-gradient(circle at 15% 20%,
            rgba(79, 70, 229, 0.15),
            transparent 35%),
        radial-gradient(circle at 85% 80%,
            rgba(99, 102, 241, 0.10),
            transparent 35%),
        #0f172a;
}


.dark-theme .auth-card {
    background: #111827;

    border-color: #334155;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.30);
}


.dark-theme .auth-logo h1 {
    color: #f8fafc;
}


.dark-theme .auth-logo p {
    color: #94a3b8;
}


.dark-theme .auth-logo .theme-btn {
    background: #1e293b;

    border-color: #334155;

    color: #cbd5e1;
}


.dark-theme .auth-logo .theme-btn:hover {
    background: #312e81;

    border-color: #4338ca;

    color: #ffffff;
}


.dark-theme .auth-group>label {
    color: #e2e8f0;
}


.dark-theme .auth-group input[type="email"],
.dark-theme .auth-group input[type="password"] {
    background: #1e293b;

    border-color: #334155;

    color: #f8fafc;
}


.dark-theme .auth-group input::placeholder {
    color: #64748b;
}


.dark-theme .password-toggle {
    color: #94a3b8;
}


.dark-theme .password-toggle:hover {
    background: #312e81;

    color: #ffffff;
}


.dark-theme .remember-box label {
    color: #cbd5e1;
}


.dark-theme .auth-info {
    background: #172033;

    border-color: #334155;

    border-left-color: #6366f1;
}


.dark-theme .auth-info p {
    color: #94a3b8;
}


.dark-theme .auth-card .site-footer {
    border-top-color: #334155;
}


.dark-theme .auth-card .footer-logo {
    color: #818cf8;
}


.dark-theme .auth-card .footer-description,
.dark-theme .auth-card .footer-status,
.dark-theme .auth-card .footer-copyright,
.dark-theme .auth-card .footer-developer {
    color: #94a3b8;
}


.dark-theme .auth-card .footer-navigation h3 {
    color: #e2e8f0;
}


.dark-theme .auth-card .footer-links a {
    color: #94a3b8;
}


.dark-theme .auth-card .footer-links a:hover {
    color: #a5b4fc;
}


.dark-theme .auth-card .footer-bottom {
    border-top-color: #334155;
}


/* ==================== RESPONSIVE ==================== */

@media (max-width: 600px) {

    .auth-section {
        padding: 24px 14px;
    }


    .auth-card {
        padding: 28px 20px;

        border-radius: 18px;
    }


    .auth-logo h1 {
        font-size: 1.75rem;
    }


    .auth-logo p {
        font-size: 0.78rem;
    }


    .auth-links {
        gap: 9px 16px;
    }

}


@media (max-width: 380px) {

    .auth-section {
        padding: 18px 10px;
    }


    .auth-card {
        padding: 24px 16px;
    }


    .auth-logo h1 {
        font-size: 1.6rem;
    }


    .auth-group input[type="email"],
    .auth-group input[type="password"] {
        min-height: 45px;
    }


    .auth-btn {
        min-height: 47px;
    }

}


/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {

    .auth-btn,
    .password-toggle,
    .auth-logo .theme-btn,
    .loading-overlay,
    .toast {
        transition: none;
    }


    .loader-circle {
        animation: none;
    }

}


/* =========================================================
   END OF LOGIN.CSS
   ========================================================= */