/* 登录页 ====================================================================
   左品牌 / 右登录卡的对开布局。手机上登录卡优先：品牌面板缩成一行标题，
   打开页面第一屏就能看到输入框。
   ========================================================================== */

.auth-body {
  min-height: 100dvh;
}

.auth-shell {
  display: grid;
  gap: 14px;
  width: min(1180px, 100% - var(--gutter) * 2);
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 0 calc(24px + var(--safe-bottom));
}

/* 手机：把右栏拆开，顶栏 → 品牌 → 登录卡依次排 */
.auth-panel {
  display: contents;
}

.auth-panel-top {
  order: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease), transform 0.2s var(--ease-spring);
}

.auth-back svg {
  width: 16px;
  height: 16px;
}

.auth-back:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .auth-back:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  }
}

/* 品牌面板 */
.auth-brand {
  order: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 12% 8%, var(--glow-c), transparent 62%),
    radial-gradient(90% 80% at 92% 96%, var(--glow-b), transparent 60%),
    color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.6s var(--ease) both;
}

/* 网格底纹，缓慢平移，给静态页面一点呼吸感 */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: -46px;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  animation: auth-grid-drift 24s linear infinite;
}

.auth-brand > * {
  position: relative;
}

.auth-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease-spring);
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.auth-brand-text strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.auth-brand-text small {
  color: var(--muted);
  font-size: 12.5px;
}

.auth-brand-body .kicker {
  display: none;
}

.auth-brand-body h1 {
  margin: 0 0 6px;
  font-size: 23px;
  line-height: 1.2;
}

.auth-lead {
  max-width: 36ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.75;
}

.auth-cards,
.auth-brand-foot {
  display: none;
}

/* 登录卡 */
.auth-card-main {
  order: 2;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lift);
  animation: rise-in 0.6s var(--ease) 0.08s both;
}

.auth-card-main h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.8vw, 32px);
}

.auth-sub {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.75;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field > label {
  transition: color var(--duration) var(--ease);
}

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

/* 密码框右侧的显示 / 隐藏 */
.auth-pass {
  position: relative;
}

.auth-pass input {
  padding-right: 56px;
}

.auth-pass-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.auth-pass-toggle svg {
  width: 19px;
  height: 19px;
}

.auth-pass-toggle .i-hide,
.auth-pass-toggle[aria-pressed="true"] .i-show {
  display: none;
}

.auth-pass-toggle[aria-pressed="true"] .i-hide {
  display: block;
}

@media (hover: hover) {
  .auth-pass-toggle:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
}

.caps-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 600;
}

.caps-hint svg {
  width: 14px;
  height: 14px;
}

/* 登录按钮：hover 时一道高光扫过 */
.auth-submit {
  width: 100%;
  margin-top: 8px;
  letter-spacing: 0.2em;
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

.auth-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes auth-grid-drift {
  to {
    transform: translate(46px, 46px);
  }
}

/* 平板 */
@media (min-width: 600px) {
  .auth-shell {
    max-width: 580px;
  }

  .auth-card-main {
    padding: 30px 28px;
  }
}

/* 宽屏：左右对开 */
@media (min-width: 941px) {
  .auth-body {
    display: grid;
    place-items: center;
  }

  .auth-shell {
    grid-template-columns: 1.02fr 0.98fr;
    gap: 30px;
    align-items: center;
    max-width: 1180px;
    padding-block: 32px;
  }

  .auth-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: auth-in-right 0.7s var(--ease) 0.08s both;
  }

  .auth-card-main {
    padding: 38px;
    animation: none;
  }

  .auth-brand {
    gap: 26px;
    padding: 38px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    animation: auth-in-left 0.7s var(--ease) both;
  }

  .auth-brand-head {
    gap: 14px;
  }

  .auth-logo {
    width: 52px;
    height: 52px;
    padding: 8px;
    border-radius: 16px;
  }

  .auth-brand-text strong {
    font-size: 19px;
  }

  .auth-brand-body .kicker {
    display: inline-flex;
  }

  .auth-brand-body h1 {
    margin: 10px 0 14px;
    font-size: clamp(34px, 3.9vw, 54px);
    line-height: 1.08;
  }

  .auth-lead {
    max-width: 34ch;
    font-size: 15px;
  }

  .auth-cards {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-sunken);
  }

  .auth-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  }

  .auth-card:hover {
    transform: translateX(6px);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow: var(--shadow);
  }

  .auth-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
  }

  .auth-card-icon svg {
    width: 17px;
    height: 17px;
  }

  .auth-card-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .auth-card-text strong {
    font-size: 14.5px;
  }

  .auth-card-text span {
    color: var(--muted);
    font-size: 12.5px;
  }

  .auth-brand-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13px;
  }

  .auth-brand-foot a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .auth-brand-foot a:hover {
    color: var(--accent);
  }

  .auth-brand:hover .auth-logo {
    transform: rotate(-6deg) scale(1.06);
  }

  .auth-brand-head,
  .auth-brand-body,
  .auth-cards,
  .auth-brand-foot {
    animation: rise-in 0.6s var(--ease) both;
  }

  .auth-brand-body {
    animation-delay: 0.08s;
  }

  .auth-cards {
    animation-delay: 0.16s;
  }

  .auth-brand-foot {
    animation-delay: 0.24s;
  }
}

@keyframes auth-in-left {
  from {
    opacity: 0;
    transform: translateX(-26px);
  }
}

@keyframes auth-in-right {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
}
