/* ══════════════════════════════════════════════════════════════
   AKRALABS COSMIC AUTHENTICATION & ACCOUNT UI SYSTEM
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Navbar Account Button ── */
.hud-account-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hud-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  height: auto;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-dim, #94aab2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 4px 10px;
  box-sizing: border-box;
  position: relative;
}

.user-xp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 88px;
}
.user-xp-top {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  width: 100%;
}
.user-xp-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-lvl-pill {
  font-size: 9px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #03080e;
  background: #00e5ff;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.user-xp-bar-track {
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  overflow: hidden;
}
.user-xp-bar-progress {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #38bdf8);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

/* ── Level Progress Dropdown Card ── */
.level-progress-card {
  padding: 14px 16px;
  background: rgba(7, 14, 24, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px 12px 0 0;
}
.lp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.lp-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-display, 'Manrope', sans-serif);
}
.lp-xp-count {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan, #00e5ff);
}
.lp-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.lp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #60a5fa);
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.lp-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 12px;
}
.lp-meta-row b {
  color: #f1f5f9;
}
.lp-earn-header {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lp-earn-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lp-earn-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #cbd5e1;
}
.lp-earn-xp {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #10b981;
}


.hud-account-btn:hover {
  border-color: rgba(0, 229, 255, 0.45);
  color: #ffffff;
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}

.hud-account-btn:active {
  transform: scale(0.96);
}

/* User initials avatar state */
.user-avatar-initials {
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #00e5ff 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.hud-account-btn.logged-in {
  border-color: rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.06);
}

/* Active indicator pulse */
.account-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #040911;
  box-shadow: 0 0 6px #10b981;
}

/* ── 2. Account Dropdown Menu ── */
.hud-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 284px;
  max-width: calc(100vw - 24px);
  background: rgba(6, 12, 22, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 229, 255, 0.12);
  display: none;
  flex-direction: column;
  z-index: 1005;
  animation: hudMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-account-menu.show {
  display: flex;
}

@keyframes hudMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-menu-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.account-menu-name {
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-email {
  font-size: 11.5px;
  color: #7d9ba6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.account-menu-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan, #00e5ff);
  border: 1px solid rgba(0, 229, 255, 0.25);
  margin-top: 6px;
  text-transform: uppercase;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #c4d4dc;
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.account-menu-item:hover {
  background: rgba(0, 229, 255, 0.08);
  color: #ffffff;
}

.account-menu-item svg {
  opacity: 0.75;
  stroke: currentColor;
}

.account-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 5px 0;
}

.account-menu-signout {
  color: #f87171 !important;
}

.account-menu-signout:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}

/* ── 3. Auth Modal (Sign In / Sign Up) ── */
.akra-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.akra-auth-overlay.open {
  display: flex;
  animation: authOverlayFade 0.2s ease-out;
}

@keyframes authOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.akra-auth-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 620px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.25) transparent;
  background: rgba(5, 11, 20, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.24);
  border-radius: 20px;
  padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 255, 0.1);
  animation: authModalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.akra-auth-modal::-webkit-scrollbar {
  width: 4px;
}
.akra-auth-modal::-webkit-scrollbar-track {
  background: transparent;
}
.akra-auth-modal::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.25);
  border-radius: 4px;
}

@keyframes authModalSlide {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94aab2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.auth-header {
  text-align: center;
  margin-bottom: 16px;
}

.auth-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cyan, #00e5ff);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.auth-title {
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.auth-sub {
  font-size: 13px;
  color: #7d9ba6;
  margin-top: 4px;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 3px;
  margin-bottom: 22px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8da4b0;
  border-radius: 9999px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.auth-tab-btn.active {
  background: rgba(0, 229, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.12);
}

/* Form inputs */
.auth-form-group {
  margin-bottom: 12px;
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #b0c2cc;
  margin-bottom: 5px;
}

.auth-input {
  width: 100%;
  height: 40px;
  background: rgba(2, 6, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0 13px;
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.2);
}

.auth-btn-submit {
  width: 100%;
  height: 42px;
  background: linear-gradient(135deg, #00e5ff, #0099cc);
  color: #02080f;
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
  margin-top: 6px;
}

.auth-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.6);
  background: linear-gradient(135deg, #33ecff, #00b4d8);
}

.auth-footer-links {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #7d9ba6;
}

.auth-footer-links a {
  color: var(--cyan, #00e5ff);
  text-decoration: none;
  cursor: pointer;
}

.auth-footer-links a:hover {
  text-decoration: underline;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}

.auth-alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-alert.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Toast Notifications */
.akra-auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(4, 10, 18, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10001;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
