.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-overlay.visible {
  display: flex;
}

/* 彌散漸變背景：多層 radial gradient 緩慢位移 */
.auth-overlay-bg {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 80% 70% at 20% 30%, rgba(120, 80, 200, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(60, 120, 220, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 70% 80% at 60% 70%, rgba(100, 60, 180, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 10% 80%, rgba(80, 140, 240, 0.2) 0%, transparent 45%);
  filter: blur(60px);
  animation: auth-bg-drift 18s ease-in-out infinite;
}

@keyframes auth-bg-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(2%, -1%) scale(1.02); }
  50% { transform: translate(-1%, 2%) scale(0.98); }
  75% { transform: translate(1%, 1%) scale(1.01); }
}

.auth-overlay-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(18, 22, 40, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 360px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  padding: 20px;
  color: #152242;
}

.auth-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#authForm input {
  border: 1px solid #d0d9ea;
  border-radius: 8px;
  background: #f4f7fc;
  padding: 10px 12px;
  font-size: 14px;
}

#authForm button {
  border: 0;
  border-radius: 8px;
  background: #152242;
  color: #fff;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
}

#authForm button:hover {
  background: #1e3360;
}

#authForm button.auth-guest-btn {
  background: transparent;
  color: #5f7198;
  font-weight: 500;
  margin-top: 4px;
}

#authForm button.auth-guest-btn:hover {
  background: #f4f7fc;
  color: #152242;
}

#authMessage {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 13px;
  min-height: 0;
  line-height: 1.4;
}
#authMessage:not(:empty) {
  margin-top: 10px;
  min-height: 1.4em;
}

#authMessage.error {
  color: #c0392b;
}

#authMessage.success {
  color: #1f8a5b;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #152242;
}

.auth-remember-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}
