/* ==========================================================================
   ESTILS D'AUTENTICACIÓ I LOGIN (INS PERE BORRELL)
   ========================================================================== */

/* WIDGET D'AUTENTICACIÓ A LA NAVBAR */
.auth-nav-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  position: relative;
}

.auth-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary, #0284c7);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  cursor: pointer;
}
.auth-btn-login:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.auth-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.auth-user-badge:hover {
  border-color: var(--primary, #0284c7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.auth-user-role-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.auth-role-teacher {
  background: #fef3c7;
  color: #92400e;
}
.auth-role-student {
  background: #e0f2fe;
  color: #0369a1;
}
[data-theme="dark"] .auth-role-teacher {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
[data-theme="dark"] .auth-role-student {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* MENÚ DESPLEGABLE DE L'USUARI */
.auth-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.15);
  min-width: 240px;
  padding: 0.75rem;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  animation: authFadeIn 0.15s ease-out;
}
.auth-user-dropdown.show {
  display: flex;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-dropdown-header {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.8rem;
}
.auth-dropdown-name {
  font-weight: 800;
  color: var(--text-main, #0f172a);
  font-size: 0.88rem;
}
.auth-dropdown-id {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-dropdown-item:hover {
  background: var(--bg-main, #f1f5f9);
  color: var(--primary, #0284c7);
}
.auth-dropdown-item.logout {
  color: #dc2626;
}
.auth-dropdown-item.logout:hover {
  background: #fee2e2;
}
