/**
 * 登录模态框样式
 * 支持邮箱验证码登录、MetaMask、Google、WalletConnect 登录
 */

/* 模态框遮罩 */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.auth-modal-overlay.active {
  display: flex;
}

/* 模态框内容 */
.auth-modal-content {
  background: var(--bg-primary);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 模态框头部 */
.auth-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 8px 0 0;
}

.auth-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.auth-modal-close:hover {
  color: var(--text-primary);
}

/* 模态框主体 */
.auth-modal-body {
  padding: 24px;
}

/* 邮箱验证码登录表单 */
.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.auth-form-input::placeholder {
  color: var(--text-tertiary);
}

/* 验证码输入区域 */
.auth-code-input-group {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.auth-code-input {
  flex: 1;
}

.auth-send-code-btn {
  padding: 12px 20px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  min-width: 100px;
}

.auth-send-code-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.auth-send-code-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* 登录按钮 */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.auth-submit-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* 分割线 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider::before {
  margin-right: 12px;
}

.auth-divider::after {
  margin-left: 12px;
}

/* 登入方式切換標籤 */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.auth-tab i {
  font-size: 16px;
}

/* 表單容器 */
.auth-form-container {
  display: none;
}

.auth-form-container.active {
  display: block;
}

/* MetaMask/WalletConnect/Google 登入樣式 */
.wallet-login-info {
  text-align: center;
  padding: 32px 20px;
}

.wallet-login-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}

.wallet-login-icon.metamask {
  color: #f6851b;
}

.wallet-login-icon.walletconnect {
  color: #3b99fc;
}

.wallet-login-icon.google {
  color: #4285f4;
}

.wallet-login-info p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.wallet-login-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.wallet-login-btn.metamask {
  background: #f6851b;
}

.wallet-login-btn.metamask:hover {
  background: #e2761b;
}

.wallet-login-btn.walletconnect {
  background: #3b99fc;
}

.wallet-login-btn.walletconnect:hover {
  background: #2a89eb;
}

.wallet-login-btn i {
  font-size: 20px;
}

/* Google 登入按鈕容器 */
#googleSignInButton {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* OAuth 登录按钮（旧版，保留兼容） */
.auth-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-oauth-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-oauth-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: var(--bg-tertiary);
}

.auth-oauth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-oauth-btn i {
  font-size: 18px;
}

.auth-oauth-btn.metamask {
  color: #f6851b;
}

.auth-oauth-btn.google {
  color: #4285f4;
}

/* 游客浏览按钮 */
.auth-guest-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.auth-guest-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* 错误提示 */
.auth-error-message {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.auth-error-message.show {
  display: block;
}

/* 加载状态 */
.auth-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* 动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式 */
@media (max-width: 480px) {
  .auth-modal-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }

  .auth-modal-body {
    padding: 20px;
  }

  .auth-code-input-group {
    flex-direction: column;
  }

  .auth-send-code-btn {
    width: 100%;
  }
}

