/* ============================================================
   Firebase UI — AuthBar (sync indicator + sign-in button + user menu).
   Sits at the right of the nav in the app header.
   ============================================================ */

.auth-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  margin-left: 14px;
  font-family: var(--font-sans);
}

/* --- Sync indicator (dot + "X atrás") --- */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: help;
}
.sync-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .2s;
}
.sync-text { opacity: 0.85; }

/* --- Auth trigger (avatar + name) --- */
.auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 18, 32, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.auth-trigger:hover {
  border-color: var(--border-strong);
  color: #fff;
  background: rgba(20, 30, 48, 0.78);
}
.auth-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(91, 157, 255, 0.2);
}
.auth-avatar.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-2);
  background: linear-gradient(135deg, rgba(61, 126, 255, 0.25), rgba(31, 86, 212, 0.18));
  border: 1px solid rgba(91, 157, 255, 0.3);
  text-transform: uppercase;
}
.auth-avatar.fallback.anon {
  color: var(--text-3);
  background: rgba(154, 163, 184, 0.12);
  border-color: rgba(154, 163, 184, 0.25);
}
.auth-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-loading {
  font-size: 11px;
  color: var(--text-3);
  padding: 4px 10px;
}

/* --- Dropdown menu --- */
.auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: rgba(10, 16, 28, 0.96);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(91, 157, 255, 0.2);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 8px;
  z-index: 1000;
  font-size: 13px;
}
.auth-menu-hint {
  padding: 12px 12px 14px;
  color: var(--text-2);
  line-height: 1.45;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.auth-menu-info {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.auth-menu-name {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
  margin-bottom: 2px;
}
.auth-menu-email {
  color: var(--text-2);
  font-size: 11.5px;
}
.auth-menu-uid {
  color: var(--text-3);
  font-size: 10.5px;
  font-family: var(--font-mono);
  margin-top: 6px;
  letter-spacing: 0.03em;
}
.auth-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all .12s;
}
.auth-menu-item:hover {
  background: rgba(91, 157, 255, 0.08);
  border-color: rgba(91, 157, 255, 0.18);
}
.auth-menu-item.primary {
  background: linear-gradient(180deg, #ffffff 0%, #e6efff 100%);
  color: #0a1224;
  font-weight: 600;
  border-color: transparent;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(91, 157, 255, 0.25);
}
.auth-menu-item.primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 22px rgba(91, 157, 255, 0.45);
}
.auth-menu-item svg { flex-shrink: 0; }

/* --- Mobile --- */
@media (max-width: 768px) {
  .auth-bar { margin-left: 8px; gap: 8px; }
  .sync-text { display: none; }  /* keep just the dot to save space */
  .auth-name { max-width: 60px; font-size: 11px; }
  .auth-trigger { padding: 3px 9px 3px 3px; }
  .auth-avatar { width: 22px; height: 22px; }
  .auth-menu { right: -4px; min-width: 260px; font-size: 12.5px; }
}
