/* ==========================================================================
   MINI HOST — SISTEMA DE AUTENTICAÇÃO GOOGLE & PERFIL
   Design Premium, Dark Mode, Glassmorphism & Micro-interações
   ========================================================================== */

/* PADRÃO DARK MODE NATIVO PARA FORMULÁRIOS & SELECTS */
:root {
  color-scheme: dark;
}

select {
  color-scheme: dark;
  background-color: #0d1527;
  color: #f1f5f9;
}

select option,
select optgroup {
  background-color: #0b0f19;
  color: #f1f5f9;
}

select option:checked,
select option:hover {
  background-color: #1e293b;
  color: #ffffff;
}

/* CHECKBOX PADRÃO MOMORIMO (GLOBAL) */
.momorimo-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: none;
  background-color: transparent !important;
  background-image: url('/icons/momorimo-checkbox-off.svg');
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.momorimo-checkbox:not(:checked) {
  animation: catPawNudge 3.2s ease-in-out infinite;
}

.momorimo-checkbox:not(:checked):hover {
  animation: catPawBounce 0.35s ease-in-out;
  filter: brightness(1.3) drop-shadow(0 0 6px rgba(16, 185, 129, 0.45));
  transform: scale(1.18);
}

.momorimo-checkbox:hover {
  filter: brightness(1.25);
  transform: scale(1.1);
}

.momorimo-checkbox:checked {
  background-image: url('/icons/momorimo-checkbox-on.svg');
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.45));
  animation: momorimoGlobalBounce 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.momorimo-checkbox:checked::after {
  content: none;
}

@keyframes momorimoGlobalBounce {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* PÁGINA AUTÔNOMA DE LOGIN (SERVER-SIDE GATEKEEPER) */
.auth-standalone-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.95), rgba(7, 10, 19, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
  position: relative;
  overflow-x: hidden;
}

.auth-standalone-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('/cat-bg.svg');
  background-size: 340px 340px;
  background-repeat: repeat;
  opacity: 0.75;
  animation: authCatDrift 110s linear infinite;
}

@keyframes authCatDrift {
  0% { background-position: 0 0; }
  100% { background-position: 320px 640px; }
}

.auth-page-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

/* 1. OVERLAY DE LOGIN BLOQUEANTE (FULLSCREEN) */
#miniHostAuthOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.95), rgba(7, 10, 19, 0.98));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 2. CARD CENTRAL DE LOGIN */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 50px -10px rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6), transparent);
}

/* ÍCONE DO GATINHO COM GLOW */
.auth-brand-badge {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.25);
}

.auth-cat-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  animation: authPulse 3s ease-in-out infinite;
}

@keyframes authPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.auth-title {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.auth-desc {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 0 26px;
}

/* CONTAINER DO BOTÃO DO GOOGLE */
.auth-google-wrapper {
  display: flex;
  justify-content: center;
  min-height: 46px;
  margin-bottom: 20px;
}

/* CAIXA DE ERRO / ALERTA */
.auth-error-box {
  display: none;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: left;
  animation: authFadeIn 0.2s ease-out forwards;
}

.auth-error-box.visible {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-error-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #ef4444;
  margin-top: 1px;
}

.auth-footer-note {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 16px;
}

/* 3. PADRONIZAÇÃO GLOBAL DE CABEÇALHOS (DISCRETO & MOBILE-FRIENDLY)
   O cabeçalho não deve roubar a atenção do conteúdo principal; é sutil, compacto e ultra responsivo. */
.app-header,
.hub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  padding: 6px 0 12px !important;
  margin-bottom: 4px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  min-height: 44px !important;
}

/* LADO ESQUERDO: MARCA / IDENTIDADE */
.header-left,
.header-brand {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex-shrink: 1 !important;
}

.brand-icon,
.brand-cat-img,
.app-header-cat,
.brand-icon-box {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  object-fit: contain !important;
}

.brand-icon-box {
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.header-left h1,
.header-brand h1,
.app-header h1,
.hub-header h1 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 0 !important;
  padding: 0 !important;
  letter-spacing: -0.01em !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
}

.brand-sub {
  display: none !important; /* Esconde subtítulo longo no cabeçalho para foco no conteúdo */
}

.project-badge,
.status-badge {
  font-size: 0.68rem !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  max-width: 125px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

/* LADO DIREITO: AÇÕES & USUÁRIO */
.header-right,
.header-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

/* BOTÕES DE CABEÇALHO PADRONIZADOS (Elegantes e sem destaque excessivo) */
.header-btn,
.btn-action,
.notify-trigger-btn,
.btn-notify-hub,
.action-icon-btn {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 9999px !important;
  color: #cbd5e1 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.header-btn:hover,
.btn-action:hover,
.notify-trigger-btn:hover,
.btn-notify-hub:hover,
.action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-1px) !important;
}

.header-btn:active,
.btn-action:active,
.notify-trigger-btn:active,
.btn-notify-hub:active,
.action-icon-btn:active {
  transform: scale(0.96) !important;
}

.header-btn svg,
.btn-action svg,
.notify-trigger-btn svg,
.btn-notify-hub svg,
.action-icon-btn svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
}

/* SELETOR DE PROJETO NO CABEÇALHO */
.select-project {
  height: 32px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0 8px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  outline: none !important;
  max-width: 135px !important;
  cursor: pointer !important;
  transition: border-color 0.2s ease !important;
  flex-shrink: 0 !important;
}

.select-project:hover,
.select-project:focus {
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* 4. BADGE DO USUÁRIO LOGADO NO CABEÇALHO */
.auth-user-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 32px !important;
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 999px !important;
  padding: 0 10px 0 5px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  user-select: none !important;
}

.auth-user-badge:hover {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
}

.auth-user-avatar {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  background: #1e293b !important;
  border: 1px solid #60a5fa !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  flex-shrink: 0 !important;
}

.auth-user-name {
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  color: #cbd5e1 !important;
  max-width: 80px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -0.01em !important;
}

.auth-logout-btn {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  margin-left: 1px !important;
  flex-shrink: 0 !important;
}

.auth-logout-btn:hover {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  transform: scale(1.08) !important;
}

.auth-logout-btn svg {
  width: 12px !important;
  height: 12px !important;
}

/* 5. RESPONSIVIDADE MOBILE IMPECÁVEL */
@media (max-width: 640px) {
  /* Em telas médias/pequenas, recolhe rótulos textuais dos botões para deixar apenas ícones elegantes */
  .header-btn-text,
  .btn-text-desktop,
  .btn-action span,
  .btn-notify-hub span,
  .notify-trigger-btn span {
    display: none !important;
  }

  .header-btn,
  .btn-action,
  .notify-trigger-btn,
  .btn-notify-hub,
  .action-icon-btn {
    width: 32px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .select-project {
    max-width: 105px !important;
    font-size: 0.70rem !important;
    padding: 0 4px !important;
  }
}

@media (max-width: 480px) {
  /* No smartphone, esconde o nome do usuário para caber tudo em 1 linha sem quebra */
  .auth-user-name {
    display: none !important;
  }

  .auth-user-badge {
    padding: 0 4px !important;
    gap: 4px !important;
  }

  .project-badge {
    display: none !important; /* Esconde badge secundário no mobile estreito para manter layout limpo */
  }

  .header-left h1,
  .header-brand h1,
  .app-header h1,
  .hub-header h1 {
    font-size: 0.98rem !important;
  }

  .header-right,
  .header-actions {
    gap: 4px !important;
  }

  .select-project {
    max-width: 85px !important;
  }
}

@media (max-width: 380px) {
  .header-right,
  .header-actions {
    gap: 3px !important;
  }

  .brand-icon,
  .brand-cat-img,
  .app-header-cat,
  .brand-icon-box {
    width: 22px !important;
    height: 22px !important;
  }
}

/* ==========================================================================
   MODO CLARO (AUTENTICAÇÃO & BADGE DE USUÁRIO NO CABEÇALHO)
   ========================================================================== */
[data-theme="light"] .auth-user-badge {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .auth-user-badge:hover {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.22) !important;
}

[data-theme="light"] .auth-user-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .auth-logout-btn {
  color: #64748b !important;
}

[data-theme="light"] .auth-logout-btn:hover {
  color: #ef4444 !important;
  background: #fee2e2 !important;
}

[data-theme="light"] .auth-dev-badge {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light"] .auth-dev-badge .auth-user-name {
  color: #0f172a !important;
}

[data-theme="light"] .auth-login-link {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

[data-theme="light"] .auth-login-link:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .select-project {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  color-scheme: light !important;
}

[data-theme="light"] .select-project:hover,
[data-theme="light"] .select-project:focus {
  border-color: var(--primary) !important;
}

