/* ==========================================================================
   ADVO — tema moderno do LOGIN (e da recuperação de senha, mesmo layout)
   --------------------------------------------------------------------------
   Carregado pelo _LayoutLogin.cshtml só com ADVO_TEMA_MODERNO=1 (hoje: homolog).
   Os ids e o fluxo do Login.js não mudam: os campos continuam nascendo com
   .hidden e são revelados depois do GetDadosLogin — não mexa nisso aqui.
   O Login.js injeta cores de "modo escuro" com !important; os seletores abaixo
   levam "html body" para vencer essas regras e manter um visual só.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist/geist-latin-wght-normal.woff2") format("woff2");
}

:root {
  --radius: 0.625rem;
  --background: oklch(0.985 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.88 0 0);
  --brand: oklch(0.505 0.213 27.5);
  --ring: oklch(0.145 0 0 / 0.18);
}

html body, html body .input100, html body .login100-form-btn, html body .login100-form-title,
html body .focus-input100::after, html body .modal, html body .btn, html body .form-control {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
html body { background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; }

/* ---------- estrutura: painel da marca + formulário ---------- */
html body #divContainerLogin.container-login100 {
  background: var(--background) !important;           /* some com a foto de fundo do modo escuro/claro */
  display: grid; grid-template-columns: minmax(420px, 46%) minmax(0, 1fr);
  align-items: stretch; justify-content: stretch; padding: 0; min-height: 100vh;
}
html body .wrap-login100 {
  background: transparent !important; box-shadow: none !important; border-radius: 0;
  width: 100%; max-width: none; padding: 48px 32px; overflow: visible;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
html body .login100-form { width: 100%; max-width: 380px; }

.login-marca {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 500px at 110% -10%, oklch(0.505 0.213 27.5 / 0.55), transparent 60%),
    radial-gradient(700px 480px at -20% 110%, oklch(0.45 0.12 260 / 0.45), transparent 60%),
    oklch(0.17 0.01 260);
  padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-marca::after {                                     /* textura sutil de grade */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.login-marca > * { position: relative; z-index: 1; }
/* marca ADVO em evidência: símbolo vetorizado em branco + nome */
.login-marca__logo { display: flex; align-items: center; gap: 16px; font-size: 26px; letter-spacing: -0.025em; font-weight: 500; color: #fff; }
.login-marca__logo b { font-weight: 750; }
.login-marca__simbolo { width: 56px; height: 57px; color: #fff; flex: none; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35)); }
.login-marca__marca-dagua {                                   /* símbolo gigante e sutil ao fundo */
  position: absolute; right: -9%; bottom: -12%; width: 78%; height: auto; color: #fff; opacity: .045; z-index: 0 !important; pointer-events: none;
}
.login-marca-movel { display: none; }
.login-marca h2 { font-size: 38px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 22px; color: #fff; }
.login-marca ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.login-marca li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; color: oklch(0.9 0 0); }
.login-marca li::before {
  content: "✓"; flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; background: oklch(1 0 0 / 0.12); border: 1px solid oklch(1 0 0 / 0.18);
}
.login-marca__rodape { font-size: 12.5px; color: oklch(0.72 0 0); }

/* ---------- cabeçalho do formulário ---------- */
html body .login100-form-title.p-b-48 { padding-bottom: 28px !important; text-align: left; }
html body #logoAmbienteLogin {
  width: 72px !important; height: 72px !important; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgb(0 0 0 / .06); padding: 6px; object-fit: contain !important;
}
html body #logoAmbienteLogin:not([src]) { visibility: hidden; }
html body #spanMensagemLogin.login100-form-title {
  font-size: 28px !important; font-weight: 700; letter-spacing: -0.03em; color: var(--foreground) !important;
  text-align: left; padding-bottom: 6px !important;
}
.login-subtitulo { font-size: 14.5px; color: var(--muted-foreground); margin: 0 0 28px; }
html body .login100-form:has(#divEmailLogin.hidden) .login-subtitulo { display: none; }

/* ---------- campos: rótulo fixo acima, caixa com borda ---------- */
html body .wrap-input100 { border-bottom: 0 !important; margin-bottom: 18px !important; padding-top: 24px; }
html body .focus-input100::before { display: none !important; }
html body .focus-input100 { height: auto; }
html body .focus-input100::after {
  top: 0 !important; left: 0; padding-left: 0; font-size: 13px !important; font-weight: 500;
  color: var(--foreground) !important; transition: none;
}
html body .input100 {
  height: 44px; padding: 0 14px; font-size: 15px; color: var(--foreground) !important;
  background: var(--card) !important; border: 1px solid var(--input); border-radius: 10px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04); transition: border-color .15s, box-shadow .15s;
}
html body .input100::placeholder { color: oklch(0.7 0 0); }
html body .input100:focus { outline: none; border-color: var(--foreground); box-shadow: 0 0 0 4px var(--ring); }
html body #passwordUsuario, html body #novaSenhaUsuario, html body #repetirNovaSenhaUsuario { padding-right: 44px; }
html body .btn-show-pass {
  top: 24px !important; right: 4px !important; height: 44px !important; width: 40px; padding: 0 !important;
  display: flex !important; align-items: center; justify-content: center; color: var(--muted-foreground) !important; z-index: 2;
}
html body .btn-show-pass:hover { color: var(--foreground) !important; }
html body .alert-validate::before { border-radius: 8px; top: 34px; }

/* ---------- botão ---------- */
html body .container-login100-form-btn { margin-bottom: 0 !important; padding-top: 8px; display: block; }
html body .wrap-login100-form-btn { border-radius: 10px !important; overflow: visible; width: 100%; box-shadow: none; }
html body .login100-form-bgbtn { display: none !important; }
html body .login100-form-btn {
  height: 44px; border-radius: 10px; font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--foreground) !important; color: #fff !important; width: 100%;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12); transition: background-color .15s, box-shadow .15s;
}
html body .login100-form-btn:hover { background: oklch(0.28 0 0) !important; }
html body .login100-form-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
html body .login100-form-btn[disabled] { opacity: .7; cursor: progress; }

/* ---------- esqueceu a senha ---------- */
html body #divResetarSenha, html body .divResetarSenhaDarkMode, html body .divResetarSenhaLightMode {
  margin-top: 18px !important; text-align: center; font-size: 13.5px; color: var(--muted-foreground) !important;
}
html body #divResetarSenha a, html body #btnAbrirModalResetarSenha { color: var(--foreground) !important; text-decoration: underline; text-underline-offset: 3px; }
html body #divResetarSenha a b { font-weight: 600; }

/* ---------- WhatsApp do suporte: fixo no canto da tela ---------- */
html body div:has(> #whatsappSuporte), html body div:has(> #urlWhatsAppSuporte) {
  position: fixed; right: 24px; bottom: 24px; margin: 0 !important; z-index: 20;
  width: 52px !important; height: 52px !important; border-radius: 16px !important;
  background: oklch(0.63 0.17 150) !important; box-shadow: 0 8px 24px rgb(0 0 0 / .18) !important;
  display: grid; place-items: center;
}
html body #whatsappSuporte i, html body #urlWhatsAppSuporte i { margin-top: 0 !important; font-size: 24px !important; line-height: 1; }
html body #whatsappSuporte, html body #urlWhatsAppSuporte { display: grid !important; place-items: center; width: 100%; height: 100%; }

/* ---------- modais (suporte, recuperar senha) ---------- */
html body .modal-backdrop.in { opacity: .45; }
html body .modal-content { border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px rgb(0 0 0 / .18); overflow: hidden; }
html body .modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px 14px; }
html body .modal-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
html body .modal-body { padding: 18px 22px; }
html body .modal-body label { font-weight: 500; font-size: 13.5px; margin-bottom: 8px; }
html body .modal-footer { border-top: 1px solid var(--border); background: var(--muted); padding: 12px 22px; }
html body .modal .form-control { height: 40px; border-radius: 10px; border: 1px solid var(--input); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
html body .modal .form-control:focus { border-color: var(--foreground); box-shadow: 0 0 0 4px var(--ring); }
html body .modal .btn { border-radius: 10px; font-weight: 500; padding: 8px 16px; }
html body .modal .btn-primary { background: var(--foreground); border-color: var(--foreground); }
html body .modal .btn-default { background: var(--card); border: 1px solid var(--border); }
html body .well { background: var(--muted); border: 1px solid var(--border); border-radius: 12px; box-shadow: none; }

/* ---------- suporte: passo "Escolha o ambiente" (mesmo fluxo do /new) ---------- */
html body #formLogar.passo-ambiente > *:not(#divEscolhaAmbiente) { display: none !important; }
.escolha-ambiente { width: 100%; }
.escolha-ambiente__voltar {
  background: none; border: 0; padding: 0; margin: 0 0 18px; color: var(--muted-foreground);
  font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.escolha-ambiente__voltar:hover { color: var(--foreground); }
.escolha-ambiente__titulo { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 6px; color: var(--foreground); }
.escolha-ambiente__sub { font-size: 14.5px; color: var(--muted-foreground); margin: 0 0 24px; }
.escolha-ambiente__rotulo { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--foreground); }
.escolha-ambiente__rotulo span { color: var(--brand); }
.escolha-ambiente__busca { position: relative; }
.escolha-ambiente__busca i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); font-size: 13px; }
#inputBuscaAmbiente {
  width: 100%; height: 44px; padding: 0 14px 0 38px; font-size: 15px; color: var(--foreground);
  background: var(--card); border: 1px solid var(--input); border-radius: 10px 10px 0 0; box-shadow: 0 1px 2px rgb(0 0 0 / .04); outline: none;
}
#inputBuscaAmbiente:focus { border-color: var(--foreground); }
.escolha-ambiente__lista {
  list-style: none; margin: 0 0 16px; padding: 4px; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--input); border-top: 0; border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 28px rgb(0 0 0 / .08);
}
.escolha-ambiente__lista li { padding: 9px 12px; border-radius: 7px; font-size: 14px; color: var(--foreground); cursor: pointer; }
.escolha-ambiente__lista li.ativo, .escolha-ambiente__lista li:hover { background: var(--muted); }
.escolha-ambiente__lista li.selecionado { font-weight: 600; }
.escolha-ambiente__lista li.vazio { color: var(--muted-foreground); cursor: default; background: none; }
.escolha-ambiente__erro { color: oklch(0.55 0.2 27); font-size: 13px; margin: -6px 0 12px; }
html body .escolha-ambiente__entrar { margin-top: 0; }

/* ---------- telas estreitas: só o formulário ---------- */
@media (max-width: 991px) {
  /* minmax(0,1fr): sem isso a coluna não encolhe abaixo do conteúdo e a página estoura a largura */
  html body #divContainerLogin.container-login100 { grid-template-columns: minmax(0, 1fr); }
  .login-marca { display: none; }
  .login-marca-movel {
    display: flex; align-items: center; gap: 10px; width: 100%; max-width: 380px; margin-bottom: 36px;
    font-size: 19px; letter-spacing: -0.02em; font-weight: 500; color: var(--foreground);
  }
  .login-marca-movel svg { width: 30px; height: 31px; color: #006aaa; flex: none; }
  .login-marca-movel b { font-weight: 750; }
  html body .wrap-login100 { padding: 40px 22px; min-width: 0; box-sizing: border-box; }
  html body .wrap-input100, html body .input100 { box-sizing: border-box; max-width: 100%; }
}

/* Transição suave do login para o sistema (cross-document View Transitions) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
