/* ================================================
   客联智汇 - 登录页样式
   ================================================ */

:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --danger: #ea4335;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --font: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0d1b2a;
  overflow: hidden;
  position: relative;
}

/* 背景动态效果 */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2d45 40%, #0d2137 70%, #0a1628 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,115,232,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,115,232,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}

.bg-glow-1 {
  width: 400px; height: 400px;
  background: rgba(26,115,232,0.12);
  top: -100px; left: -100px;
  animation-delay: 0s;
}

.bg-glow-2 {
  width: 300px; height: 300px;
  background: rgba(0,150,200,0.08);
  bottom: -80px; right: 100px;
  animation-delay: 3s;
}

.bg-glow-3 {
  width: 200px; height: 200px;
  background: rgba(26,115,232,0.06);
  top: 40%; left: 60%;
  animation-delay: 5s;
}

/* 浮动粒子 */
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: rgba(26,115,232,0.5);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.1); }
}

/* 主容器 */
.login-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* 登录卡片 */
.login-card {
  width: 100%;
  max-width: 440px;
  animation: cardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo区域 */
.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.brand-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #3b9eff);
  border-radius: 18px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(26,115,232,0.4);
}

.brand-icon svg { width: 34px; height: 34px; fill: #fff; }

.brand-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

/* 表单容器 */
.login-form-box {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 36px 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-tabs {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.tab-btn:hover:not(.active) { color: rgba(255,255,255,0.75); }

.form-section { display: none; }
.form-section.active { display: block; }

.form-heading {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}

/* 输入框 */
.input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.3);
}

.input-icon svg { width: 18px; height: 18px; }

.login-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.login-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
  outline: none;
}

.login-input::placeholder { color: rgba(255,255,255,0.3); }

/* select 下拉选项强制深色背景白色文字，防止原生渲染白底看不清 */
.login-input option,
select.login-input option {
  background: #1a2d45;
  color: #e8edf2;
  padding: 8px 12px;
}

select.login-input {
  padding-left: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='rgba(255,255,255,0.5)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* 激活码输入框（仅用于激活tab） */
.activate-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-family: 'Consolas', monospace;
  letter-spacing: 3px;
  text-align: center;
  transition: all 0.2s;
}

.activate-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
  outline: none;
}

.activate-input::placeholder { letter-spacing: 1px; font-family: inherit; font-size: 13px; }

/* 登录按钮 */
.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), #3b9eff);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(26,115,232,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover {
  box-shadow: 0 8px 24px rgba(26,115,232,0.5);
  transform: translateY(-1px);
}

.login-btn:active { transform: translateY(0); }

.login-btn .btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.login-btn.loading .btn-spinner { display: block; }
.login-btn.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* 消息提示 */
.alert {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-error { background: rgba(234,67,53,0.15); border: 1px solid rgba(234,67,53,0.3); color: #ff8080; }
.alert-success { background: rgba(52,168,83,0.15); border: 1px solid rgba(52,168,83,0.3); color: #6fcf97; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 底部提示 */
.login-note {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

/* 版权 footer */
.login-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 20px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-text {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  line-height: 1.9;
}

.footer-text a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-text a:hover { color: rgba(255,255,255,0.65); }

.footer-divider { margin: 0 8px; color: rgba(255,255,255,0.15); }

@media (max-width: 480px) {
  .login-form-box { padding: 28px 20px 24px; }
}
