/* ============================================
   AUTH.CSS - Trang đăng nhập / đăng ký
   ============================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* Background animated */
.auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,212,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(245,197,24,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(168,85,247,0.06) 0%, transparent 50%);
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Title */
.auth-title {
  text-align: center;
  line-height: 1;
}

.title-main {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(245,197,24,0.3));
}

.title-sub {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: clamp(1rem, 4vw, 1.8rem);
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 8px;
  margin-top: 4px;
}

/* Mobile tabs - chỉ hiện trên mobile */
.auth-tabs {
  display: none;
  background: var(--bg3);
  border-radius: 10px;
  padding: 4px;
  width: 100%;
  max-width: 400px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--bg2);
  color: var(--text-bright);
  box-shadow: var(--shadow);
}

/* Panels */
.auth-panels {
  width: 100%;
  display: flex;
  gap: 24px;
  justify-content: center;
}

.auth-panel {
  flex: 1;
  max-width: 380px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Top accent line */
.auth-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

#panel-register::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.auth-panel h2 {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 4px;
}

#panel-register h2 {
  color: var(--accent);
}

/* Forgot password */
.forgot-pw {
  text-align: right;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s;
  margin-top: -4px;
}
.forgot-pw:hover { color: var(--accent); }

/* Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 4px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: var(--bg2);
  padding: 0 10px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* OAuth buttons */
.btn-oauth {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
}
.btn-oauth:hover { border-color: var(--border2); background: var(--bg2); transform: translateY(-1px); }
.btn-oauth.google:hover { border-color: #4285f4; color: #4285f4; }
.btn-oauth.discord:hover { border-color: #7289da; color: #7289da; }

/* Turnstile */
#turnstile-container {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Error message */
.auth-error {
  color: var(--red);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px;
  background: rgba(255,68,85,0.1);
  border: 1px solid rgba(255,68,85,0.2);
  border-radius: 6px;
}

/* ===== MOBILE ===== */
@media (max-width: 767px) {
  .auth-tabs {
    display: flex;
  }

  .auth-panels {
    flex-direction: column;
    align-items: center;
  }

  /* Mobile: ẩn panel theo tab */
  .auth-panel {
    max-width: 100%;
  }

  .auth-panel.tab-hidden {
    display: none;
  }
}

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
  .auth-tabs {
    display: none;
  }

  .auth-panel.tab-hidden {
    display: flex !important;
  }
}