/* 云票达 · 登录页 — 设计师定稿（左品牌 + 右表单） */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #eff4ff;
  --blue-100: #dbe6fe;
  --blue-200: #bfd3fe;
  --blue-300: #93b4fd;
  --blue-400: #608efc;
  --blue-500: #3b6df0;
  --blue-600: #2551db;
  --blue-700: #1d3fb8;
  --blue-800: #1b3494;
  --blue-900: #172b7a;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --primary: var(--blue-500);
  --primary-dark: var(--blue-700);
  --surface: #fff;
  --text-secondary: var(--slate-500);
  --border: var(--slate-200);
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.yunpia-login-page {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #f4f6fa;
  color: var(--slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: var(--blue-600); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.page {
  display: flex;
  min-height: 100dvh;
}

/* —— 左侧品牌区 —— */
.brand-panel {
  flex: 1 1 52%;
  background: linear-gradient(170deg, #172b7a 0%, #1d3fb8 30%, #2551db 55%, #3068eb 75%, #3b6df0 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 72px;
  color: #fff;
}

.brand-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.decor-ticket {
  position: absolute;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  opacity: 0;
  animation: floatTicket 20s ease-in-out infinite;
}

.decor-ticket:nth-child(1) {
  width: 180px; height: 110px;
  top: 8%; right: -40px;
  border-color: rgba(255,255,255,0.06);
  transform: rotate(-8deg);
  animation-delay: 0s;
}
.decor-ticket:nth-child(2) {
  width: 140px; height: 90px;
  top: 65%; right: 12%;
  border-color: rgba(255,255,255,0.05);
  transform: rotate(12deg);
  animation-delay: -7s;
}
.decor-ticket:nth-child(3) {
  width: 200px; height: 120px;
  top: 40%; right: -60px;
  border-color: rgba(255,255,255,0.07);
  transform: rotate(-3deg);
  animation-delay: -14s;
}

.decor-ticket::before {
  content: '';
  position: absolute;
  top: 18px; left: 16px;
  width: 80px; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.decor-ticket::after {
  content: '';
  position: absolute;
  top: 30px; left: 16px;
  width: 120px; height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 1px;
}

.decor-ticket:nth-child(2)::before { width: 60px; top: 14px; left: 10px; }
.decor-ticket:nth-child(2)::after { width: 90px; top: 24px; left: 10px; }
.decor-ticket:nth-child(3)::before { width: 100px; top: 22px; }
.decor-ticket:nth-child(3)::after { width: 140px; }

@keyframes floatTicket {
  0%, 100% { transform: translate(0, 0) rotate(var(--r, -8deg)); opacity: 0; }
  20% { opacity: 0.5; }
  40% { opacity: 0.3; }
  60% { opacity: 0.6; }
  80% { opacity: 0; transform: translate(-30px, -20px) rotate(var(--r, -8deg)); }
}

.scan-line {
  position: absolute;
  top: 45%;
  right: -80px;
  width: 260px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 80%, transparent 100%);
  animation: scanPulse 3s ease-in-out infinite;
}

.scan-line:nth-child(5) {
  top: 55%;
  right: -40px;
  width: 200px;
  animation-delay: -1.2s;
}

@keyframes scanPulse {
  0%, 100% { opacity: 0; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(-40px); }
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 0.1s forwards;
}

.brand-logo svg { width: 42px; height: 42px; flex-shrink: 0; }

.brand-logo-text { display: flex; flex-direction: column; }

.brand-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-edition {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.55;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 0.25s forwards;
}

.brand-tagline .highlight {
  background: linear-gradient(135deg, #60a5fa, #a5d0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 16px;
  font-weight: 400;
  opacity: 0;
  line-height: 1.7;
  margin-bottom: 48px;
  color: rgba(255,255,255,0.72);
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 0.4s forwards;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 56px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) forwards;
}
.feature-item:nth-child(1) { animation-delay: 0.55s; }
.feature-item:nth-child(2) { animation-delay: 0.7s; }
.feature-item:nth-child(3) { animation-delay: 0.85s; }

.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease-out-expo);
}

.feature-item:hover .feature-icon {
  background: rgba(255,255,255,0.18);
  transform: scale(1.05);
}

.feature-icon svg { width: 19px; height: 19px; }

.feature-text h4 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.feature-text p {
  font-size: 13px;
  opacity: 0.6;
  line-height: 1.5;
}

.brand-trust {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 36px;
  border-top: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 1.0s forwards;
}

.trust-stat { display: flex; flex-direction: column; }

.trust-stat .num {
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.03em;
}

.trust-stat .label {
  font-size: 12px;
  opacity: 0.5;
  margin-top: 2px;
}

.trust-divider {
  width: 1px; height: 38px;
  background: rgba(255,255,255,0.12);
}

.social-badge {
  position: absolute;
  bottom: 40px; right: 48px;
  z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 1.2s forwards;
}

.social-badge .avatar-stack { display: flex; }

.avatar-stack .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: #fff;
}
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar:nth-child(1) { background: #6366f1; }
.avatar-stack .avatar:nth-child(2) { background: #8b5cf6; }
.avatar-stack .avatar:nth-child(3) { background: #a78bfa; }
.avatar-stack .avatar:nth-child(4) { background: rgba(255,255,255,0.2); font-size: 9px; }

.social-badge .badge-text {
  font-size: 12px; font-weight: 500;
  opacity: 0.8;
  white-space: nowrap;
}

/* —— 右侧表单区 —— */
.form-panel {
  flex: 1 1 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  background: #fff;
  position: relative;
}

.form-panel::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,109,240,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.form-container {
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
}

.form-tabs {
  display: flex; gap: 0;
  margin-bottom: 44px;
  border-bottom: 2px solid var(--slate-100);
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.3s forwards;
}

.tab-btn {
  flex: 1;
  padding: 14px 0;
  font-size: 15px; font-weight: 600;
  color: var(--slate-400);
  background: none; border: none; cursor: pointer;
  transition: color var(--transition);
  position: relative;
}

.tab-btn:hover { color: var(--slate-600); }
.tab-btn.active { color: var(--blue-600); }

.tab-btn.active::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2.5px;
  background: var(--blue-600);
  border-radius: 2px;
  transform-origin: left;
  animation: tabUnderline 0.4s var(--ease-out-expo);
}

@keyframes tabUnderline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.form-heading {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 8px;
  color: var(--slate-900);
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.4s forwards;
}

.form-subheading {
  font-size: 14px; color: var(--slate-500);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.5s forwards;
}

.form-group {
  margin-bottom: 22px;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) forwards;
}

.login-form .form-group:nth-of-type(1) { animation-delay: 0.55s; }
.login-form .form-group:nth-of-type(2) { animation-delay: 0.65s; }
.register-form .form-group:nth-of-type(1) { animation-delay: 0.55s; }
.register-form .form-group:nth-of-type(2) { animation-delay: 0.62s; }
.register-form .form-group:nth-of-type(3) { animation-delay: 0.69s; }
.register-form .form-group:nth-of-type(4) { animation-delay: 0.76s; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.form-input {
  width: 100%; height: 50px;
  padding: 0 16px;
  font-size: 15px; color: var(--slate-800);
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease-out-expo);
  outline: none; font-family: inherit;
}

.form-input::placeholder { color: var(--slate-400); }

.form-input:focus {
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,109,240,0.1);
}

.form-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.85s forwards;
}

.forgot-link {
  font-size: 13px; color: var(--blue-600);
  text-decoration: none; font-weight: 500;
  transition: color var(--transition);
}
.forgot-link:hover { color: var(--blue-700); }

.remember-me {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--slate-500); cursor: pointer;
}

.remember-checkbox {
  width: 16px; height: 16px;
  accent-color: var(--blue-600); cursor: pointer;
}

.btn-primary {
  width: 100%; height: 50px;
  font-size: 15px; font-weight: 600;
  color: #fff; background: var(--blue-600);
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  letter-spacing: -0.01em;
  position: relative; overflow: hidden;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.95s forwards;
}

.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease-out-expo);
}

.btn-primary:hover::before { transform: translateX(100%); }

.btn-primary:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,81,219,0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37,81,219,0.2);
}

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

.btn-spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute; top: 50%; left: 50%;
  margin-left: -10px; margin-top: -10px;
}

.btn-primary.loading .btn-text { visibility: hidden; }
.btn-primary.loading .btn-spinner { display: block; }

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

.form-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 32px 0; color: var(--slate-400);
  font-size: 13px;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 1.05s forwards;
}

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

.demo-access {
  display: flex; align-items: center; gap: 16px;
  padding: 17px 22px;
  background: linear-gradient(135deg, var(--blue-50) 0%, #f0f4ff 50%, var(--slate-50) 100%);
  border: 1.5px solid var(--blue-100);
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none; color: inherit;
  transition: all 0.35s var(--ease-spring);
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 1.15s forwards;
  position: relative;
  overflow: hidden;
}

.demo-access::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(59,109,240,0.03) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-expo);
}

.demo-access:hover {
  border-color: var(--blue-300);
  background: var(--blue-50);
  box-shadow: 0 8px 24px rgba(59,109,240,0.1);
  transform: translateY(-3px);
}

.demo-access:hover::after { opacity: 1; }
.demo-access:hover .demo-arrow {
  transform: translateX(4px);
  color: var(--blue-500);
}

.demo-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; z-index: 1;
  transition: transform 0.35s var(--ease-spring);
}

.demo-access:hover .demo-icon { transform: scale(1.08); }
.demo-icon svg { width: 21px; height: 21px; color: #fff; }

.demo-content { position: relative; z-index: 1; }

.demo-content h4 {
  font-size: 14px; font-weight: 600;
  color: var(--slate-800); margin-bottom: 3px;
}

.demo-content p {
  font-size: 12px; color: var(--slate-500); line-height: 1.4;
}

.demo-arrow {
  margin-left: auto; color: var(--blue-400);
  flex-shrink: 0;
  transition: all 0.35s var(--ease-spring);
}

.password-wrapper { position: relative; }

.toggle-password {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--slate-400); padding: 4px;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--slate-600); }
.toggle-password svg { width: 18px; height: 18px; }

.register-form { display: none; }
.register-form.visible { display: block; }
.login-form.hidden { display: none; }

.trial-badge {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: center;
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.82s forwards;
}

.register-note {
  text-align: center;
  font-size: 13px;
  color: var(--slate-400);
  margin-top: 20px;
}

.footer-switch {
  text-align: center;
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 16px;
}

.login-icp {
  text-align: center;
  padding: 14px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  font-size: 11px;
  line-height: 1.5;
  color: var(--slate-400);
}

.login-icp a {
  color: var(--slate-400);
  text-decoration: none;
}

.login-icp a:active,
.login-icp a:hover {
  color: var(--slate-500);
}

.legal-consent {
  text-align: center;
  font-size: 12px;
  line-height: 1.55;
  color: var(--slate-500);
  margin: 0 0 16px;
}

.legal-consent a {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

.legal-consent a:hover {
  text-decoration: underline;
}

.login-icp a + a::before {
  content: none;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* api.js 底部 toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  max-width: 90vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

@media (max-width: 960px) {
  .page { flex-direction: column; }
  .brand-panel { padding: 40px 36px; }
  .brand-tagline { font-size: 34px; }
  .brand-features { margin-bottom: 36px; }
  .brand-subtitle { margin-bottom: 32px; }
  .brand-trust { display: none; }
  .social-badge { bottom: 20px; right: 20px; }
  .decor-ticket, .scan-line { display: none; }
  .form-panel { padding: 36px 28px 52px; }
  .form-container { max-width: 100%; }
}

@media (max-width: 480px) {
  .brand-panel { padding: 28px 20px; }
  .brand-tagline { font-size: 28px; }
  .brand-subtitle { font-size: 14px; }
  .brand-logo { margin-bottom: 32px; }
  .brand-features { gap: 16px; }
  .social-badge { bottom: 12px; right: 12px; padding: 8px 14px; }
  .form-panel { padding: 24px 20px 40px; }
  .form-heading { font-size: 24px; }
  .form-tabs { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— 忘记密码 / 重置密码单页 —— */
body.yunpia-auth-page {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  color: var(--slate-800);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  padding: 32px 28px 28px;
}

.auth-card h1 {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--slate-900);
}

.auth-card .auth-lead {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

.auth-card .form-group { margin-bottom: 16px; opacity: 1; animation: none; }

.auth-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
}

.auth-card .form-group input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-size: 15px;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
}

.auth-card .form-group input:focus {
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,109,240,0.1);
}

.auth-card .auth-success { text-align: center; padding: 8px 0 4px; }
.auth-card .auth-success .icon { font-size: 40px; margin-bottom: 12px; }
.auth-card .auth-success p {
  font-size: 14px;
  color: var(--slate-500);
  line-height: 1.65;
  margin-bottom: 20px;
}

.auth-card .auth-error {
  font-size: 13px;
  color: var(--danger);
  background: #fef2f2;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.btn-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--slate-500);
  background: none;
  border: none;
  padding: 8px;
  margin-top: 12px;
  cursor: pointer;
}

.btn-link:hover { color: var(--blue-600); }
