/* ===== AUTH SCREEN ===== */
#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .5s, transform .5s
}

#auth-screen.exit {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none
}

#auth-screen.hidden {
  display: none
}

/* Animated orbs */
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .5;
  pointer-events: none;
  animation: orbFloat 12s ease-in-out infinite
}

.auth-orb-1 {
  width: 500px;
  height: 500px;
  background: rgba(123, 47, 255, .25);
  top: -15%;
  left: -10%;
  animation-duration: 14s
}

.auth-orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(0, 212, 255, .2);
  bottom: -10%;
  right: -8%;
  animation-duration: 10s;
  animation-delay: -3s
}

.auth-orb-3 {
  width: 300px;
  height: 300px;
  background: rgba(123, 47, 255, .15);
  top: 50%;
  left: 60%;
  animation-duration: 16s;
  animation-delay: -7s
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  25% {
    transform: translate(30px, -40px) scale(1.05)
  }

  50% {
    transform: translate(-20px, 30px) scale(.95)
  }

  75% {
    transform: translate(40px, 20px) scale(1.02)
  }
}

/* Auth Container */
#auth-container {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  background: rgba(18, 18, 26, .85);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 80px rgba(123, 47, 255, .08)
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px
}

.auth-logo {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--text);
  -webkit-text-fill-color: var(--text)
}

.auth-logo .accent {
  color: var(--blue);
  -webkit-text-fill-color: var(--blue)
}

.auth-tagline {
  color: var(--text2);
  font-size: .85rem;
  letter-spacing: 1.5px;
  margin-top: 4px
}

/* Tabs */
#auth-tabs {
  display: flex;
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text2);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 9px;
  position: relative;
  z-index: 2;
  transition: color .3s
}

.auth-tab.active {
  color: var(--text)
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, rgba(0, 212, 255, .15), rgba(123, 47, 255, .15));
  border: 1px solid rgba(0, 212, 255, .2);
  border-radius: 9px;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  z-index: 1
}

.auth-tab-indicator.right {
  transform: translateX(100%)
}

/* Auth Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px
}

.auth-form.active {
  display: flex
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.auth-field label {
  font-size: .75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 500
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text2);
  pointer-events: none;
  transition: color .3s
}

.auth-input-wrap input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  outline: none;
  transition: border-color .3s, box-shadow .3s
}

.auth-input-wrap input::placeholder {
  color: rgba(136, 136, 160, .5)
}

.auth-input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(0, 212, 255, .1)
}

.auth-input-wrap input:focus~.auth-input-icon,
.auth-input-wrap input:focus+.auth-input-icon {
  color: var(--blue)
}

.auth-input-wrap:has(input:focus) .auth-input-icon {
  color: var(--blue)
}

/* Eye toggle */
.auth-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color .2s
}

.auth-eye-btn:hover {
  color: var(--text)
}

.auth-eye-btn svg {
  width: 18px;
  height: 18px
}

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  height: 16px
}

.strength-bars {
  display: flex;
  gap: 4px;
  flex: 1
}

.strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 3px;
  background: var(--glass-border);
  transition: background .3s
}

.strength-bar.weak {
  background: #ef4444
}

.strength-bar.medium {
  background: #facc15
}

.strength-bar.strong {
  background: #22c55e
}

.strength-label {
  font-size: .7rem;
  color: var(--text2);
  min-width: 50px;
  text-align: right
}

/* Extras */
.auth-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text2);
  cursor: pointer
}

.auth-remember input[type="checkbox"] {
  accent-color: var(--blue);
  cursor: pointer
}

.auth-forgot {
  font-size: .8rem;
  color: var(--blue);
  text-decoration: none;
  transition: opacity .2s
}

.auth-forgot:hover {
  opacity: .8
}

/* Submit */
.auth-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: box-shadow .3s, transform .2s;
  margin-top: 4px;
  position: relative;
  overflow: hidden
}

.auth-submit svg {
  width: 18px;
  height: 18px;
  transition: transform .3s
}

.auth-submit:hover {
  box-shadow: 0 6px 30px rgba(0, 212, 255, .35);
  transform: translateY(-1px)
}

.auth-submit:hover svg {
  transform: translateX(3px)
}

.auth-submit:active {
  transform: scale(.98)
}

.auth-submit.loading {
  pointer-events: none;
  opacity: .8
}

.auth-submit.loading span {
  opacity: 0
}

.auth-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Error msg */
.auth-error {
  font-size: .82rem;
  color: var(--rejected);
  text-align: center;
  min-height: 20px;
  transition: opacity .3s
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0 16px
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border)
}

.auth-divider span {
  font-size: .75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap
}

/* Social buttons */
.auth-social {
  display: flex;
  gap: 12px
}

.social-btn {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: border-color .3s, background .3s, transform .2s
}

.social-btn:hover {
  border-color: rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06);
  transform: translateY(-1px)
}

/* ===== USER MENU ===== */
.header-right-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap
}

#user-menu {
  position: relative
}

#user-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .3s, box-shadow .3s, transform .2s
}

#user-avatar-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(0, 212, 255, .2);
  transform: scale(1.05)
}

#user-initials {
  line-height: 1
}

#user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  z-index: 300;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s, transform .25s
}

#user-dropdown.dropdown-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none
}

.dropdown-user-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

#dropdown-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text)
}

#dropdown-email {
  font-size: .75rem;
  color: var(--text2)
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0
}

.dropdown-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text2);
  font-family: var(--font);
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  transition: background .2s, color .2s
}

.dropdown-item:hover {
  background: rgba(239, 68, 68, .1);
  color: var(--rejected)
}

.dropdown-item svg {
  width: 18px;
  height: 18px
}

/* Hidden utility */
.hidden {
  display: none !important
}

/* ===== BUILT BY CREDIT ===== */
.built-by{text-align:center;margin-top:22px;font-size:.78rem;color:var(--text2);letter-spacing:.5px;
  animation:fadeSlideUp .8s ease-out .3s both}
.built-by-icon{display:inline-block;margin-right:3px;animation:pulseIcon 2s ease-in-out infinite}
.built-by-name{font-weight:700;letter-spacing:1px;
  background:linear-gradient(90deg,var(--blue),var(--purple),#ff6ec7,var(--blue));
  background-size:300% 100%;-webkit-background-clip:text;-webkit-text-fill-color:transparent;
  background-clip:text;animation:shimmerName 4s linear infinite}

@keyframes fadeSlideUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulseIcon{0%,100%{transform:scale(1)}50%{transform:scale(1.25)}}
@keyframes shimmerName{0%{background-position:0% 50%}100%{background-position:300% 50%}}

/* App footer */
#app-footer{text-align:center;padding:20px 40px 32px;position:relative}
.app-built-by{margin-top:0;animation:fadeSlideUp .6s ease-out .5s both}

/* ===== RESPONSIVE AUTH ===== */
@media(max-width:500px) {
  #auth-container {
    margin: 16px;
    padding: 28px 22px;
    border-radius: 16px
  }

  .auth-logo {
    font-size: 2.2rem
  }
}