/* ==========================================================
 * 现代商务风格 - 认证页面（登录 / 注册 / 找回密码）
 * 设计令牌驱动，支持 admin 和 user 两套页面
 * ========================================================== */

:root {
  /* 色彩系统 */
  --brand-dark: #0f2544;
  --brand-deep: #1e3c72;
  --brand-mid: #2a5298;
  --brand-accent: #3b82f6;
  --brand-light: #60a5fa;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #3b82f6;

  --danger: #ef4444;
  --success: #10b981;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 4px rgba(59, 130, 246, 0.12);

  /* 字号 */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;
  --text-3xl: 32px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  background: #f1f5f9;
}
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px white inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

/* ========== 分栏布局 ========== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* 左侧品牌区 */
.auth-brand {
  position: relative;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-deep) 55%, var(--brand-mid) 100%);
  color: var(--text-inverse);
  padding: 56px clamp(32px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  top: -20%; right: -15%;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(96,165,250,0.28) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -18%; left: -12%;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(59,130,246,0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.auth-brand .brand-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-size: var(--text-xl); font-weight: 700; letter-spacing: 0.5px;
}
.auth-brand .brand-header .brand-logo {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.auth-brand .brand-main {
  position: relative; z-index: 2;
  margin: auto 0;
  max-width: 480px;
}
.auth-brand .brand-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  margin-bottom: 20px;
}
.auth-brand .brand-title {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px 0;
}
.auth-brand .brand-subtitle {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  margin: 0;
}
.auth-brand .brand-features {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 36px;
}
.auth-brand .brand-feature {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  font-size: var(--text-sm);
}
.auth-brand .brand-feature i {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 12px;
}
.auth-brand .brand-footer {
  position: relative; z-index: 2;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.55);
}

/* 右侧表单区 */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px clamp(24px, 4vw, 64px);
  background: var(--surface);
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-card .card-header {
  margin-bottom: 28px;
}
.auth-card .card-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.auth-card .card-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin: 0;
}
.auth-card .card-subtitle a {
  color: var(--brand-accent); text-decoration: none; font-weight: 600;
}
.auth-card .card-subtitle a:hover { text-decoration: underline; }

/* 表单 */
.auth-form .form-item {
  margin-bottom: 16px;
}
.auth-form .form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.auth-form .form-input-wrap {
  position: relative;
}
.auth-form .form-input-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px;
  pointer-events: none;
}
.auth-form .form-input,
.auth-form .form-select {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px 0 42px;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
}
.auth-form .form-input.no-icon,
.auth-form .form-select.no-icon { padding-left: 14px; }
.auth-form .form-input:hover,
.auth-form .form-select:hover { border-color: #cbd5e1; }
.auth-form .form-input:focus,
.auth-form .form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-glow);
  background: #fff;
}
.auth-form .form-input::placeholder { color: var(--text-muted); }
.auth-form .form-input-code {
  padding-right: 120px;
}
.auth-form .code-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 32px;
  padding: 0 14px;
  border: none;
  background: #eff6ff;
  color: var(--brand-accent);
  font-size: var(--text-xs); font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.auth-form .code-btn:hover:not(:disabled) { background: #dbeafe; }
.auth-form .code-btn:disabled { background: #e2e8f0; color: var(--text-muted); cursor: not-allowed; }
.auth-form .code-img {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 34px; width: auto;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border);
}

/* Tabs（切换密码/密钥登录） */
.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .18s;
}
.auth-tabs a.active {
  background: var(--surface);
  color: var(--brand-accent);
  box-shadow: var(--shadow-sm);
}

/* 复选框 */
.auth-check {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-sm); color: var(--text-secondary);
  margin-bottom: 20px;
}
.auth-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--brand-accent);
}
.auth-check a { color: var(--brand-accent); text-decoration: none; font-weight: 500; }
.auth-check a:hover { text-decoration: underline; }

/* 主按钮 */
.auth-btn {
  width: 100%;
  height: 48px;
  border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-mid) 100%);
  color: #fff;
  font-size: var(--text-lg); font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform .12s, box-shadow .18s, filter .15s;
  box-shadow: 0 4px 14px rgba(42,82,152,0.35);
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(42,82,152,0.42); }
.auth-btn:active:not(:disabled) { transform: translateY(0); filter: brightness(0.98); }
.auth-btn:disabled { filter: grayscale(0.3) brightness(0.95); cursor: not-allowed; }
.auth-btn-secondary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
  margin-top: 12px;
}
.auth-btn-secondary:hover:not(:disabled) { border-color: var(--brand-accent); color: var(--brand-accent); box-shadow: none; transform: none; }

/* 分隔线 */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; font-size: var(--text-xs); color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* 底部链接行 */
.auth-links {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px;
  font-size: var(--text-sm);
}
.auth-links a { color: var(--brand-accent); text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }

/* 第三方登录图标按钮 */
.auth-socials {
  display: flex; justify-content: center; gap: 12px;
}
.auth-socials a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  text-decoration: none;
  transition: all .18s;
}
.auth-socials a:hover { border-color: var(--brand-accent); color: var(--brand-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.auth-socials a img { width: 20px; height: 20px; border-radius: 50%; }

/* 页脚 */
.auth-footer {
  text-align: center;
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: 28px;
}
.auth-footer a { color: var(--text-muted); text-decoration: none; }
.auth-footer a:hover { color: var(--brand-accent); }

/* 验证码滑块容器 */
.auth-captcha { margin: 4px 0 16px; }

/* admin 专用：更窄的卡片 + 稍大品牌区 */
.auth-wrap.admin { grid-template-columns: 1.15fr 1fr; }
.auth-wrap.admin .auth-card { max-width: 400px; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .auth-wrap, .auth-wrap.admin { grid-template-columns: 1fr; min-height: auto; }
  .auth-brand {
    padding: 32px 24px;
    min-height: 240px;
  }
  .auth-brand .brand-main { margin: 28px 0; }
  .auth-brand .brand-features { display: none; }
  .auth-panel { padding: 36px 20px; }
}
@media (max-width: 480px) {
  .auth-brand .brand-title { font-size: 24px; }
  .auth-card .card-title { font-size: var(--text-2xl); }
  .auth-form .form-input, .auth-form .form-select { height: 44px; font-size: 15px; }
  .auth-btn { height: 46px; font-size: var(--text-base); }
}
