/* Local login identity preserves the application's saved theme preference. */
html.login-root { background: #020817; color-scheme: dark; }
html.login-root .login-page {
    --theme-text-primary: #f8fafc;
    --theme-text-secondary: #cbd5e1;
    --theme-input-bg: rgba(255, 255, 255, .025);
    --theme-input-text: #f8fafc;
    --theme-input-placeholder: #94a3b8;
    --theme-border-primary: rgba(148, 163, 184, .18);
    --theme-accent: #38bdf8;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    font-family: "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: radial-gradient(ellipse at 24% 37%, rgba(14, 165, 233, .075), transparent 46%),
                radial-gradient(ellipse at 85% 85%, rgba(14, 165, 233, .035), transparent 42%),
                linear-gradient(120deg, #020817, #061022 58%, #091426);
    position: relative;
    isolation: isolate;
}
.login-page *, .login-page *::before, .login-page *::after { box-sizing: border-box; }
.login-page [hidden] { display: none !important; }
.login-page svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(rgba(148, 163, 184, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .03) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse at 25% 40%, #000, transparent 70%);
}
.login-layout { width: min(100% - 112px, 1220px); flex: 1; margin: 0 auto; padding: 64px 0 40px; display: grid; grid-template-columns: 55fr 45fr; align-items: center; gap: 48px; }
.login-brand { min-width: 0; position: relative; }
.login-brand::before { content: ""; position: absolute; width: 120%; aspect-ratio: 1; left: -15%; top: -30%; z-index: -1; pointer-events: none; background: radial-gradient(circle, rgba(14, 165, 233, .07), transparent 65%); }
/* Frame only transparent margins of the supplied, unmodified PNG. */
.login-logo { width: min(100%, 464px); aspect-ratio: 1160 / 406; overflow: hidden; position: relative; margin-bottom: 45px; animation: login-arrive 500ms ease both; }
.login-logo img { position: absolute; width: 150.69%; max-width: none; height: auto; left: -25.09%; top: -102.71%; }
.login-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: #94a3b8; margin: 0 0 15px; }
.login-eyebrow span { width: 20px; height: 1px; background: #38bdf8; }
.login-page .login-institutional h1 { margin: 0; font-size: clamp(34px, 3.4vw, 48px); font-weight: 600; line-height: 1.17; letter-spacing: -1.6px; color: #f8fafc; }
.login-heading-dot { color: #38bdf8; }
.login-description { max-width: 390px; margin: 22px 0 29px; color: #94a3b8; font-size: 16px; line-height: 1.8; }
.login-benefits { list-style: none; margin: 0; padding: 24px 0 0; border-top: 1px solid rgba(148, 163, 184, .12); max-width: 390px; display: grid; gap: 16px; }
.login-benefits li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #b4c0d1; }
.login-benefits svg { width: 17px; height: 17px; color: #7c9fb8; }
.login-access { min-width: 0; width: 100%; max-width: 452px; justify-self: end; position: relative; }
.login-card { padding: 38px 40px 32px; border-radius: 24px; background: linear-gradient(145deg, rgba(17, 27, 48, .88), rgba(15, 23, 42, .92)); border: 1px solid rgba(255, 255, 255, .07); box-shadow: 0 28px 75px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .025); animation: login-arrive 550ms ease both; }
.login-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-access-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(148, 163, 184, .14); border-radius: 12px; color: #b4c8dc; background: rgba(148, 163, 184, .04); }
.login-card-eyebrow { color: #94a3b8; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }
.login-page #login-title { margin: 0 0 10px; font-size: 31px; line-height: 1.2; letter-spacing: -.8px; font-weight: 600; color: #f8fafc; }
.login-subtitle { margin: 0 0 24px; max-width: 310px; color: #94a3b8; font-size: 14px; line-height: 1.7; }
.login-field + .login-field { margin-top: 20px; }
#login-form label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 500; color: #d8e1ed; }
.login-input-wrap { position: relative; }
#login-form input { display: block; width: 100%; min-width: 0; height: 52px; border-radius: 11px; border: 1px solid rgba(148, 163, 184, .18); background: rgba(255, 255, 255, .025); color: #f8fafc; padding: 0 16px 0 44px; font: inherit; font-size: 16px; transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease; }
#login-form #senha { padding-right: 50px; }
#login-form input::placeholder { color: #94a3b8; font-size: 14px; opacity: 1; }
#login-form input:focus { outline: none; border-color: #38bdf8; background: rgba(14, 165, 233, .025); box-shadow: 0 0 0 3px rgba(14, 165, 233, .12); }
#login-form input:autofill { box-shadow: 0 0 0 1000px #152136 inset; -webkit-text-fill-color: #f8fafc; }
.login-input-icon { position: absolute; top: 17px; left: 15px; width: 18px !important; height: 18px !important; color: #8193ab; pointer-events: none; }
.login-password-toggle { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: none; border-radius: 8px; background: transparent; color: #94a3b8; cursor: pointer; transition: background 180ms ease, color 180ms ease; }
.login-password-toggle:hover { color: #f8fafc; background: rgba(148, 163, 184, .08); }
.login-eye-slash { display: none; }
.login-password-toggle[aria-pressed="true"] .login-eye-slash { display: block; }
.login-recovery { display: flex; justify-content: flex-end; margin: 9px 0 20px; }
html.login-root .login-page a { color: #7dd3fc; text-decoration: none; font-size: 13px; border-radius: 4px; transition: color 180ms ease; }
.login-recovery a { padding: 7px 0; }
html.login-root .login-page a:hover { color: #bae6fd; text-decoration: underline; text-underline-offset: 4px; }
.login-page :is(a, button):focus-visible, .login-error:focus-visible { outline: 2px solid #38bdf8; outline-offset: 4px; }
/* Slightly deeper blue keeps white button text above 4.5:1 contrast. */
.login-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 11px; background: linear-gradient(110deg, #0878ad, #0271a9); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(2, 132, 199, .12); transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease; }
.login-submit:hover { filter: brightness(1.03); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14, 165, 233, .2); }
.login-submit:active { transform: translateY(0); }
.login-submit-arrow { width: 18px !important; height: 18px !important; }
[aria-busy="true"] .login-submit-arrow { display: none; }
.login-submit-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: login-spin 750ms linear infinite; }
.login-register { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid rgba(148, 163, 184, .12); text-align: center; font-size: 13px; color: #94a3b8; line-height: 1.8; }
.login-register a { display: inline-block; margin-left: 4px; font-weight: 600; }
.login-error { display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin-bottom: 22px; border: 1px solid rgba(239, 68, 68, .25); border-radius: 10px; background: rgba(239, 68, 68, .08); color: #fca5a5; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.login-error svg { width: 18px; height: 18px; margin-top: 1px; }
.login-access-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; font-size: 11px; color: #94a3b8; letter-spacing: .25px; }
.login-access-note svg { width: 14px; height: 14px; }
.login-footer { text-align: center; padding: 18px 16px 25px; color: #94a3b8; font-size: 11px; letter-spacing: .3px; }
.login-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes login-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) {
    .login-layout { width: calc(100% - 64px); gap: 32px; grid-template-columns: 1fr 1fr; }
    .login-card { padding: 32px 28px 28px; }
    .login-logo { margin-bottom: 35px; }
    .login-page .login-institutional h1 { font-size: 36px; }
}
@media (max-width: 800px) {
    .login-layout { width: calc(100% - 32px); max-width: 420px; display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: 36px 0 18px; }
    .login-brand { width: 100%; }
    .login-logo { width: 252px; max-width: 85%; margin: 0 auto; }
    .login-institutional, .login-brand::before, .login-page::before { display: none; }
    .login-access { max-width: 420px; }
    .login-card { padding: 28px 26px; border-radius: 22px; }
    .login-card-heading { margin-bottom: 22px; }
    .login-subtitle { margin-bottom: 26px; }
    .login-footer { padding-bottom: 20px; }
}
@media (max-width: 380px) {
    .login-card { padding: 26px 22px; }
    .login-card-eyebrow { font-size: 9px; letter-spacing: 1.2px; }
}
@media (min-width: 801px) and (max-height: 800px) {
    .login-layout { padding: 24px 0 16px; }
    .login-logo { margin-bottom: 28px; }
    .login-card { padding-top: 30px; padding-bottom: 26px; }
    .login-card-heading { margin-bottom: 16px; }
    .login-field + .login-field { margin-top: 16px; }
    .login-access-note { margin-top: 16px; }
    .login-footer { padding: 12px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-page *, .login-page *::before, .login-page *::after { animation: none !important; transition: none !important; }
    .login-submit:hover { transform: none; }
}
