/* ===== AUTH — Sistema de Contas ===== */

/* ─── Botão de Login / Menu do Usuário ─── */

#authArea {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a2e;
  background: linear-gradient(180deg, #ffdb5c, #ffcb05);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  will-change: transform;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

/* ─── Avatar do Usuário ─── */

.auth-user {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}

.auth-user:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-username {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1d1d1f;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-arrow {
  font-size: 0.7rem;
  color: #5f838a;
  margin-left: 2px;
}

/* ─── Dropdown Menu ─── */

.auth-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.18s ease;
  z-index: 99;
}

.auth-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1d1d1f;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
  box-sizing: border-box;
  text-decoration: none;
}

.auth-dropdown-item:hover {
  background: rgba(255, 203, 5, 0.15);
}

.auth-dropdown-item.danger {
  color: #cc0000;
}

.auth-dropdown-item.danger:hover {
  background: rgba(204, 0, 0, 0.1);
}

.auth-dropdown-divider {
  height: 1px;
  margin: 4px 8px;
  background: rgba(26, 26, 46, 0.08);
}

/* ─── Overlay do dropdown ─── */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 98;
  display: none;
}

.auth-overlay.active {
  display: block;
}

/* ─── Página de Perfil ─── */

#profileContainer {
  width: min(460px, calc(100vw - 40px));
  margin: 28px auto 0;
  padding: 28px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  text-align: center;
}

#profileContainer:empty { display: none; }

#profileContainer .profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

#profileContainer h2 {
  margin: 0 0 4px;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: #1d1d1f;
}

#profileContainer .profile-tag {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: #5f838a;
  font-weight: 700;
}

#profileContainer .profile-meta {
  text-align: left;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  margin-bottom: 16px;
}

#profileContainer .profile-meta p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: #3a3a4a;
}

#profileContainer .profile-meta strong {
  color: #1d1d1f;
}

#profileContainer .profile-placeholder {
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px dashed rgba(26, 26, 46, 0.15);
  color: #5f838a;
  font-size: 0.9rem;
}

/* ─── Responsivo ─── */

@media (max-width: 640px) {
  #authArea {
    top: 14px;
    right: 14px;
  }

  .auth-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .auth-user {
    padding: 4px 10px 4px 4px;
  }

  .auth-avatar {
    width: 26px;
    height: 26px;
  }

  .auth-username {
    max-width: 80px;
    font-size: 0.78rem;
  }

  .auth-dropdown {
    min-width: 160px;
  }

  #profileContainer {
    padding: 24px 18px;
  }
}
