/* =========================================================================
   Login do Next no Auth - subset CSS dedicado.
   Replica visualmente a tela de login do next-v4 (Views/Login/Index + _LayoutLogin)
   sem depender do main.css (245 KB) do Next.
   Apenas as regras necessarias para a tela de login: layout, sidebar, form,
   botoes, headline da area direita.
   ========================================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100vh; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: #404040;
    background: #fff;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ---------- Layout principal: 2 colunas (sidebar + conteudo) ---------- */
.container-geral {
    min-height: 100vh;
    display: flex;
}

/* ---------- Sidebar esquerda (form de login) ---------- */
.area-nao-logada-sidebar {
    width: 360px;
    background: #fff;
    position: relative;
    z-index: 5;
}

.area-nao-logada-sidebar-interno {
    position: fixed;
    height: 100vh;
    top: 0;
    width: 100%;
    max-width: 355px;
    background: #fff;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* Header fixo no topo da sidebar, igual ao next-v4 (_area-nao-logada.scss).
   O conteudo precisa de padding-top de 125px para nao ficar sob ele. */
.area-nao-logada-sidebar-header {
    padding: 40px;
    background: #fff;
    position: fixed;
    width: 100%;
    max-width: 355px;
    z-index: 2;
}

.area-nao-logada-sidebar-header .logo img {
    max-width: 220px;
    height: auto;
}

.area-nao-logada-sidebar-conteudo {
    padding: 125px 35px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.area-nao-logada-sidebar-footer {
}

.area-nao-logada-sidebar-footer-interno {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
    position: relative;
}

.area-nao-logada-sidebar-footer-interno::before {
    content: "";
    display: block;
    width: calc(100% - 20px);
    height: 1px;
    background: #ebebeb;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.area-nao-logada-sidebar-footer .link {
    color: #7ea1f3;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

.area-nao-logada-sidebar-footer .link:not(:last-child) {
    margin-right: 30px;
}

.area-nao-logada-sidebar-footer .link .icon {
    margin-right: 4px;
}

/* ---------- Conteudo direito (headline + descricao) ---------- */
.conteudo-principal {
    background: url('../img/bg-area-nao-logada.png') no-repeat center 0 / cover;
    flex: 1;
    padding: 85px 110px;
}

.area-nao-logada-titulo {
    font-weight: 300;
    color: #fff;
    font-size: 45px;
    line-height: 1.1;
    margin-bottom: 50px;
}

.area-nao-logada-conteudo {
    color: #a6a6c4;
    font-size: 14px;
    line-height: 1.4;
    max-width: 450px;
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #a6a6c4;
    font-weight: 400;
    margin-bottom: 0;
}

.form-control {
    display: block;
    width: 100%;
    height: 46px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #a6a6c4;
    background-color: #f6f6f6;
    border: solid 1px #ebebeb;
    border-radius: 2px;
    font-weight: 100;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-control:focus {
    border-color: #7ea1f3;
    box-shadow: 0 0 0 .15rem rgba(126, 161, 243, .25);
    outline: none;
}

.form-control::placeholder {
    color: #a6a6c4;
}

/* Botoes empilhados em LARGURA TOTAL (par casado com o botao corporativo .btn-sso).
   O wrapper .form-group e bloco (largura total) e o .btn-primary preenche com width:100%. */
.form-actions {
    margin-top: 20px;
}
.form-actions .form-group {
    margin-bottom: 0;
}

/* ---------- Botoes ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: background-color .15s, border-color .15s;
}

/* Botao "Entrar" / acoes primarias. Cor copiada do main.css do Next (#27deac verde turquesa,
   hover #19cb9b, disabled #d0d0ef lilas claro). Texto em uppercase. Agora em LARGURA TOTAL
   (par casado com o botao corporativo .btn-sso, ambos empilhados na mesma proporcao).
   Layout flex para suportar texto + spinner inline (spinner aparece dentro do botao quando
   o submit esta em andamento -- espelho do comportamento Next original). */
.btn-primary {
    background: #27deac;
    border-color: #27deac;
    color: #fff;
    width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary:hover {
    background: #19cb9b;
    border-color: #19cb9b;
}

.btn-primary:disabled,
.btn-primary.disabled {
    background: #d0d0ef;
    border-color: #d0d0ef;
    cursor: not-allowed;
    opacity: 1;
}

.btn-primary:disabled:hover,
.btn-primary.disabled:hover {
    background: #d0d0ef;
    border-color: #d0d0ef;
}

/* ---------- Validation (ValidationSummary do Razor) ---------- */
.validation-summary-errors, .field-validation-error {
    color: #d9534f;
    font-size: 12px;
    margin: 8px 0;
}

.validation-summary-errors ul {
    list-style: none;
    padding-left: 0;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .container-geral { flex-direction: column; }
    .area-nao-logada-sidebar,
    .area-nao-logada-sidebar-interno {
        width: 100%;
        max-width: 100%;
        position: relative;
        height: auto;
    }
    /* Header volta ao fluxo normal em mobile (sidebar nao é mais fixed) */
    .area-nao-logada-sidebar-header {
        position: relative;
        max-width: 100%;
    }
    /* Padding-top reduzido pois o header nao é mais fixed em mobile */
    .area-nao-logada-sidebar-conteudo {
        padding: 40px 30px;
    }
    .conteudo-principal {
        padding: 40px 30px;
        min-height: 200px;
    }
    .area-nao-logada-titulo { font-size: 28px; }
}

/* ---------- Utilitarios ---------- */
.hidden { display: none !important; }

/* ---------- Spinner de carregamento (FontAwesome ao lado do botao) ----------
   Spinner fica fora do botao, ao lado direito, espelhando o comportamento
   do Next original (Index.cshtml: elemento separado do <button type="submit">).

   Forcamos animacao propria com !important para sobrepor o reset do FontAwesome 6
   dentro de `@media (prefers-reduced-motion: reduce)` (que zera a animacao para 1ms
   quando o sistema do usuario sinaliza "reduzir movimentos" -- efeito colateral nao
   desejado para feedback de loading critico). Animacao em steps(8) replica o
   visual classico do `fa-pulse`. */
@keyframes carregando-next-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.carregando-form-login {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7ea0f3;
    font-size: 14px;
    background: transparent;
    border: none;
    animation: carregando-next-spin 1s steps(8) infinite !important;
    -webkit-animation: carregando-next-spin 1s steps(8) infinite !important;
    transform-origin: center;
}

/* Quando .hidden estiver presente, nao precisa rodar a animacao. */
.carregando-form-login.hidden {
    animation: none !important;
    -webkit-animation: none !important;
}

/* ---------- Modal de feedback ----------
   Replica visual do plugin jquery-modal usado no Next original
   (vendors/jquery-modal/jquery.modal.min.css):
     - overlay escuro 75% alpha
     - card branco arredondado 8px com box-shadow forte
     - botao fechar em CIRCULO PRETO com X branco, posicionado FORA do card
       (top:-12.5px, right:-12.5px, 30x30) */
.modal-next {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-next.is-open {
    display: flex;
}
.modal-next-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}
.modal-next-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 28px 36px 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    z-index: 1;
    text-align: left;
}
.modal-next-close {
    position: absolute;
    top: -12.5px;
    right: -12.5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.modal-next-close:hover {
    background: #222;
}
.modal-next-mensagem {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #404040;
}

/* ---------- Login corporativo (SSO/OIDC) ---------- */
.sso-sep {
    display: flex;
    align-items: center;
    text-align: center;
    color: #a6a6c4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 22px 0 14px;
}
.sso-sep::before,
.sso-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ebebeb;
}
.sso-sep span { padding: 0 12px; }

/* Botao corporativo (OIDC). Preenchido com #7ea1f3 (azul/lavanda do Next, mesma cor de
   foco dos inputs e dos links do rodape) em borda e fundo, texto branco. Hover: tom mais
   escuro #6f8ed6. Largura total -- par casado com o .btn-primary "Entrar". */
.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #7ea1f3;
    border: 1px solid #7ea1f3;
    color: #fff;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    padding: 10px 16px;
    margin-bottom: 8px;
}
.btn-sso:hover {
    background: #6f8ed6;
    border-color: #6f8ed6;
    color: #fff;
}
.btn-sso i { font-size: 16px; }

/* Estado "carregando" do botao corporativo (apos clique, ate a navegacao). */
.btn-sso.is-loading { pointer-events: none; opacity: .8; cursor: default; }
.btn-sso.is-loading i { animation: carregando-next-spin .8s linear infinite; }

/* Estado "desabilitado" do botao corporativo enquanto OUTRA acao (login) esta em andamento. */
.btn-sso.is-disabled { pointer-events: none; opacity: .5; cursor: not-allowed; }

