/* ==========================================================================
   UNEMAT LOGIN — CSS Oficial de Ajustes Finos (GLPI 11)
   Layout: Simétrico 50/50 em Card Central Ampliado (1240px x 680px)
   Identidade: Paleta Verde Institucional UNEMAT + Fundo Gradiente Figma
   ========================================================================== */

/* ── Importação da Fonte Oficial ─────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── Variáveis Institucionais ────────────────────────────── */
body.eso-login-custom,
body.unematlogin-login-custom {
  --unemat-green:        #4caf6e;
  --unemat-green-dark:   #388e4a;
  --unemat-green-hover:  #43a362;
  --unemat-border:       #cbd5e1;
  --unemat-text:         #0f172a;
  --unemat-text-muted:   #64748b;
  --unemat-error:        #e53e3e;
  --unemat-error-bg:     #fff5f5;
  --unemat-radius:       16px;
  --unemat-shadow:       0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);
}

/* ── Body / Fundo Geral da Página ────────────────────────── */
body.eso-login-custom,
body.unematlogin-login-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  background: linear-gradient(45deg, #118ab2, #06d6a0);
  font-family: "Inter Var", Inter, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  transition: background 0.3s ease;
}

/* ── Card Principal Centralizado ─────────────────────────── */
body.eso-login-custom .container-tight,
body.unematlogin-login-custom .container-tight {
  display: flex !important;
  flex-direction: row;
  width: 100%;
  max-width: 1240px;
  height: 680px;
  min-height: auto !important;
  background: #ffffff !important;
  border: 1px solid var(--unemat-border);
  border-radius: var(--unemat-radius);
  overflow: hidden;
  box-shadow: var(--unemat-shadow);
  padding: 0 !important;
}

/* ── Painel Esquerdo: Formulário (50%) ───────────────────── */
body.eso-login-custom .form-panel,
body.unematlogin-login-custom .form-panel {
  flex: 1;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Reset no Card Nativo do GLPI */
body.eso-login-custom .main-content-card,
body.unematlogin-login-custom .main-content-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ── AJUSTE DE ESPAÇAMENTO NO CARD-BODY NATIVO ──────────────── */
body.eso-login-custom .main-content-card .card-body,
body.unematlogin-login-custom .main-content-card .card-body {
  padding: 0 !important;       /* Remove paddings internos do card nativo */
  margin-bottom: 0 !important;  /* Zera margens inferiores */
}

/* Anulação das Colunas Nativas do GLPI */
body.eso-login-custom .form-panel .col-md-5,
body.eso-login-custom .form-panel .col-lg-5,
body.unematlogin-login-custom .form-panel .col-md-5,
body.unematlogin-login-custom .form-panel .col-lg-5 {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.eso-login-custom .form-panel .row,
body.unematlogin-login-custom .form-panel .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
}

body.eso-login-custom .form-panel .card,
body.unematlogin-login-custom .form-panel .card {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Título do Formulário ────────────────────────────────── */
body.eso-login-custom .card-header h2.mx-auto,
body.eso-login-custom .card-header .h2,
body.unematlogin-login-custom .card-header h2.mx-auto,
body.unematlogin-login-custom .card-header .h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--unemat-green);
  text-align: left;
  margin: 0 0 4px 0;
}

body.eso-login-custom .card-header.mb-4,
body.unematlogin-login-custom .card-header.mb-4 {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 20px !important;
}

/* ── Rótulos (Labels) ────────────────────────────────────── */
body.eso-login-custom .form-label,
body.unematlogin-login-custom .form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--unemat-text-muted);
  margin-bottom: 5px;
  letter-spacing: .01em;
  display: block;
}

/* ── Campos de Entrada (.form-control) ──────────────────── */
body.eso-login-custom .main-content-card .form-control,
body.unematlogin-login-custom .main-content-card .form-control {
  width: 100% !important;
  height: 44px;
  font-size: 14px;
  font-family: inherit;
  color: var(--unemat-text);
  background: #f8fafc;
  border: 1px solid var(--unemat-border);
  border-radius: 8px;
  padding: 0 40px 0 12px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

body.eso-login-custom .main-content-card .form-control::placeholder,
body.unematlogin-login-custom .main-content-card .form-control::placeholder {
  color: #94a3b8;
}

body.eso-login-custom .main-content-card .form-control:focus,
body.unematlogin-login-custom .main-content-card .form-control:focus {
  border-color: var(--unemat-green);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(76,175,110,.15);
}

body.eso-login-custom .main-content-card .form-control.is-invalid,
body.unematlogin-login-custom .main-content-card .form-control.is-invalid {
  border-color: var(--unemat-error);
  background: var(--unemat-error-bg);
  box-shadow: 0 0 0 3px rgba(229,62,62,.10);
}

/* ── Container para Tooltip e Eye-Toggle ─────────────────── */
body.eso-login-custom .login-input-wrap,
body.unematlogin-login-custom .login-input-wrap {
  position: relative;
}

/* ── Balão Flutuante (Tooltip) ───────────────────────────── */
body.eso-login-custom .login-tooltip,
body.unematlogin-login-custom .login-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: .78rem;
  line-height: 1.4;
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(0,0,0,.20);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}

body.eso-login-custom .login-tooltip::before,
body.unematlogin-login-custom .login-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 16px;
  width: 10px;
  height: 10px;
  background: #1e293b;
  transform: rotate(45deg);
  border-radius: 2px;
}

body.eso-login-custom .login-tooltip svg,
body.unematlogin-login-custom .login-tooltip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #fbbf24;
}

body.eso-login-custom .login-tooltip strong,
body.unematlogin-login-custom .login-tooltip strong {
  color: #fbbf24;
}

body.eso-login-custom .login-input-wrap.tooltip-open .login-tooltip,
body.unematlogin-login-custom .login-input-wrap.tooltip-open .login-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ── Botão Revelar/Ocultar Senha ─────────────────────────── */
body.eso-login-custom .login-toggle-pass,
body.unematlogin-login-custom .login-toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 5px;
  transition: color .2s ease;
}

body.eso-login-custom .login-toggle-pass:hover,
body.unematlogin-login-custom .login-toggle-pass:hover {
  color: var(--unemat-green);
}

body.eso-login-custom .login-toggle-pass svg,
body.unematlogin-login-custom .login-toggle-pass svg {
  width: 16px;
  height: 16px;
}

/* ── Alerta Global Dinâmico ──────────────────────────────── */
body.eso-login-custom .login-alert,
body.unematlogin-login-custom .login-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: .83rem;
  margin-bottom: 14px;
  border: 1px solid var(--unemat-error);
  background: var(--unemat-error-bg);
  color: var(--unemat-error);
  animation: unemat-slideIn .25s ease;
}

body.eso-login-custom .login-alert--hidden,
body.unematlogin-login-custom .login-alert--hidden {
  display: none !important;
}

/* ── Mensagem de Erro de Campo ───────────────────────────── */
body.eso-login-custom .login-field-error,
body.unematlogin-login-custom .login-field-error {
  display: block;
  font-size: .74rem;
  color: var(--unemat-error);
  margin-top: 4px;
  min-height: 16px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}

body.eso-login-custom .login-field-error.visible,
body.unematlogin-login-custom .login-field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Checkbox (Lembrar de Mim) ───────────────────────────── */
body.eso-login-custom .form-check,
body.unematlogin-login-custom .form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 0;
}

body.eso-login-custom .form-check-input,
body.unematlogin-login-custom .form-check-input {
  width: 16px;
  height: 16px;
  border: 1px solid var(--unemat-border);
  border-radius: 4px;
  background: #f8fafc;
  cursor: pointer;
  accent-color: var(--unemat-green);
  margin: 0;
  flex-shrink: 0;
  transition: border-color .2s, background .2s;
}

body.eso-login-custom .form-check-input:checked,
body.unematlogin-login-custom .form-check-input:checked {
  background: var(--unemat-green);
  border-color: var(--unemat-green);
}

body.eso-login-custom .form-check-label,
body.unematlogin-login-custom .form-check-label {
  font-size: .85rem;
  color: var(--unemat-text-muted);
}

/* ── Rodapé e Botão de Acesso ────────────────────────────── */
body.eso-login-custom .form-panel .form-footer,
body.unematlogin-login-custom .form-panel .form-footer {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;         /* ZERADO: Remove o espaçamento gigante nativo do GLPI acima do botão */
  padding: 0 !important;
  box-sizing: border-box;
}

body.eso-login-custom .main-content-card .btn-primary,
body.eso-login-custom .main-content-card button[type="submit"],
body.eso-login-custom .btn.btn-primary,
body.unematlogin-login-custom .main-content-card .btn-primary,
body.unematlogin-login-custom .main-content-card button[type="submit"],
body.unematlogin-login-custom .btn.btn-primary {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 48px !important;
  background-color: var(--eso-primary, #388e4a) !important;
  border: 1px solid #2e7d32 !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  border-radius: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.35) !important;
  transition: all .2s ease !important;
}

body.eso-login-custom .main-content-card .btn-primary:hover,
body.eso-login-custom .main-content-card button[type="submit"]:hover,
body.unematlogin-login-custom .main-content-card .btn-primary:hover,
body.unematlogin-login-custom .main-content-card button[type="submit"]:hover {
  background-color: #2e7d32 !important;
  border-color:     #1b5e20 !important;
  transform:        translateY(-1px) !important;
  box-shadow:       0 6px 20px rgba(46, 125, 50, 0.45) !important;
}

body.eso-login-custom .login-spinner,
body.unematlogin-login-custom .login-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: unemat-spin .7s linear infinite;
  display: none;
}

body.eso-login-custom .login-btn-loading .login-spinner,
body.unematlogin-login-custom .login-btn-loading .login-spinner {
  display: block;
}

body.eso-login-custom .login-btn-loading .login-btn-label,
body.unematlogin-login-custom .login-btn-loading .login-btn-label {
  display: none;
}

/* ── Bloco Informativo de Avisos e Ajuda ─────────────────── */
body.eso-login-custom .unemat-custom-rich-text,
body.unematlogin-login-custom .unemat-custom-rich-text {
  margin-top: 10px !important; /* Espaçamento ideal e polido entre o botão e o início do texto */
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ── Lista de Links de Ajuda ─────────────────────────────── */
body.eso-login-custom .unemat-help-list,
body.unematlogin-login-custom .unemat-help-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 0 !important;    /* ZERADO: Garante que a lista não herde margens empurrando para baixo */
}

body.eso-login-custom .unemat-help-item,
body.unematlogin-login-custom .unemat-help-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  text-align: left !important;
}

body.eso-login-custom .unemat-help-item .help-icon,
body.unematlogin-login-custom .unemat-help-item .help-icon {
  width: 15px !important;
  height: 15px !important;
  color: #388e4a !important; /* Verde UNEMAT */
  flex-shrink: 0 !important;
}

body.eso-login-custom .unemat-help-item .help-text,
body.unematlogin-login-custom .unemat-help-item .help-text {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  gap: 4px !important;
  line-height: 1.4;
}

body.eso-login-custom .unemat-help-item .help-label,
body.unematlogin-login-custom .unemat-help-item .help-label {
  color: #64748b !important;
  font-weight: 500 !important;
}

body.eso-login-custom .unemat-help-item .help-desc,
body.unematlogin-login-custom .unemat-help-item .help-desc {
  color: #475569 !important;
  font-weight: 500 !important;
}

body.eso-login-custom .unemat-help-item a,
body.unematlogin-login-custom .unemat-help-item a {
  color: #2e7d32 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  transition: color .2s ease !important;
}

body.eso-login-custom .unemat-help-item a:hover,
body.unematlogin-login-custom .unemat-help-item a:hover {
  color: #1b5e20 !important;
}

/* ── Painel Direito: Ilustração e Marcas (50%) ───────────── */
body.eso-login-custom .illus-panel,
body.unematlogin-login-custom .illus-panel {
  flex: 1;
  background-color: #ffffff !important;
  border-left: 1px solid var(--unemat-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

/* Grid de Pontos Decorativos */
body.eso-login-custom .illus-panel::before,
body.unematlogin-login-custom .illus-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(26,46,74,.08) 1.2px, transparent 1.2px);
  background-size: 32px 32px;
  pointer-events: none;
}

body.eso-login-custom .illus-panel::after,
body.unematlogin-login-custom .illus-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 50% at 60% 15%, rgba(76,175,110,.07) 0%, transparent 65%);
  pointer-events: none;
}

body.eso-login-custom .logo-wrap,
body.unematlogin-login-custom .logo-wrap {
  position: relative;
  z-index: 1;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

body.eso-login-custom .logo-wrap img,
body.unematlogin-login-custom .logo-wrap img {
  max-height: 66px;
  max-width: 95%;
  object-fit: contain;
}

body.eso-login-custom .illus-img,
body.unematlogin-login-custom .illus-img {
  position: relative;
  z-index: 1;
  height: 370px;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  margin: auto 0;
  mix-blend-mode: multiply;
  animation: unemat-float 4s ease-in-out infinite;
}

body.eso-login-custom .tiu-wrap,
body.unematlogin-login-custom .tiu-wrap {
  position: relative;
  z-index: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

body.eso-login-custom .tiu-wrap img,
body.unematlogin-login-custom .tiu-wrap img {
  max-height: 48px;
  max-width: 85%;
  object-fit: contain;
  opacity: .9;
}

/* ── Animações ─────────────────────────────────────────────── */
@keyframes unemat-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes unemat-spin {
  to { transform: rotate(360deg); }
}

@keyframes unemat-slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsividade Mobile ───────────────────────────────── */
@media (max-width: 820px) {
  body.eso-login-custom .container-tight,
  body.unematlogin-login-custom .container-tight {
    flex-direction: column;
    max-width: 440px;
    height: auto;
    margin: 0 auto;
  }
  body.eso-login-custom .illus-panel,
  body.unematlogin-login-custom .illus-panel {
    display: none !important;
  }
  body.eso-login-custom .form-panel,
  body.unematlogin-login-custom .form-panel {
    padding: 36px 28px;
    height: auto;
  }
}

@media (max-width: 480px) {
  body.eso-login-custom .form-panel,
  body.unematlogin-login-custom .form-panel {
    padding: 28px 20px;
  }
  body.eso-login-custom .card-header h2.mx-auto,
  body.unematlogin-login-custom .card-header h2.mx-auto {
    font-size: 1.15rem;
  }
}
