.auth-page {
    --auth-navbar-bg: #0c1511;
    --auth-navbar-border: #25382d;
    --auth-bg: #0a130f;
    --auth-card: #13221a;
    --auth-field: #0a1510;
    --auth-text: #f1f7f2;
    --auth-muted: #a9bbb0;
    --auth-border: #263b2e;
    --auth-accent: #79dda0;
    min-height: 100vh;
    color: var(--auth-text);
    background: var(--auth-bg);
}

:root[data-theme="light"] .auth-page {
    --auth-navbar-bg: #f6f8f5;
    --auth-navbar-border: #d5e0d8;
    --auth-bg: #f4f8f5;
    --auth-card: #ffffff;
    --auth-field: #f6faf7;
    --auth-text: #20362a;
    --auth-muted: #64776b;
    --auth-border: #d6e4d9;
    --auth-accent: #4c9d6b;
}

.auth-page header.cabecalho {
    position: sticky;
    z-index: 10;
    top: 0;
    height: 67px;
    border-bottom: 1px solid var(--auth-navbar-border);
    background: color-mix(in srgb, var(--auth-navbar-bg) 90%, transparent);
    backdrop-filter: blur(12px);
}

.auth-page header.cabecalho .navbar {
    width: 100%;
    height: 66px;
    min-height: 66px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

/* tema.css estiliza nav.navbar globalmente; a barra de acesso usa o fundo do cabeçalho. */
:root[data-theme="light"] .auth-page header.cabecalho nav.home-nav {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.auth-page header.cabecalho .home-brand {
    order: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    color: var(--auth-text);
    text-decoration: none;
    white-space: nowrap;
}

.auth-page header.cabecalho .home-brand img {
    width: 38px;
    height: 34px;
    object-fit: contain;
    object-position: left center;
}

.auth-page header.cabecalho .home-brand span {
    color: var(--auth-text);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-page header.cabecalho .theme-toggle {
    order: 1;
    width: 44px;
    height: 44px;
    margin: 0 2px 0 0 !important;
    color: var(--auth-text);
    background: var(--auth-card);
}

.auth-page header.cabecalho .home-login,
.auth-page header.cabecalho .auth-nav-link,
.auth-page header.cabecalho .btn-aluno {
    order: 3;
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    color: var(--auth-text);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.auth-page header.cabecalho .btn-aluno {
    order: 3;
    border-color: var(--auth-accent);
    color: #07140d;
    background: var(--auth-accent);
}

.auth-page main.cadastro.auth-card {
    width: min(440px, calc(100% - 32px));
    min-height: 0;
    margin: 40px auto 48px;
    padding: 22px 22px 24px;
    display: block;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    color: var(--auth-text);
    background: var(--auth-card);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .1);
}

.auth-page .titulo-cadastro {
    margin: 0;
    color: var(--auth-text);
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -.04em;
    text-align: left;
}

.auth-page .auth-subtitle {
    margin: 2px 0 20px;
    color: var(--auth-muted);
    font-size: 16px;
}

.auth-page .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 22px;
    padding: 4px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--auth-border) 48%, transparent);
}

.auth-page .auth-tabs a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: var(--auth-muted);
    font-weight: 700;
    text-decoration: none;
}

.auth-page .auth-tabs a.active {
    color: var(--auth-text);
    background: var(--auth-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.auth-page .form-cadastro {
    gap: 16px;
}

.auth-page .campo {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
}

.auth-page .campo label {
    color: var(--auth-text);
    font-size: 14px;
    text-align: left;
}

.auth-page .campo input {
    height: 48px;
    padding: 0 15px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text);
    background: var(--auth-field);
    font-size: 15px;
}

.auth-page .campo input::placeholder {
    color: var(--auth-muted);
    opacity: .8;
}

.auth-page .campo input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 20%, transparent);
}

.auth-page .campo-senha {
    position: relative;
}

.auth-page .campo-senha input {
    padding-right: 76px;
}

.auth-page .alternar-senha {
    right: 12px;
    width: auto;
    height: auto;
    padding: 4px;
    color: var(--auth-accent);
    font-size: 14px;
    font-weight: 700;
}

.auth-page .area-botao {
    margin-top: 4px;
}

.auth-page .btn-criar {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 13px;
    color: #07140d;
    background: var(--auth-accent);
    box-shadow: none;
    font-size: 15px;
}

.auth-page .btn-criar:active {
    top: 1px;
    transform: scale(.99);
    box-shadow: none;
}

.auth-page .link-recuperacao {
    margin-top: 12px;
}

.auth-page .link-recuperacao a {
    min-height: 36px;
    padding: 0 8px;
    color: var(--auth-muted);
    background: transparent;
    font-weight: 500;
}

.auth-page .demo-login-link {
    margin-top: 2px;
    text-align: center;
}

.auth-page .demo-login-link a {
    color: var(--auth-accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.auth-page .demo-login-link a:hover,
.auth-page .demo-login-link a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-page #mensagem {
    color: var(--auth-text);
    line-height: 1.45;
}

.auth-page #mensagem.mensagem-processando {
    color: var(--auth-muted);
}

@media (max-width: 520px) {
    .auth-page header.cabecalho {
        display: block;
    }

    .auth-page header.cabecalho .navbar {
        width: 100%;
        padding: 0 14px;
    }

    .auth-page header.cabecalho .home-brand img {
        width: 30px;
        height: 30px;
    }

    .auth-page header.cabecalho .home-brand span { font-size: 13px; }

    .auth-page header.cabecalho .theme-toggle {
    order: 1;
        width: 38px;
        height: 38px;
    }

    .auth-page header.cabecalho .home-login,
    .auth-page header.cabecalho .auth-nav-link,
    .auth-page header.cabecalho .btn-aluno {
    order: 3;
        min-height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }

    .auth-page main.cadastro.auth-card {
        margin-top: 10px;
        padding: 22px 18px;
    }

    .auth-page .titulo-cadastro {
        font-size: 27px;
    }

    .auth-page.login-page main.cadastro.auth-card {
        width: min(440px, calc(100% - 8px));
        margin-top: 0;
        padding: 22px;
    }
}


/* Ordem consistente da navegação nas telas de acesso. */
.auth-page header.cabecalho .home-brand { order: 0; }
.auth-page header.cabecalho .theme-toggle { order: 1; }
.auth-page header.cabecalho .home-login,
.auth-page header.cabecalho .auth-nav-link { order: 2; }
.auth-page header.cabecalho .btn-aluno { order: 3; border-radius: 15px; }
/* Navegação responsiva e protegida contra os estilos globais do tema. */
@media (max-width: 520px) {
    .auth-page header.cabecalho .navbar { gap: 5px; padding: 0 10px; }
    .auth-page header.cabecalho .home-brand img { width: 26px; }
    .auth-page header.cabecalho .theme-toggle { flex: 0 0 34px; width: 34px; height: 34px; }
    .auth-page header.cabecalho .auth-nav-link,
    .auth-page header.cabecalho .home-login,
    .auth-page header.cabecalho .btn-aluno { min-height: 36px; padding: 0 8px; font-size: 12px; }
}
@media (max-width: 360px) {
    .auth-page header.cabecalho .navbar { padding: 0 7px; gap: 4px; }
    .auth-page header.cabecalho .home-brand img { width: 24px; }
    .auth-page header.cabecalho .auth-nav-link,
    .auth-page header.cabecalho .home-login,
    .auth-page header.cabecalho .btn-aluno { padding: 0 6px; font-size: 11px; }
}

/* Barra compacta, centralizada e compartilhada pelo login e cadastro. */
.auth-page header.cabecalho .navbar {
    width: min(calc(100% - 48px), 1000px);
    padding: 0;
    gap: 8px;
}

.auth-page header.cabecalho .theme-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0 !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: 50% !important;
    background: var(--auth-card) !important;
    color: var(--auth-text) !important;
}

.auth-page header.cabecalho .home-login,
.auth-page header.cabecalho .btn-aluno {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 15px;
}

.auth-page header.cabecalho .home-login {
    border-color: var(--auth-border);
    background: transparent;
}

.auth-page header.cabecalho .btn-aluno {
    border: 1px solid var(--auth-accent);
    color: #07140d;
    background: var(--auth-accent);
}

@media (max-width: 520px) {
    .auth-page header.cabecalho .navbar {
        width: calc(100% - 24px);
        padding: 0;
        gap: 6px;
    }

    .auth-page header.cabecalho .theme-toggle {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .auth-page header.cabecalho .home-login,
    .auth-page header.cabecalho .btn-aluno {
        min-height: 36px;
        padding: 0 9px;
        font-size: 12px;
    }
}

:root[data-theme="light"] .auth-page header.cabecalho .home-login {
    border-color: var(--auth-border) !important;
    color: var(--auth-text) !important;
    background: transparent !important;
}

:root[data-theme="light"] .auth-page header.cabecalho .btn-aluno {
    border-color: var(--auth-accent) !important;
    color: #07140d !important;
    background: var(--auth-accent) !important;
}

@media (max-width: 360px) {
    .auth-page header.cabecalho .navbar { width: calc(100% - 16px); gap: 4px; }
    .auth-page header.cabecalho .home-brand { gap: 6px; }
    .auth-page header.cabecalho .home-brand img { width: 22px; }
    .auth-page header.cabecalho .home-brand span { font-size: 11px; }
    .auth-page header.cabecalho .theme-toggle { flex-basis: 32px; width: 32px; height: 32px; }
    .auth-page header.cabecalho .home-login,
    .auth-page header.cabecalho .btn-aluno { padding: 0 6px; font-size: 11px; }
}
:root[data-theme="light"] .auth-page header.cabecalho .btn-aluno {
    border: 1px solid var(--auth-accent) !important;
    color: #07140d !important;
    background: var(--auth-accent) !important;
    box-shadow: none !important;
}
:root[data-theme="light"] .auth-page header.cabecalho .btn-aluno:hover {
    background: color-mix(in srgb, var(--auth-accent) 86%, #fff) !important;
}
:root[data-theme="light"] .auth-page header.cabecalho nav.navbar .theme-toggle {
    border: 1px solid var(--auth-border) !important;
    color: var(--auth-text) !important;
    background: var(--auth-card) !important;
    box-shadow: none !important;
}

/* Indicador de força da senha no cadastro. */
.auth-page .password-strength { margin-top: 8px; }
.auth-page .password-strength-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.auth-page .password-strength-bars i { height: 5px; border-radius: 99px; background: var(--auth-border); transition: background-color .16s ease; }
.auth-page .password-strength-text { margin: 7px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.45; }
.auth-page .password-strength[data-strength="1"] .password-strength-bars i.is-active { background: #e57373; }
.auth-page .password-strength[data-strength="2"] .password-strength-bars i.is-active { background: #f0aa55; }
.auth-page .password-strength[data-strength="3"] .password-strength-bars i.is-active { background: #c4d96a; }
.auth-page .password-strength[data-strength="4"] .password-strength-bars i.is-active { background: var(--auth-accent); }

.auth-page .cadastro-consentimentos {
    width: 100%;
    margin: 2px 0 4px;
    padding: 12px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text);
    background: color-mix(in srgb, var(--auth-card) 72%, var(--auth-field));
}
.auth-page .cadastro-consentimentos legend {
    padding: 0 6px;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 800;
}
.auth-page .consentimento-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 9px;
    margin: 8px 0;
    color: var(--auth-text);
    font-size: 12px;
    line-height: 1.55;
    cursor: pointer;
}
.auth-page .consentimento-item input {
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--auth-accent);
}
.auth-page .consentimento-item a {
    color: var(--auth-accent);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-page .cadastro-consentimentos > p {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.45;
}

/* Link de recuperação destacado apenas na tela de login. */
.login-page .link-recuperacao {
    margin: 12px 0 0;
    text-align: center;
}

.login-page .link-recuperacao a {
    min-height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--auth-accent);
    background: color-mix(in srgb, var(--auth-accent) 14%, var(--auth-card));
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.login-page .link-recuperacao a:hover {
    background: color-mix(in srgb, var(--auth-accent) 22%, var(--auth-card));
    transform: translateY(-1px);
}

.login-page .link-recuperacao a:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-page .password-strength-bars i,
    .login-page .link-recuperacao a { transition: none; }
}
