/* Telas de acesso (login e senha): independentes do base.html, sem sidebar. */

:root {
    --auth-marca: #10243e;
    --auth-marca-2: #1b3557;
    --auth-sol: #f2a03d;
    --auth-texto-marca: #c7d4e4;
    --auth-texto-marca-fraco: #7d90a8;

    --auth-fundo: #f4f6f9;
    --auth-cartao: #ffffff;
    --auth-borda: #d5dde7;
    --auth-texto: #10243e;
    --auth-texto-fraco: #5b6f88;
    --auth-campo: #ffffff;
    --auth-foco: #0d6efd;
    --auth-foco-anel: rgba(13, 110, 253, .18);
    --auth-erro: #b42318;
    --auth-erro-fundo: #fef3f2;
    --auth-erro-borda: #fecdca;
    --auth-aviso: #93370d;
    --auth-aviso-fundo: #fffaeb;
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-fundo: #0b1626;
        --auth-cartao: #10243e;
        --auth-borda: #2a4466;
        --auth-texto: #e6edf5;
        --auth-texto-fraco: #9fb2c8;
        --auth-campo: #0b1a2e;
        --auth-foco: #4d94ff;
        --auth-foco-anel: rgba(77, 148, 255, .25);
        --auth-erro: #fda29b;
        --auth-erro-fundo: #3a1512;
        --auth-erro-borda: #7a271a;
        --auth-aviso: #fec84b;
        --auth-aviso-fundo: #3a2a0a;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.auth {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-texto);
    background: var(--auth-fundo);
    -webkit-font-smoothing: antialiased;
}

.auth-tela {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------------------------------------------------------------- marca -- */

.auth-marca {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: var(--auth-texto-marca);
    background: linear-gradient(160deg, var(--auth-marca) 0%, #0a1a2f 100%);
}

/* malha de fundo, como uma tela de monitoramento */
.auth-marca::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(199, 212, 228, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(199, 212, 228, .05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
    pointer-events: none;
}

/* topologia de rede: estatica, discreta, so linha */
.auth-topologia {
    position: absolute;
    right: -200px;
    top: 50%;
    width: 600px;
    height: 600px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: .9;
    /* some aos poucos do lado do texto */
    mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
}

.auth-topologia .enlaces line { stroke: rgba(199, 212, 228, .13); stroke-width: 1; }
.auth-topologia .nos circle { fill: #0d1f36; stroke: rgba(199, 212, 228, .35); stroke-width: 1.2; }
.auth-topologia .nos-centrais circle { fill: #1b3557; stroke: rgba(199, 212, 228, .55); stroke-width: 1.4; }
.auth-topologia .anel { fill: none; stroke: rgba(199, 212, 228, .16); stroke-width: 1; stroke-dasharray: 3 4; }

.auth-marca > :not(.auth-topologia) { position: relative; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
}

.auth-logo img { width: 44px; height: 44px; }

.auth-logo strong {
    display: none; /* no desktop o nome ja e o titulo do painel */
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .4px;
}

.auth-chamada { max-width: 440px; }

.auth-chamada h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.3px;
}

.auth-chamada > p {
    margin: 0 0 32px;
    font-size: 16px;
    color: var(--auth-texto-marca);
}

.auth-recursos {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 16px;
}

.auth-recursos li {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
}

.auth-recursos i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: var(--auth-sol);
    background: rgba(242, 160, 61, .10);
    border: 1px solid rgba(242, 160, 61, .22);
    font-size: 15px;
}

.auth-recursos strong { display: block; color: #fff; font-weight: 600; font-size: 14.5px; }
.auth-recursos span { font-size: 13.5px; color: var(--auth-texto-marca-fraco); }

.auth-marca-rodape {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--auth-texto-marca-fraco);
}

/* ------------------------------------------------------------ formulario -- */

.auth-painel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 24px 24px;
}

.auth-cartao {
    width: 100%;
    max-width: 400px;
    margin-top: auto; /* com o margin-top:auto do rodape, fica no meio */
}

.auth-cartao h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.auth-subtitulo {
    margin: 0 0 28px;
    color: var(--auth-texto-fraco);
}

.auth-texto { margin: 0 0 16px; }
.auth-texto-fraco { color: var(--auth-texto-fraco); font-size: 14px; }

.auth-icone-estado {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 14px;
    font-size: 22px;
    color: var(--auth-foco);
    background: var(--auth-foco-anel);
}

.auth-icone-estado.ok { color: #067647; background: rgba(6, 118, 71, .12); }
.auth-icone-estado.alerta { color: var(--auth-aviso); background: var(--auth-aviso-fundo); }

.auth-campo { margin-bottom: 18px; }

.auth-campo label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
}

.auth-entrada {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-entrada > .fa-solid:first-child {
    position: absolute;
    left: 14px;
    color: var(--auth-texto-fraco);
    font-size: 14px;
    pointer-events: none;
}

.auth-entrada input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    font: inherit;
    color: var(--auth-texto);
    background: var(--auth-campo);
    border: 1px solid var(--auth-borda);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-entrada input[type="password"],
.auth-entrada input[data-senha] { padding-right: 46px; }

.auth-entrada input:focus {
    border-color: var(--auth-foco);
    box-shadow: 0 0 0 4px var(--auth-foco-anel);
}

.auth-campo.com-erro input { border-color: var(--auth-erro); }

.auth-ver-senha {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--auth-texto-fraco);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.auth-ver-senha:hover { color: var(--auth-texto); }
.auth-ver-senha:focus-visible { outline: 2px solid var(--auth-foco); outline-offset: 1px; }

.auth-erros {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--auth-erro);
}

.auth-ajuda {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--auth-texto-fraco);
}

.auth-ajuda ul { margin: 0; padding-left: 18px; }

.auth-caps {
    display: none;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--auth-aviso);
}

.auth-caps.visivel { display: block; }

.auth-alerta {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--auth-erro);
    background: var(--auth-erro-fundo);
    border: 1px solid var(--auth-erro-borda);
    border-radius: 10px;
}

.auth-alerta i { margin-top: 3px; }

.auth-linha {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 22px;
}

.auth-link {
    color: var(--auth-foco);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.auth-botao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: var(--auth-marca);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.auth-botao:hover { background: var(--auth-marca-2); }
.auth-botao:active { transform: translateY(1px); }
.auth-botao:focus-visible { outline: 3px solid var(--auth-foco-anel); outline-offset: 2px; }
.auth-botao[disabled] { opacity: .75; cursor: progress; }

@media (prefers-color-scheme: dark) {
    .auth-botao { background: var(--auth-foco); color: #06111f; }
    .auth-botao:hover { background: #7ab0ff; }
}

.auth-voltar {
    margin-top: 22px;
    text-align: center;
}

.auth-rodape {
    margin-top: auto;
    padding-top: 32px;
    font-size: 12.5px;
    color: var(--auth-texto-fraco);
    text-align: center;
}

/* ---------------------------------------------------------------- celular -- */

@media (max-width: 900px) {
    .auth-tela { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

    .auth-marca {
        padding: 22px 24px;
        flex-direction: row;
        align-items: center;
    }

    .auth-chamada, .auth-marca-rodape { display: none; }

    .auth-topologia {
        right: -300px;
        width: 420px;
        height: 420px;
    }

    .auth-logo img { width: 36px; height: 36px; }
    .auth-logo strong { display: inline; font-size: 19px; }

    .auth-painel { justify-content: flex-start; padding: 36px 16px 20px; }
}
