/* ── SHARED AUTH POPUP & PROFILE DROPDOWN ── */
:root {
  --auth-gold: #d4af37;
  --auth-gold-bright: #ffd700;
  --auth-gold-dim: #8b6914;
  --auth-deep: #050508;
  --auth-warm: rgba(255, 248, 220, 0.88);
}

/* ── AUTH OVERLAY ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.auth-overlay .auth-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(212,175,55,0.2);
  color: var(--auth-gold);
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  line-height: 1;
}
.auth-overlay .auth-close:hover {
  border-color: var(--auth-gold-bright);
  background: rgba(212,175,55,0.1);
}

.auth-card {
  width: 92vw;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0c0a14 0%, #08070e 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 8px;
  padding: 40px 36px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(212,175,55,0.05);
  animation: authModalIn 0.35s ease;
}
@keyframes authModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.auth-card::-webkit-scrollbar { width: 4px; }
.auth-card::-webkit-scrollbar-thumb { background: var(--auth-gold-dim); border-radius: 4px; }

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand .auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.3));
}
.auth-brand .auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--auth-gold);
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-brand .auth-tag {
  font-family: 'Orbitron', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(212,175,55,0.5);
}
.auth-brand .auth-desc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,248,220,0.5);
  line-height: 1.5;
  margin-top: 12px;
  padding: 12px;
  background: rgba(212,175,55,0.03);
  border: 1px solid rgba(212,175,55,0.08);
  border-radius: 4px;
}

.auth-field {
  margin-bottom: 14px;
}
.auth-field label {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(212,175,55,0.6);
  margin-bottom: 6px;
}
.auth-field .optional {
  font-size: 0.45rem;
  color: rgba(255,248,220,0.3);
  text-transform: none;
  letter-spacing: 0;
}
.auth-field input,
.auth-field textarea {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 3px;
  padding: 10px 13px;
  color: var(--auth-warm);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  transition: 0.3s;
  outline: none;
}
.auth-field input:focus,
.auth-field textarea:focus {
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 0 12px rgba(212,175,55,0.06);
}
.auth-field textarea { resize: vertical; min-height: 60px; }
.auth-field-row {
  display: flex;
  gap: 12px;
}
.auth-field-row .auth-field { flex: 1; }

.auth-avatar-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.auth-avatar-pick .auth-ph {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15,15,20,0.8);
  border: 1px solid rgba(212,175,55,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,248,220,0.3);
  font-size: 0.5rem;
  font-family: 'Orbitron', monospace;
  text-align: center;
  overflow: hidden;
  flex-shrink: 0;
}
.auth-avatar-pick .auth-ph img { width: 100%; height: 100%; object-fit: cover; }
.auth-avatar-pick .auth-upload-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--auth-gold);
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.15);
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 2px;
  transition: 0.3s;
}
.auth-avatar-pick .auth-upload-btn:hover {
  background: rgba(212,175,55,0.12);
  border-color: rgba(212,175,55,0.3);
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--auth-gold);
  flex-shrink: 0;
}
.auth-checkbox label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,248,220,0.5);
  line-height: 1.3;
}

.auth-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #000;
  background: linear-gradient(135deg, #d4af37, #ffd700 50%, #d4af37);
  background-size: 200% auto;
  padding: 13px 30px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: 0.4s;
  width: 100%;
  box-shadow: 0 0 20px rgba(212,175,55,0.2);
}
.auth-btn:hover {
  background-position: right center;
  box-shadow: 0 0 35px rgba(255,215,0,0.4);
  transform: translateY(-1px);
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,248,220,0.35);
}
.auth-switch span {
  color: var(--auth-gold);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}
.auth-switch span:hover {
  border-color: var(--auth-gold);
  color: var(--auth-gold-bright);
}

.auth-error {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  color: #e53935;
  text-align: center;
  margin-bottom: 12px;
  display: none;
}
.auth-error.show { display: block; }

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,248,220,0.3);
  cursor: pointer;
  transition: 0.3s;
  border-bottom: 2px solid transparent;
}
.auth-tab:hover { color: var(--auth-gold); }
.auth-tab.active {
  color: var(--auth-gold);
  border-bottom-color: var(--auth-gold);
}

/* ── PROFILE BADGE & DROPDOWN ── */
.profile-badge {
  position: relative;
  display: none;
  align-items: center;
}
.profile-badge.show { display: flex; }

.pb-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: 0.3s;
}
.pb-trigger:hover {
  border-color: rgba(212,175,55,0.2);
}
.pb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212,175,55,0.3);
  background: #0a0a12;
}
.pb-initials {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a24, #0a0a12);
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--auth-gold);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.pb-initials.show { display: flex; }
.pb-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,248,220,0.6);
  display: none;
}
.pb-name.show { display: block; }
@media (max-width: 1150px) {
  .pb-name { display: none !important; }
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: rgba(8,8,14,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 6px;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: 0.25s ease;
  z-index: 10001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.profile-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.profile-dropdown a {
  display: block;
  padding: 10px 18px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,248,220,0.5);
  text-decoration: none;
  transition: 0.2s;
  letter-spacing: 0.05em;
}
.profile-dropdown a:hover {
  color: var(--auth-gold-bright);
  background: rgba(212,175,55,0.04);
  padding-left: 22px;
}
.profile-dropdown .pd-divider {
  height: 1px;
  background: rgba(212,175,55,0.08);
  margin: 6px 14px;
}
.profile-dropdown .pd-logout {
  color: rgba(255,100,100,0.5);
}
.profile-dropdown .pd-logout:hover {
  color: #e53935;
  background: rgba(229,57,53,0.04);
}

/* ── SIGN IN LINK (shown when not authenticated) ── */
.auth-signin-link {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(212,175,55,0.5);
  text-decoration: none;
  cursor: pointer;
  transition: 0.3s;
  padding: 6px 10px;
  border: 1px solid rgba(212,175,55,0.1);
}
.auth-signin-link:hover {
  color: var(--auth-gold-bright);
  border-color: rgba(212,175,55,0.25);
}
