/* ==========================================
   BOTÃO PREDEFINIDO & MENU (auth.css)
   ========================================== */

.user-auth-area {
  display: flex;
  align-items: center;
}

.user-menu-dropdown {
  position: relative;
  display: inline-block;
}

/* Botão em formato de pílula arredondada */
.user-menu-btn {
  background-color: transparent;
  color: #DC2626; /* Cor azul */
  border: 1px solid #DC2626;
  padding: 0.45rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.user-menu-btn:hover {
  background-color: rgba(220, 38, 38, 0.08);
}

/* Menu Suspenso (Dropdown) - Ponte invisível para o mouse não perder o hover */
.dropdown-content {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  right: 0;
  top: 100%; /* Colado logo abaixo do botão */
  padding-top: 6px; /* Espaço invisível que mantém a seleção ativa */
  min-width: 160px;
  z-index: 100;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  transition-delay: 0.1s; /* Evita que o menu suma muito rápido ao mover o mouse */
}

/* Efeito Hover mantendo o menu visível */
.user-menu-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s; /* Aparece instantaneamente ao passar o mouse */
}

/* Caixa interna estilizada do Menu */
.dropdown-inner {
  background-color: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.dropdown-item {
  color: var(--text-primary, #ffffff);
  padding: 0.7rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.dropdown-item.highlight {
  color: #DC2626;
  font-weight: 600;
}

.dropdown-item.logout {
  color: #ff5555;
}

.dropdown-item.logout:hover {
  background-color: rgba(255, 85, 85, 0.15);
}

/* ==========================================
   ALINHAMENTO DO HEADER & LUPA EXPANSÍVEL
   ========================================== */

/* Coluna Direita */
.header-right-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* Linha Superior: Lupa + Tema lado a lado */
.header-top-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.search-box-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Botão da Lupa transparente e arredondado */
.search-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color, #333);
  color: var(--text-primary, #fff);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.search-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color, #DC2626);
}

/* Caixa de Busca Expansível (Escondida por Padrão) */
.search-expandable {
  display: none; /* Mantém oculta até clicar */
  position: absolute;
  right: 0;
  top: 120%;
  width: 220px;
  z-index: 100;
}

/* Quando ativa, é exibida */
.search-expandable.active {
  display: block;
}

.search-expandable input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #333);
  background-color: var(--card-bg, #1a1a1a);
  color: var(--text-primary, #ffffff);
  font-size: 0.85rem;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.4);
  outline: none;
  box-sizing: border-box;
}

.search-expandable input:focus {
  border-color: var(--accent-color, #DC2626);
}

/* ==========================================
   PÁGINAS DE AUTENTICAÇÃO (LOGIN / CADASTRO)
   ========================================== */

body.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg-color, #121212);
  color: var(--text-primary, #ffffff);
  font-family: system-ui, -apple-system, sans-serif;
}

/* Cartão Centralizado */
.auth-card {
  background-color: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333333);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
  box-sizing: border-box;
}

.auth-card .logo {
  display: inline-block;
  font-size: 2rem;
  font-weight: 800;
  text-decoration: none;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.auth-card .logo span {
  color: var(--accent-color, #DC2626);
}

.auth-card h2 {
  font-size: 1.6rem;
  margin: 0 0 0.4rem 0;
}

.auth-subtitle {
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}

/* Campos do Formulário */
.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 1.2rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary, #ffffff);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #333333);
  background-color: #242424;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  border-color: #DC2626;
}

/* Botão Principal */
.auth-submit-btn {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: none;
  background-color: #DC2626;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.auth-submit-btn:hover {
  opacity: 0.9;
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

/* Rodapé */
.auth-footer-text {
  font-size: 0.85rem;
  color: var(--text-secondary, #a0a0a0);
  margin-top: 1.5rem;
}

.auth-footer-text a {
  color: #DC2626;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

/* Divisor Visual (ou) */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.2rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color, #333333);
}

.auth-divider span {
  padding: 0 0.8rem;
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.8rem;
  text-transform: lowercase;
}

/* Botão do Google */
.google-auth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #333333);
  background-color: #242424;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.google-auth-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-secondary, #a0a0a0);
}

/* ==========================================
   AJUSTES RESPONSIVOS PARA MOBILE (CELULAR)
   ========================================== */

@media (max-width: 768px) {
  .header-right-column {
    gap: 0.4rem;
  }

  .user-menu-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
  }

  .search-expandable {
    width: 180px;
    right: -10px;
  }

  body.auth-page {
    padding: 1.2rem;
  }

  .auth-card {
    padding: 1.8rem 1.2rem;
    max-width: 100%;
    border-radius: 12px;
  }

  .auth-card h2 {
    font-size: 1.35rem;
  }

  .form-group input {
    font-size: 0.9rem;
    padding: 0.65rem 0.8rem;
  }
}


/* ==================================================
   Nerd Reset: tela unica de entrar e criar conta
   Estilos restritos a .nr-auth-unified.
   ================================================== */
body.auth-page.nr-auth-unified {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 20px;
  box-sizing: border-box;
  background: #f5f6f8;
  color: #171923;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.nr-auth-unified *, .nr-auth-unified *::before, .nr-auth-unified *::after { box-sizing: border-box; }
.nr-auth-unified .nr-auth-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e1e3e8;
  border-radius: 14px;
  box-shadow: 0 16px 55px rgba(31, 35, 49, 0.055);
  overflow: hidden;
}
.nr-auth-unified .nr-auth-header {
  text-align: center;
  padding: 35px 32px 26px;
  border-bottom: 1px solid #eaebef;
}
.nr-auth-unified .nr-auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #171923;
  text-decoration: none;
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: 30px;
  letter-spacing: .6px;
  line-height: 1;
}
.nr-auth-unified .nr-auth-brand img { width: 44px; height: 44px; object-fit: contain; }
.nr-auth-unified .nr-auth-brand strong {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  padding: 7px 9px 5px;
  border-radius: 3px;
  font-weight: 400;
}
.nr-auth-unified .nr-auth-header p { margin: 13px 0 0; color: #656a76; font-size: 14px; }
.nr-auth-unified .nr-auth-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.nr-auth-unified .nr-auth-column { min-width: 0; padding: 40px 56px 44px; scroll-margin-top: 16px; }
.nr-auth-unified .nr-auth-column + .nr-auth-column { border-left: 1px solid #e6e8ed; }
.nr-auth-unified .nr-auth-column h1, .nr-auth-unified .nr-auth-column h2 {
  color: #191b23;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 8px;
}
.nr-auth-unified .nr-auth-description {
  color: #6c7280;
  font-size: 14px;
  min-height: 38px;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 20px;
}
.nr-auth-unified .nr-auth-google {
  background: #fff;
  color: #272c36;
  border: 1px solid #cfd2da;
  border-radius: 7px;
  min-height: 46px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
}
.nr-auth-unified .nr-auth-google:hover { background: #f7f8fa; border-color: #a4a8b2; }
.nr-auth-unified .auth-divider { margin: 23px 0; }
.nr-auth-unified .auth-divider::before, .nr-auth-unified .auth-divider::after { border-color: #e2e4e9; }
.nr-auth-unified .auth-divider span { color: #858a95; font-size: 12px; text-transform: none; white-space: nowrap; }
.nr-auth-unified .form-group { margin-bottom: 17px; }
.nr-auth-unified .form-group label { color: #343a46; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.nr-auth-unified .form-group input {
  background: #f8f8fa;
  border: 1px solid #d9dce3;
  color: #1d2029;
  border-radius: 7px;
  min-height: 46px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14px;
}
.nr-auth-unified .form-group input::placeholder { color: #959aa5; }
.nr-auth-unified .form-group input:focus {
  outline: 3px solid rgba(220,38,38,.12);
  border-color: #dc2626;
}
.nr-auth-unified .nr-auth-assist { text-align: right; margin: -2px 0 11px; }
.nr-auth-unified .nr-auth-text-link { background: none; border: 0; padding: 2px 0; color: #c51c1c; text-decoration: underline; cursor: pointer; font: 600 12px 'Inter',sans-serif; }
.nr-auth-unified .nr-auth-text-link:hover { color: #9c1313; }
.nr-auth-unified .auth-submit-btn {
  min-height: 47px;
  margin-top: 5px;
  background: #dc2626;
  color: #fff;
  border-radius: 7px;
  font: 700 14px 'Inter', sans-serif;
}
.nr-auth-unified .auth-submit-btn:hover { background: #bd2020; opacity: 1; }
.nr-auth-unified .auth-submit-btn:disabled { opacity: .6; cursor: wait; }
.nr-auth-unified .nr-auth-mobile-link { display: none; }
.nr-auth-unified .nr-auth-footer { border-top: 1px solid #eaebef; text-align: center; padding: 18px 20px; }
.nr-auth-unified .nr-auth-footer a { color: #636a77; font-size: 13px; text-decoration: underline; }
.nr-auth-unified a:focus-visible, .nr-auth-unified button:focus-visible { outline: 3px solid rgba(220,38,38,.4); outline-offset: 3px; }

/* Apenas o link Iniciar Sessao do menu de usuarios deslogados. */
.nr-session-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 142px;
  border: 1.5px solid #dc2626;
  border-radius: 8px;
  padding: 10px 16px;
  color: #dc2626;
  background: transparent;
  text-align: center;
  font-weight: 700;
  transition: background-color .2s, border-color .2s;
}
.nr-session-menu-link:hover, .nr-session-menu-link:focus-visible {
  background: rgba(220,38,38,.09);
  border-color: #b91c1c;
  color: #b91c1c;
}

@media (max-width: 800px) {
  body.auth-page.nr-auth-unified { padding: 16px; }
  .nr-auth-unified .nr-auth-header { padding: 25px 20px 21px; }
  .nr-auth-unified .nr-auth-columns { grid-template-columns: 1fr; }
  .nr-auth-unified .nr-auth-column { padding: 30px 28px 34px; }
  .nr-auth-unified .nr-auth-column + .nr-auth-column { border-left: 0; border-top: 1px solid #e6e8ed; }
  .nr-auth-unified .nr-auth-description { min-height: 0; }
  .nr-auth-unified .nr-auth-mobile-link { display: block; font-size: 13px; text-align: center; margin: 22px 0 0; color: #6c7280; }
  .nr-auth-unified .nr-auth-mobile-link a { color: #dc2626; font-weight: 700; }
}
@media (max-width: 480px) {
  .nr-auth-unified .nr-auth-brand { font-size: 25px; }
  .nr-auth-unified .nr-auth-brand img { width: 37px; height: 37px; }
  .nr-auth-unified .nr-auth-column { padding: 28px 20px 30px; }
  .nr-auth-unified .nr-auth-column h1, .nr-auth-unified .nr-auth-column h2 { font-size: 23px; }
  .nr-auth-unified .auth-divider span { white-space: normal; }
}
