/* A股分析系统 - 登录页面样式 */
/* 商务专业风格 - 适合金融平台 */

:root {
  --bg-primary: #102a43;
  --bg-secondary: #081828;
  --card-bg-start: rgba(30, 41, 59, 0.95);
  --card-bg-end: rgba(15, 23, 42, 0.98);
  --border-color: rgba(148, 163, 184, 0.15);
  --border-highlight: rgba(148, 163, 184, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-hint: #64748b;
  --accent-primary: #3b82f6;
  --accent-secondary: #2563eb;
  --accent-dark: #1e40af;
  --accent-light: #60a5fa;
  --accent-lighter: #93c5fd;
  --success: #10b981;
  --danger: #ef4444;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  --bg-primary: #eef4fb;
  --bg-secondary: #dbe7f5;
  --card-bg-start: rgba(255, 255, 255, 0.96);
  --card-bg-end: rgba(244, 248, 253, 0.98);
  --border-color: rgba(148, 163, 184, 0.28);
  --border-highlight: rgba(59, 130, 246, 0.25);
  --text-primary: #172033;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-hint: #94a3b8;
  --accent-primary: #2563eb;
  --accent-secondary: #1d4ed8;
  --accent-dark: #1e3a8a;
  --accent-light: #2563eb;
  --accent-lighter: #60a5fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-system);
  background:
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%),
    url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.02)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  padding: 20px;
  position: relative;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%),
    url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(37,99,235,0.04)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-dark) 0%, var(--accent-primary) 50%, var(--accent-dark) 100%);
  z-index: 1000;
}

.page {
  width: 100%;
  max-width: 480px;
}

.theme-toggle-btn.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(148, 163, 184, 0.08));
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-system);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle-btn.login-theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.theme-toggle-btn.login-theme-toggle .theme-toggle-icon {
  font-size: 14px;
  line-height: 1;
}

/* 品牌区域 */
.brand {
  text-align: center;
  margin-bottom: 48px;
}

.brand-icon {
  font-size: 56px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3));
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* 认证卡片 */
.auth-card {
  background: linear-gradient(180deg, var(--card-bg-start) 0%, var(--card-bg-end) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

/* 重定向提示横幅 */
.redirect-banner {
  display: none;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
}

.redirect-banner.show {
  display: block;
}

.redirect-banner strong {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-light);
}

.redirect-banner p {
  margin: 0;
  color: color-mix(in srgb, var(--text-secondary) 88%, white 12%);
  font-size: 14px;
  line-height: 1.6;
}

/* 会话状态横幅 */
.session-banner {
  display: none;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
}

.session-banner.show {
  display: block;
}

.session-banner strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-light);
}

.session-banner p {
  margin: 0 0 14px 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.6;
}

.session-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  color: var(--accent-lighter);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-system);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* 标签页切换 */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.2) 100%);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab:hover:not(.active) {
  background: rgba(59, 130, 246, 0.1);
  color: #cbd5e1;
}

/* 表单组 */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.label-hint {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.3) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-system);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-control::placeholder {
  color: var(--text-hint);
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.25) 100%);
}

/* 注册字段 */
.register-fields {
  display: none;
}

.register-fields.show {
  display: block;
}

/* 表单提示 */
.form-hint {
  margin: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 4px 12px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
}

.submit-btn:hover {
  background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-dark) 100%);
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(59, 130, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 表单消息 */
.form-message {
  min-height: 24px;
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

/* 页脚 */
.footer {
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer::before,
.footer::after {
  content: '';
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
}

/* 响应式设计 */
@media (max-width: 560px) {
  .page {
    max-width: 100%;
  }

  .brand {
    margin-bottom: 32px;
  }

  .brand-icon {
    font-size: 48px;
  }

  .brand-title {
    font-size: 24px;
  }

  .auth-card {
    padding: 28px 24px;
    border-radius: 12px;
  }

  .session-actions {
    flex-direction: column;
  }

  .btn-secondary {
    width: 100%;
  }

  .footer {
    margin-top: 32px;
  }
}

@media (max-width: 400px) {
  body {
    padding: 16px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .form-control {
    padding: 12px 14px;
    font-size: 14px;
  }

  .submit-btn {
    padding: 14px;
    font-size: 15px;
  }
}
