/* =====================================================
   LOGIN MODAL  Alpha UltraPress
   Overlay + Card + Animaes
   ===================================================== */

/* -- Overlay --------------------------------------- */
.lm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 14, 20, 0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.lm-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* -- Card -------------------------------------------- */
.lm-card {
  position: relative;
  width: min(100%, 440px);
  border-radius: 22px;
  border: 1px solid rgba(227, 27, 35, 0.22);
  background: linear-gradient(158deg, rgba(255,255,255,0.96) 0%, rgba(248,249,251,0.90) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 28px 64px rgba(12, 16, 26, 0.22),
    0 2px 8px rgba(227, 27, 35, 0.06);
  padding: 36px 32px 28px;
  transform: scale(0.90) translateY(16px);
  transition: transform 0.34s cubic-bezier(0.34, 1.52, 0.64, 1);
}

.lm-overlay.is-open .lm-card {
  transform: scale(1) translateY(0);
}

/* Linha de topo decorativa */
.lm-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 27, 35, 0.42), transparent);
  pointer-events: none;
  border-radius: 0 0 1px 1px;
}

/* -- Boto fechar ----------------------------------- */
.lm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(14, 18, 28, 0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6775;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.lm-close:hover {
  background: rgba(227, 27, 35, 0.1);
  color: #e31b23;
  transform: rotate(90deg);
}

/* -- Brand / Logo ---------------------------------- */
.lm-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.lm-brand img {
  width: min(190px, 58vw);
  max-height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(227, 27, 35, 0.12));
}

/* -- Ttulo ---------------------------------------- */
.lm-title {
  margin: 0 0 22px;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: #1a1d24;
  letter-spacing: -0.022em;
  line-height: 1.15;
  font-family: 'Inter', 'Poppins', sans-serif;
}

/* -- Campos ---------------------------------------- */
.lm-field {
  margin-bottom: 14px;
}

.lm-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2a303a;
  font-family: 'Inter', sans-serif;
}

.lm-input-wrap {
  position: relative;
}

.lm-input-wrap .lm-ico {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #8c95a5;
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.22s;
}

.lm-input-wrap:focus-within .lm-ico {
  color: #e31b23;
}

.lm-input-wrap input {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  border: 1px solid rgba(39, 45, 57, 0.2);
  background: linear-gradient(145deg, #fff 0%, #f8f9fb 100%);
  color: #1a1d24;
  padding: 0 42px 0 42px;
  font-size: 0.94rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.18s;
  box-sizing: border-box;
}

.lm-input-wrap input::placeholder {
  color: #9aa0ab;
}

.lm-input-wrap input:focus {
  border-color: rgba(227, 27, 35, 0.85);
  box-shadow: 0 0 0 4px rgba(227, 27, 35, 0.12), 0 6px 18px rgba(227, 27, 35, 0.09);
  transform: translateY(-1px);
}

/* Toggle de exibir senha */
.lm-toggle-pw {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #8c95a5;
  cursor: pointer;
  padding: 4px;
  font-size: 0.88rem;
  line-height: 1;
  transition: color 0.18s;
}

.lm-toggle-pw:hover {
  color: #e31b23;
}

/* -- Mensagem de status ----------------------------- */
.lm-msg {
  min-height: 18px;
  margin: 8px 2px 2px;
  font-size: 0.83rem;
  color: #b11d24;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.lm-msg.ok {
  color: #1a7a38;
}

/* -- Boto principal Entrar ------------------------- */
.lm-btn-submit {
  width: 100%;
  margin-top: 8px;
  height: 52px;
  border: none;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.97rem;
  font-weight: 700;
  font-family: 'Inter', 'Poppins', sans-serif;
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(120deg, #8f1117 0%, #e31b23 56%, #ff3a43 100%);
  box-shadow: 0 12px 26px rgba(227, 27, 35, 0.28);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.lm-btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -135%;
  width: 60%;
  height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transition: left 0.44s ease;
}

.lm-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(227, 27, 35, 0.36);
  filter: brightness(1.05);
}

.lm-btn-submit:hover::before {
  left: 165%;
}

.lm-btn-submit:active {
  transform: translateY(0);
}

.lm-btn-submit.is-loading {
  pointer-events: none;
  opacity: 0.88;
}

.lm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.38);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: lm-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.lm-btn-submit.is-loading .lm-spinner {
  display: inline-block;
}

/* -- Divisor --------------------------------------- */
.lm-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: #9aa0ab;
  font-size: 0.76rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lm-divider::before,
.lm-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(39, 45, 57, 0.12);
}

/* -- Boto Google ----------------------------------- */
.lm-btn-google {
  width: 100%;
  height: 48px;
  border: 1.5px solid rgba(39, 45, 57, 0.16);
  border-radius: 13px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: #303540;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
}

.lm-btn-google:hover {
  border-color: rgba(227, 27, 35, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.lm-btn-google svg {
  flex-shrink: 0;
}

/* -- Responsivo ------------------------------------ */
@media (max-width: 560px) {
  .lm-card {
    padding: 28px 18px 22px;
    border-radius: 18px;
  }
  .lm-title {
    font-size: 1.3rem;
  }
}

/* -- Animaes ------------------------------------- */
@keyframes lm-spin {
  to { transform: rotate(360deg); }
}

body.login-modal-open {
  overflow: hidden;
}

.lm-head {
  text-align: center;
  margin-bottom: 22px;
}

.lm-kicker {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e31b23;
}

.lm-head .lm-title {
  margin-bottom: 0;
}

.lm-subtitle {
  margin: 9px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5f6775;
}

.lm-note {
  margin: 14px 0 0;
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
  color: #8b93a2;
}

@media (max-width: 560px) {
  .lm-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .lm-card {
    width: 100%;
    transform: translateY(22px);
  }

  .lm-overlay.is-open .lm-card {
    transform: translateY(0);
  }

  .lm-subtitle {
    font-size: 0.88rem;
  }
}

/* ------------------------------------------------------
   NAV  Menu do usu?rio logado
   Aparece n?o .nav-right quando h sesso ativa
------------------------------------------------------ */

/* Container dos elementos ps-login - oculto por padrão */
.nav-user-menu {
  display: none;
  align-items: center;
  gap: 8px;
}
/* Aparece apenas quando o JS adiciona .is-visible */
.nav-user-menu.is-visible {
  display: flex;
}

/* Saudação "Olá, Nome" */
.nav-user-greeting {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  order: 1;
}

.nav-user-greeting i {
  font-size: 1rem;
  opacity: 0.75;
}

.nav-user-greeting strong {
  font-weight: 600;
  color: #fff;
}

/* Botão "Painel Admin" - oculto por padrão */
.nav-admin-btn {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #8f1117, #e31b23);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.18s, transform 0.15s;
  box-shadow: 0 2px 10px rgba(227, 27, 35, 0.35);
  font-family: 'Inter', 'Poppins', sans-serif;
  text-decoration: none;
  order: 2;
}
/* Aparece apenas para admin logado */
.nav-admin-btn.is-visible {
  display: inline-flex;
}

.nav-admin-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.nav-admin-btn i {
  font-size: 0.82rem;
}

.nav-student-btn {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #1a1a1c 0%, #0a0a0a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  font-family: 'Inter', 'Poppins', sans-serif;
  text-decoration: none;
  order: 2;
}

.nav-student-btn.is-visible {
  display: inline-flex;
}

.nav-student-btn:hover {
  background: linear-gradient(180deg, #2b2f36 0%, #16181d 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
}

.nav-student-btn i {
  font-size: 0.82rem;
  color: #d1d5db;
}

/* Boto "Sair" */
.nav-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  order: 3;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Inter', 'Poppins', sans-serif;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav-logout-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}

.nav-logout-btn i {
  font-size: 0.82rem;
}

/* Tab mobile: indicador de estado logado */
.tab-is-user i,
.tab-is-admin i {
  color: #e31b23;
}

/* Responsivo: compacta o menu em telas menores */
@media (max-width: 860px) {
  .nav-user-greeting {
    display: none; /* oculta a saudação e mantém os ícones */
  }
}
