:root {
    color-scheme: dark;
    --login-bg: #07111f;
    --login-bg-soft: #0f1b2d;
    --login-card: rgba(12, 24, 42, .86);
    --login-border: rgba(255, 255, 255, .09);
    --login-text: #f8fafc;
    --login-muted: #94a3b8;
    --login-soft: #64748b;
    --login-primary: #38bdf8;
    --login-primary-strong: #0ea5e9;
    --login-danger: #fca5a5;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 280px;
    min-height: 100%;
    margin: 0;
}

html {
    background: var(--login-bg);
}

body.student-login-page {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding:
        calc(18px + env(safe-area-inset-top))
        16px
        calc(18px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 12% 8%, rgba(56, 189, 248, .16), transparent 34%),
        radial-gradient(circle at 92% 90%, rgba(14, 165, 233, .12), transparent 36%),
        linear-gradient(150deg, #050c17 0%, var(--login-bg) 45%, #0d1a2c 100%);
    color: var(--login-text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.student-login-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(26px);
    pointer-events: none;
    opacity: .55;
}

.student-login-glow-one {
    width: 190px;
    height: 190px;
    top: -75px;
    right: -65px;
    background: rgba(56, 189, 248, .22);
}

.student-login-glow-two {
    width: 170px;
    height: 170px;
    left: -80px;
    bottom: -60px;
    background: rgba(14, 165, 233, .16);
}

.student-login-shell {
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 2;
}

.student-login-card {
    width: 100%;
    padding: clamp(22px, 6vw, 32px);
    border: 1px solid var(--login-border);
    border-radius: 26px;
    background: var(--login-card);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .38),
        inset 0 1px 0 rgba(255, 255, 255, .025);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.student-login-brand {
    min-height: 64px;
    margin: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-login-logo {
    display: block;
    width: min(220px, 72%);
    max-height: 86px;
    object-fit: contain;
}

.student-login-heading {
    margin-bottom: 22px;
    text-align: center;
}

.student-login-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    margin-bottom: 9px;
    padding: 5px 11px;
    border: 1px solid rgba(56, 189, 248, .2);
    border-radius: 999px;
    background: rgba(56, 189, 248, .08);
    color: var(--login-primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.student-login-heading h1 {
    margin: 0;
    color: var(--login-text);
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.025em;
}

.student-login-heading p {
    max-width: 320px;
    margin: 9px auto 0;
    color: var(--login-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.student-login-alert {
    margin-bottom: 17px;
    padding: 12px 13px;
    border: 1px solid rgba(239, 68, 68, .34);
    border-radius: 14px;
    background: rgba(239, 68, 68, .1);
    color: var(--login-danger);
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: .84rem;
    line-height: 1.4;
}

.student-login-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.student-login-field {
    margin-bottom: 15px;
}

.student-login-field label {
    display: block;
    margin: 0 0 7px 2px;
    color: #cbd5e1;
    font-size: .79rem;
    font-weight: 700;
}

.student-login-control {
    position: relative;
}

.student-login-control input {
    width: 100%;
    min-height: 54px;
    padding: 13px 48px;
    border: 1px solid #334155;
    border-radius: 15px;
    outline: none;
    background: rgba(7, 17, 31, .82);
    color: var(--login-text);
    font-size: 16px;
    line-height: 1.25;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.student-login-control input::placeholder {
    color: #526078;
    opacity: 1;
}

.student-login-control input:focus {
    border-color: var(--login-primary);
    background: rgba(7, 17, 31, .98);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .1);
}

.student-login-leading {
    position: absolute;
    left: 16px;
    top: 50%;
    z-index: 2;
    color: var(--login-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.student-login-password {
    position: absolute;
    top: 50%;
    right: 6px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--login-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    touch-action: manipulation;
}

.student-login-password:active {
    background: rgba(56, 189, 248, .09);
    color: var(--login-primary);
}

.student-login-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 5px;
    padding: 12px 18px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--login-primary), var(--login-primary-strong));
    color: #062033;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: .94rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(14, 165, 233, .18);
    transition:
        transform .15s ease,
        filter .15s ease,
        opacity .15s ease;
    touch-action: manipulation;
}

.student-login-submit:active {
    transform: scale(.985);
}

.student-login-submit:disabled {
    cursor: wait;
    opacity: .82;
}

.student-login-spinner {
    display: none;
}

.student-login-submit.is-loading .student-login-submit-label,
.student-login-submit.is-loading .student-login-submit-icon {
    display: none;
}

.student-login-submit.is-loading .student-login-spinner {
    display: inline-block;
}

.student-login-security {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: var(--login-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: .73rem;
}

.student-login-security i {
    color: var(--login-primary);
}

.student-login-version {
    margin: 14px 0 0;
    color: #526078;
    text-align: center;
    font-size: .7rem;
}

@media (max-height: 620px) {
    body.student-login-page {
        align-items: flex-start;
    }

    .student-login-card {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .student-login-brand {
        min-height: 48px;
        margin-bottom: 14px;
    }

    .student-login-logo {
        max-height: 64px;
    }

    .student-login-heading {
        margin-bottom: 15px;
    }

    .student-login-heading p,
    .student-login-security,
    .student-login-version {
        display: none;
    }
}

@media (min-width: 700px) {
    .student-login-card {
        border-radius: 30px;
    }
}


/* =========================================================
   TELA DE CARREGAMENTO APÓS LOGIN
========================================================= */
body.student-loading-page {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
    padding:
        calc(20px + env(safe-area-inset-top))
        20px
        calc(20px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at center, #1e293b 0%, #0b0f19 70%, #050a12 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.student-loading-shell {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.student-logo-loader {
    position: relative;
    width: min(190px, 58vw);
    margin-bottom: 34px;
}

.student-logo-loader-base,
.student-logo-loader-fill {
    display: block;
    width: 100%;
    height: auto;
}

.student-logo-loader-base {
    opacity: .14;
}

.student-logo-loader-fill {
    position: absolute;
    inset: 0;
    object-fit: contain;
    object-position: bottom;
    clip-path: inset(100% 0 0 0);
    animation: studentFillLogo 2.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.student-loading-copy {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.student-loading-copy strong {
    font-size: clamp(1rem, 4.5vw, 1.2rem);
    letter-spacing: .035em;
    animation: studentPulseText 1.5s ease-in-out infinite;
}

.student-loading-copy span {
    color: #94a3b8;
    font-size: .82rem;
}

.student-loading-progress {
    width: min(280px, 82vw);
    height: 6px;
    margin-top: 23px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.student-loading-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    animation: studentFillBar 2.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes studentFillLogo {
    from { clip-path: inset(100% 0 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes studentFillBar {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes studentPulseText {
    0%, 100% { opacity: .58; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .student-logo-loader-fill,
    .student-loading-progress span,
    .student-loading-copy strong {
        animation-duration: .25s;
        animation-iteration-count: 1;
    }
}
