/* ========== 认证页面专用样式 ========== */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* 背景装饰 */
.auth-body::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-body::after {
  content: '';
  position: absolute;
  bottom: -300px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.auth-logo svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* 输入框带图标 */
.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-left: 40px;
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* 密码可见性切换 */
.input-wrap .toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: color 0.2s;
}

.input-wrap .toggle-pwd:hover {
  color: var(--text-secondary);
}

/* 验证码发送按钮（内嵌在 input 右侧） */
.send-code-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.send-code-btn:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
}

.send-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* 验证码 input 右侧留空给按钮 */
#codeForm .input-wrap input {
  padding-right: 110px;
}

/* 按钮 */
.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-grad);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 4px;
}

.auth-btn:hover {
  opacity: 0.9;
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 次要按钮 */
.auth-btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 错误/成功提示 */
.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  display: none;
  align-items: flex-start;
  gap: 8px;
}

.auth-alert.show {
  display: flex;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.auth-alert.info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

/* 链接行 */
.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-links a {
  color: var(--accent);
  transition: color 0.2s;
}

.auth-links a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* 分隔线 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 12px;
}

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

/* 返回首页 */
.auth-back {
  position: absolute;
  top: 24px;
  left: 24px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  z-index: 2;
}

.auth-back:hover {
  color: var(--accent);
}

/* 加载动画 */
.auth-btn .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* 响应式 */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
  }
  
  .auth-back {
    top: 16px;
    left: 16px;
  }
}
