/* ==========================================
   ADJ Auth — Login Modal Styles
   ========================================== */

/* ====== Overlay ====== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.auth-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ====== Modal ====== */
.auth-modal {
  position: relative;
  width: 420px;
  max-width: 94vw;
  background: #12121A;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(139,92,246,0.1),
    0 24px 80px rgba(0,0,0,0.6),
    0 0 120px rgba(139,92,246,0.08);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.auth-overlay.is-open .auth-modal {
  transform: translateY(0) scale(1);
}

/* ====== Header glow bar ====== */
.auth-modal::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg,
    #8B5CF6 0%,
    #06B6D4 40%,
    #f09e47 70%,
    #EC4899 100%
  );
}

/* ====== Close button ====== */
.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5A5A6E;
  font-size: 18px;
  transition: all 0.2s;
  z-index: 2;
  background: transparent;
  border: none;
  cursor: pointer;
}
.auth-modal__close:hover {
  color: #F5F5F7;
  background: rgba(255,255,255,0.06);
}

/* ====== Inner content ====== */
.auth-modal__inner {
  padding: 36px 32px 32px;
}

/* ====== Logo area ====== */
.auth-modal__logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-modal__logo img {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  opacity: 0.9;
}
.auth-modal__brand {
  font-family: 'Space Grotesk Variable', 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #F5F5F7;
  margin-top: 10px;
}
.auth-modal__subtitle {
  font-size: 12px;
  color: #5A5A6E;
  margin-top: 4px;
}

/* ====== Steps ====== */
.auth-step {
  display: none;
}
.auth-step.is-active {
  display: block;
}

.auth-step__title {
  font-size: 15px;
  font-weight: 600;
  color: #F5F5F7;
  margin-bottom: 6px;
  text-align: center;
}
.auth-step__desc {
  font-size: 12px;
  color: #5A5A6E;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ====== Inputs ====== */
.auth-input-group {
  margin-bottom: 16px;
}
.auth-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #8A8A99;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: #1A1A24;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #F5F5F7;
  font-size: 15px;
  font-family: 'JetBrains Mono Variable', monospace;
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
}
.auth-input:focus {
  border-color: rgba(139,92,246,0.5);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.auth-input::placeholder {
  color: #3A3A4E;
  font-family: inherit;
}
.auth-input.is-error {
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.auth-input.is-success {
  border-color: rgba(16,185,129,0.5);
}

/* Code input — larger */
.auth-input--code {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 16px;
  padding-left: 20px;
  font-family: 'JetBrains Mono Variable', monospace;
}

/* ====== Buttons ====== */
.auth-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.auth-btn--primary {
  background: linear-gradient(135deg, #8B5CF6, #06B6D4);
  color: #fff;
}
.auth-btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(139,92,246,0.3);
}
.auth-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}
.auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.auth-btn--ghost {
  background: transparent;
  color: #8A8A99;
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-btn--ghost:hover {
  color: #F5F5F7;
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

/* Resend button */
.auth-resend {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: #5A5A6E;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px;
  transition: color 0.2s;
}
.auth-resend:hover:not(:disabled) {
  color: var(--cyan, #06B6D4);
}
.auth-resend:disabled {
  text-decoration: none;
  cursor: not-allowed;
  color: #3A3A4E;
}

/* ====== Messages ====== */
.auth-msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  display: none;
  text-align: center;
}
.auth-msg.is-visible {
  display: block;
}
.auth-msg--error {
  background: rgba(239,68,68,0.1);
  color: #EF4444;
  border: 1px solid rgba(239,68,68,0.15);
}
.auth-msg--success {
  background: rgba(16,185,129,0.1);
  color: #10B981;
  border: 1px solid rgba(16,185,129,0.15);
}
.auth-msg--info {
  background: rgba(6,182,212,0.1);
  color: #06B6D4;
  border: 1px solid rgba(6,182,212,0.15);
}

/* ====== Spinner ====== */
.auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}
@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ====== Countdown text ====== */
.auth-countdown {
  font-family: 'JetBrains Mono Variable', monospace;
  font-feature-settings: 'tnum' 1;
}

/* ====== Nav login button ====== */
.nav__login {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim, #8A8A99);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition: all 0.25s;
  background: transparent;
  white-space: nowrap;
}
.nav__login:hover {
  color: #F5F5F7;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}
.nav__login svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav__login.is-logged-in {
  border-color: rgba(139,92,246,0.25);
  color: #F5F5F7;
  padding-left: 4px;
}
.nav__login-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.nav__login-email {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ====== Mobile ====== */
@media (max-width: 480px) {
  .auth-modal__inner {
    padding: 28px 20px 24px;
  }
  .auth-input--code {
    font-size: 24px;
    letter-spacing: 12px;
    padding-left: 16px;
  }
  .nav__login-email {
    max-width: 80px;
  }
  .nav__login {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* ====== Provider divider (future WeChat) ====== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #3A3A4E;
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.auth-divider[data-hidden] {
  display: none;
}

/* WeChat button placeholder */
.auth-btn--wechat {
  background: #07C160;
  color: #fff;
  display: none;
}
.auth-btn--wechat:hover:not(:disabled) {
  background: #06AD56;
  box-shadow: 0 6px 20px rgba(7,193,96,0.3);
}
