:root {
  --nordeste: #c91d1d;
  --nordeste-dark: #a41515;
  --nordeste-hover: #941313;
  --nordeste-soft: rgba(201, 29, 29, 0.08);
  --slate-50: #f6f8fc;
  --slate-100: #edf1f7;
  --slate-200: #dbe3ef;
  --slate-300: #c4cfdf;
  --slate-400: #92a0b8;
  --slate-500: #6f809c;
  --slate-600: #52627a;
  --slate-700: #334155;
  --slate-800: #1f2b3d;
  --slate-900: #101828;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: var(--slate-300) transparent;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--nordeste);
  outline-offset: 2px;
  border-radius: 4px;
}

.oculto {
  display: none;
}

.login-form.oculto {
  display: none;
}

/* Modal de troca obrigatoria de senha (abre depois do login com senha provisoria). */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(6px);
}

.login-modal.oculto {
  display: none;
}

.login-modal-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  color: #101828;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.login-modal-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.login-modal-texto {
  margin: 0;
  font-size: 14px;
  color: #475467;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes nit-neon-flicker {
  0%, 37.5% { color: #0f172a; text-shadow: none; }
  38.5% { color: #b91c1c; text-shadow: 0 0 3px rgba(185, 28, 28, 0.3); }
  39.5% { color: #0f172a; text-shadow: none; }
  40.5% { color: #b91c1c; text-shadow: 0 0 4px rgba(185, 28, 28, 0.4); }
  41.5% { color: #0f172a; text-shadow: none; }
  42.5% { color: #b91c1c; text-shadow: 0 0 5px rgba(185, 28, 28, 0.5); }
  43.5% { color: #0f172a; text-shadow: none; }
  44.5%, 100% { color: #b91c1c; text-shadow: 0 0 6px rgba(185, 28, 28, 0.6), 0 0 2px rgba(185, 28, 28, 0.3); }
}

.animate-flicker-nit {
  animation: nit-neon-flicker 8s infinite ease-in-out;
  display: inline-block;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 100% 0%, var(--nordeste-soft), transparent 60%),
    radial-gradient(900px 450px at 0% 100%, rgba(31, 43, 61, 0.06), transparent 60%),
    linear-gradient(180deg, #fbfcff 0%, #f6f8fc 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 40px 36px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logo-dot {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-block;
}

.logo-dot .dot {
  position: absolute;
  inset: 0;
  background: var(--nordeste);
  border-radius: 50%;
}

.logo-dot .ping {
  position: absolute;
  inset: 0;
  background: var(--nordeste);
  border-radius: 50%;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}

.logo-text {
  display: inline-flex;
}

.login-subtitle {
  color: var(--slate-500);
  font-size: 13px;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.usuario-control {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--slate-400);
  pointer-events: none;
}

.field-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  color: var(--slate-900);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.usuario-sugestoes {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.usuario-sugestoes.oculto {
  display: none;
}

.usuario-sugestao {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--slate-800);
  font-size: 14px;
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.usuario-sugestao:hover,
.usuario-sugestao:focus-visible,
.usuario-sugestao.ativo {
  background: var(--slate-50);
  border-color: var(--slate-200);
  outline: none;
}

.usuario-sugestao.ativo {
  background: var(--slate-100);
}

.usuario-sugestao mark {
  background: var(--nordeste-soft);
  color: var(--nordeste-dark);
  font-weight: 700;
  border-radius: 3px;
}

.usuario-vazio {
  color: var(--slate-500);
  cursor: default;
  justify-content: center;
}

.field-input::placeholder {
  color: var(--slate-400);
}

.field-input:focus {
  border-color: var(--nordeste);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--nordeste-soft);
}

.field-toggle {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--slate-500);
  transition: color 0.18s ease, background 0.18s ease;
}

.field-toggle:hover {
  color: var(--slate-700);
  background: var(--slate-100);
}

.eye-icon {
  width: 18px;
  height: 18px;
}

.login-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
}

.login-submit {
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--nordeste);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.login-submit:hover {
  background: var(--nordeste-dark);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-submit-loading {
  display: none;
}

.login-submit.carregando .login-submit-label {
  display: none;
}

.login-submit.carregando .login-submit-loading {
  display: block;
}

.login-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--slate-400);
  font-size: 12px;
}
.login-modal-card .field-input {
  padding-left: 14px;
}
