/* 登录页 · 与仪表盘同一套视觉语言（奶油底 / 暖橙强调色 / 白色卡片） */
:root {
  --auth-ink: var(--ink, #1c1917);
  --auth-muted: var(--muted, #78716c);
  --auth-line: var(--border, #e7e5e4);
  --auth-line-strong: var(--sidebar-border, #e9e2d8);
  --auth-accent: var(--accent, #e24b28);
  --auth-accent-deep: var(--accent-deep, #c2410c);
  --auth-accent-soft: var(--accent-soft, #fde8e2);
  --auth-danger: var(--red, #dc2626);
  --auth-ease: cubic-bezier(0.22, 0.7, 0.25, 1);
}

/* ---------- 基础 ---------- */
.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: safe center;
  justify-items: center;
  padding: 44px 24px calc(44px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 82% -12%, rgba(226, 75, 40, 0.07), transparent 34%),
    var(--content-bg, #f7f4ef);
  color: var(--auth-ink);
  font-family: var(--font, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景光斑 ---------- */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  will-change: transform;
}

.auth-orb-1 {
  width: 420px;
  height: 420px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(226, 75, 40, 0.28), transparent 68%);
  animation: auth-float-1 16s ease-in-out infinite alternate;
}

.auth-orb-2 {
  width: 360px;
  height: 360px;
  right: -110px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.22), transparent 68%);
  animation: auth-float-2 19s ease-in-out infinite alternate;
}

.auth-orb-3 {
  width: 240px;
  height: 240px;
  right: 22%;
  top: 8%;
  background: radial-gradient(circle, rgba(253, 232, 226, 0.9), transparent 70%);
  animation: auth-float-3 22s ease-in-out infinite alternate;
}

.auth-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(28, 25, 23, 0.045) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
  opacity: 0.5;
}

/* ---------- 卡片 ---------- */
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
}

.auth-panel {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface, #fff);
  border: 1px solid var(--auth-line-strong);
  border-radius: 24px;
  box-shadow:
    0 40px 90px -40px rgba(28, 25, 23, 0.32),
    0 2px 6px rgba(28, 25, 23, 0.04);
  animation: auth-panel-in 0.7s var(--auth-ease) both;
}

.auth-panel.is-shaking {
  animation: auth-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ---------- 左侧品牌区（呼应仪表盘侧边栏） ---------- */
.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 486px;
  padding: 30px 28px 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 100%, rgba(226, 75, 40, 0.14), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(180deg, var(--sidebar-bg, #fbf8f3), var(--sidebar-bg-deep, #f6f1ea));
  border-right: 1px solid var(--auth-line-strong);
}

.auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  animation: auth-rise 0.65s var(--auth-ease) 0.1s both;
}

.auth-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--auth-accent), var(--auth-accent-deep));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(226, 75, 40, 0.24);
}

.auth-wordmark {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--auth-ink);
}

/* 底部抽象柱状图：呼应仪表盘趋势卡片，纯装饰无文案 */
.auth-chart-card {
  position: relative;
  margin: 16px 0 auto;
  padding: 15px 15px 13px;
  border: 1px solid rgba(233, 226, 216, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 30px -22px rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: auth-rise 0.7s var(--auth-ease) 0.24s both;
}

.auth-chart-grid {
  position: absolute;
  inset: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.auth-chart-grid span {
  height: 1px;
  background: linear-gradient(90deg, rgba(28, 25, 23, 0.07), rgba(28, 25, 23, 0.02));
}

.auth-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 104px;
}

.auth-chart-bar {
  flex: 1;
  height: var(--h, 50%);
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, rgba(226, 75, 40, 0.22), rgba(226, 75, 40, 0.09));
  transform-origin: bottom center;
  animation: auth-bar-in 0.85s var(--auth-ease) var(--d, 0.2s) both;
}

.auth-chart-bar.is-accent {
  background: linear-gradient(180deg, var(--auth-accent), var(--auth-accent-deep));
  box-shadow: 0 10px 22px -12px rgba(226, 75, 40, 0.75);
}

.auth-side-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--auth-muted);
  animation: auth-rise 0.65s var(--auth-ease) 0.5s both;
}

.auth-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green, #16a34a);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: auth-pulse 2.4s ease-out infinite;
}

/* ---------- 右侧表单区 ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px;
  background:
    radial-gradient(circle at 100% 0%, rgba(226, 75, 40, 0.05), transparent 42%),
    var(--surface, #fff);
}

.auth-head {
  margin-bottom: 24px;
  animation: auth-rise 0.65s var(--auth-ease) 0.16s both;
}

.auth-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: auth-rise 0.65s var(--auth-ease) both;
}

.auth-field:nth-of-type(1) { animation-delay: 0.22s; }
.auth-field:nth-of-type(2) { animation-delay: 0.3s; }

.auth-field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--auth-muted);
  transition: color 0.18s ease;
}

.auth-field:focus-within .auth-field-label { color: var(--auth-accent-deep); }

.auth-input-wrap {
  position: relative;
  display: block;
}

.auth-input-wrap::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 75, 40, 0.45), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.24s ease, transform 0.24s var(--auth-ease);
  pointer-events: none;
}

.auth-field:focus-within .auth-input-wrap::after {
  opacity: 1;
  transform: scaleX(1);
}

.auth-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fdfcfa;
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 46px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.auth-input-wrap input::placeholder {
  color: var(--faint, #a8a29e);
  opacity: 1;
}

.auth-input-wrap input:hover { border-color: var(--auth-line-strong); }

.auth-input-wrap input:focus {
  border-color: var(--auth-accent);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(226, 75, 40, 0.11),
    0 6px 16px -12px rgba(226, 75, 40, 0.6);
}

.auth-input-wrap input:-webkit-autofill {
  -webkit-text-fill-color: var(--auth-ink);
  -webkit-box-shadow: 0 0 0 46px #fdfcfa inset;
  border-radius: 12px;
}

.auth-input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 46px #fff inset, 0 0 0 4px rgba(226, 75, 40, 0.11);
}

/* 错误提示 */
/* ---------- 记住我 ---------- */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 2px;
  font-size: 12.5px;
  color: var(--auth-muted);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.auth-remember input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.auth-check {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--auth-line);
  border-radius: 5px;
  background: var(--auth-fill-focus);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.auth-check::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px) scale(0.5);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-remember:hover .auth-check {
  border-color: var(--auth-muted);
}

.auth-remember input:checked + .auth-check {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.auth-remember input:checked + .auth-check::after {
  opacity: 1;
  transform: rotate(-45deg) translate(0.5px, -1px) scale(1);
}

.auth-remember input:focus-visible + .auth-check {
  box-shadow: 0 0 0 4px rgba(226, 75, 40, 0.11);
}

.auth-remember-text {
  line-height: 1.4;
}

.auth-error {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 10px;
  background: #fff5f5;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.5;
  animation: auth-error-in 0.28s var(--auth-ease) both;
}

.auth-error[hidden] { display: none; }

/* 主按钮 */
.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  margin-top: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-deep));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 12px 26px -14px rgba(226, 75, 40, 0.8);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: auth-rise 0.65s var(--auth-ease) 0.38s both;
}

.auth-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 22%, rgba(255, 255, 255, 0.34) 48%, transparent 74%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--auth-ease);
  pointer-events: none;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -16px rgba(226, 75, 40, 0.95);
  filter: saturate(1.06);
}

.auth-submit:hover::after { transform: translateX(120%); }

.auth-submit:active { transform: translateY(0) scale(0.995); }

.auth-submit:focus-visible {
  outline: none;
  box-shadow:
    0 12px 26px -14px rgba(226, 75, 40, 0.8),
    0 0 0 4px rgba(226, 75, 40, 0.22);
}

.auth-submit:disabled {
  cursor: progress;
  filter: saturate(0.85);
  opacity: 0.85;
  transform: none;
}

.auth-submit.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

/* ---------- 动画 ---------- */
@keyframes auth-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-bar-in {
  from { transform: scaleY(0.12); opacity: 0.2; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes auth-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@keyframes auth-float-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.08); }
}

@keyframes auth-float-2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-36px, -26px, 0) scale(1.06); }
}

@keyframes auth-float-3 {
  from { transform: translate3d(0, 0, 0); opacity: 0.5; }
  to { transform: translate3d(-18px, 22px, 0); opacity: 0.8; }
}

@keyframes auth-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

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

/* ---------- 可访问性 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel,
  .auth-brand,
  .auth-title,
  .auth-field,
  .auth-submit,
  .auth-chart-bar,
  .auth-side-foot,
  .auth-orb,
  .auth-pulse,
  .auth-error {
    animation: none !important;
  }
  .auth-submit,
  .auth-input-wrap input,
  .auth-field-label {
    transition: none !important;
  }
}

/* ---------- 平板 ---------- */
@media (max-width: 880px) {
  .auth-panel { grid-template-columns: 290px minmax(0, 1fr); }
  .auth-side { min-height: 460px; padding: 26px 24px 24px; }
  .auth-main { padding: 44px 36px; }
  .auth-title { font-size: 27px; }
}

/* ---------- 手机：单列 ---------- */
@media (max-width: 720px) {
  .auth-body {
    padding: 22px 16px calc(26px + env(safe-area-inset-bottom, 0px));
    place-items: center;
    align-content: safe center;
  }

  .auth-panel {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 20px;
  }

  .auth-side {
    min-height: 0;
    gap: 16px;
    padding: 20px 22px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--auth-line-strong);
  }

  .auth-brand { margin-top: 0; }

  .auth-chart-card {
    margin: 14px 0 0;
    padding: 12px 13px 11px;
    border-radius: 14px;
  }

  .auth-chart { height: 46px; gap: 5px; }
  .auth-chart-grid { inset: 11px 12px 10px; }
  .auth-chart-bar { border-radius: 4px 4px 2px 2px; }

  .auth-main { padding: 28px 22px 32px; }

  .auth-head { margin-bottom: 20px; }
  .auth-title { font-size: 24px; }

  .auth-form { gap: 16px; }

  /* 16px 及以上可避免 iOS 聚焦时自动放大 */
  .auth-input-wrap input { height: 48px; font-size: 16px; line-height: 48px; }
  .auth-submit { height: 48px; font-size: 16px; }

  .auth-submit:hover { transform: none; box-shadow: 0 12px 26px -14px rgba(226, 75, 40, 0.8); }
  .auth-input-wrap input:hover { border-color: var(--auth-line); }
}

@media (max-width: 380px) {
  .auth-main { padding: 24px 18px 28px; }
  .auth-side { padding: 18px 18px 14px; }
  .auth-title { font-size: 22px; }
  .auth-field-label { letter-spacing: 0.05em; }
}
