html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}

/* CONTEÚDO PRINCIPAL */
.content {
  flex: 1;
}

.esqueci-senha {
  text-align: center !important;
  margin: 30px 0px;
}

.esqueci-senha a {
  text-decoration: none;
  top: 5px;
}

.esqueci-senha a:hover {
  text-decoration: underline;
}

/* RODAPÉ FIXO */
.rodape-sistema {
  background-color: #EDF2F5;
  color: #595757;
  font-weight: bold;
  text-align: center;
  padding: 20px 0;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
}

.rodape-sistema p {
  margin: 0;
  font-size: 14px;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&display=swap');

/* TOPO — marca do sistema */
.topo-sistema {
  --topo-azul: #0b5ed7;
  --topo-azul-claro: #3d8bfd;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 76px;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, #0a58ca 0%, #0d6efd 48%, #3d8bfd 100%);
  box-shadow:
    0 4px 18px rgba(13, 110, 253, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.topo-sistema::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 120% at 8% 50%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 80% at 92% 20%, rgba(255, 255, 255, 0.12), transparent 50%),
    repeating-linear-gradient(
      -28deg,
      transparent 0,
      transparent 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 11px
    );
}

.topo-sistema::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, #ffc107 0%, #ffe08a 35%, transparent 70%);
  opacity: 0.85;
}

.topo-sistema-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.9rem;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  animation: topo-marca-entra 0.55s ease-out both;
}

.topo-sistema-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px 8px;
  flex-shrink: 0;
}

.topo-sistema-icon .bar {
  display: block;
  width: 5px;
  border-radius: 1.5px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.topo-sistema-icon .bar-1 { height: 11px; }
.topo-sistema-icon .bar-2 { height: 19px; }
.topo-sistema-icon .bar-3 { height: 26px; }

.topo-sistema-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.15rem;
}

.topo-sistema-sigla {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.82;
  line-height: 1;
}

.topo-sistema-nome {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(420px, 70vw);
}

@keyframes topo-marca-entra {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-subtitulo {
  color: #6c757d;
  font-size: 0.95rem;
}

/* Formulário um pouco mais estreito + espaço entre campos */
.login-form-col {
  max-width: 340px;
}

.content .contents .form-group.first {
  margin-bottom: 14px;
  border-radius: 7px;
}

.content .contents .form-group.last {
  border-radius: 7px;
}

/* Honeypot: invisível para usuários, visível para bots ingênuos */
.login-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Captcha local — bloco compacto (imagem + refresh + input na mesma linha) */
.content .contents .form-group.captcha-group {
  overflow: visible !important;
  min-height: 0 !important;
  height: auto !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  margin-bottom: 0.75rem;
  background: #edf2f5;
}

.content .contents .form-group.captcha-group label {
  position: static !important;
  transform: none !important;
  margin: 0 0 6px !important;
  top: auto !important;
  font-size: 12px !important;
  color: #555 !important;
  display: block;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.captcha-imagem {
  flex-shrink: 0;
  width: 120px;
  height: 38px;
  border-radius: 5px;
  border: 1px solid #d0d7de;
  background: #f0f4f8;
  object-fit: contain;
}

/* Sem classe .btn: o template (.content .btn) forçava height 54px */
.content .contents .captcha-refresh,
.captcha-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 !important;
  margin: 0;
  border: 1px solid #cfd8e3;
  border-radius: 5px;
  flex-shrink: 0;
  background: #fff;
  color: #555;
  font-size: 14px;
  line-height: 1 !important;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.content .contents .captcha-refresh:hover,
.captcha-refresh:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #333;
}

.content .contents .captcha-refresh:focus,
.captcha-refresh:focus {
  outline: none;
  border-color: #6c63ff;
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.15);
}

.content .contents .captcha-refresh i {
  font-size: 14px;
  line-height: 1;
}

.content .contents .form-group.captcha-group .captcha-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  padding: 6px 8px !important;
  font-size: 15px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #fff !important;
  border: 1px solid #cfd8e3 !important;
  border-radius: 5px !important;
  line-height: 1.2;
  height: 38px;
}

.content .contents .form-group.captcha-group .captcha-input:focus {
  border-color: #6c63ff !important;
  background: #fff !important;
}

/* Rótulo Usuário/Senha: sobe ao focar/digitar para não misturar com o texto */
.content .contents .form-group:not(.captcha-group) {
  min-height: 68px;
  padding-top: 22px;
  padding-bottom: 10px;
}

.content .contents .form-group:not(.captcha-group) .form-control {
  padding-top: 12px !important;
  line-height: 1.25;
}

.content .contents .form-group:not(.captcha-group).focus label,
.content .contents .form-group:not(.captcha-group).field--not-empty label {
  top: 5px !important;
  transform: none !important;
  margin-top: 0 !important;
  font-size: 11px !important;
  color: #888;
  line-height: 1;
}

/* Login responsivo */
@media (max-width: 991.98px) {
  .content {
    padding-bottom: 90px;
  }

  .content > .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .content .row {
    margin-left: 0;
    margin-right: 0;
  }

  .login-illustration-col {
    display: none !important;
  }

  .content .contents {
    width: 100% !important;
    padding: 1.5rem 0 2rem !important;
  }

  .login-form-col {
    max-width: 100%;
    width: 100%;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .topo-sistema {
    min-height: 64px;
    padding: 0.7rem 0.9rem;
  }

  .topo-sistema-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 7px 6px;
  }

  .topo-sistema-icon .bar-1 { height: 9px; }
  .topo-sistema-icon .bar-2 { height: 15px; }
  .topo-sistema-icon .bar-3 { height: 21px; }

  .topo-sistema-sigla {
    font-size: 0.65rem;
  }

  .topo-sistema-nome {
    font-size: 0.88rem;
    max-width: calc(100vw - 5.5rem);
    white-space: normal;
  }

  .rodape-sistema {
    padding: 14px 12px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .rodape-sistema p {
    font-size: 12px;
    line-height: 1.35;
  }
}

@media (max-width: 575.98px) {
  .content .contents h3 {
    font-size: 1.35rem;
  }

  .content .contents .form-group {
    min-height: 60px;
  }

  .content .contents .btn-block {
    width: 100%;
    min-height: 44px;
  }
}
