:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg2: #0e1630;
  --panel: #111b36;
  --panel2: #16244a;
  --line: #243459;
  --txt: #e8eefc;
  --mut: #8d9bbd;
  --red: #d93a46;
  --red-edge: #ff7b86;
  --blue: #2d5fc7;
  --stage: "Jersey 10", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

@font-face {
  font-family: "Jersey 10";
  src: url("/assets/fonts/Jersey10-latin.woff2") format("woff2");
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--body); color: var(--txt); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red-edge); text-underline-offset: .22em; }
a:hover { color: #ffe1cf; }
:focus-visible { outline: 2px solid #f2c94c; outline-offset: 2px; }
[hidden] { display: none !important; }

/* 背景：与参考站同一张山景，叠深蓝渐变 */
.auth {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100svh;
  background:
    linear-gradient(115deg, #050919eb 0%, #0b1330c2 48%, #19091de0 100%),
    url("/assets/bg/scenes/johto-sommet-mont-argente-710x400.webp") 58% center / cover no-repeat fixed;
}

.auth-stage {
  display: grid;
  place-items: center;
  padding: 28px 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.auth-card {
  width: min(500px, 100vw - 28px);
  border-color: #3b528b;
  background: #111b36f5;
  box-shadow: 0 24px 70px #020511cc, 0 0 0 1px #101833;
  animation: authIn .28s cubic-bezier(.2, .9, .3, 1.18) both;
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(18px) scale(.95); }
}

.card-h {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 20px;
  background-image: linear-gradient(to right, #b3303b, #6c1a24);
}

.card-h h2 {
  margin: 0;
  font-family: var(--stage);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .8px;
}

.auth-brand img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px #5f151d);
}

.card-b {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.auth-tagline {
  margin: 0;
  color: #afbddf;
  font-size: 17px;
  line-height: 1.35;
}

/* 登录 / 注册 双 tab */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #2b3f70;
  border-radius: 10px;
  background: #091126;
}

.auth-tabs button {
  position: relative;
  min-height: 42px;
  padding: 7px 12px 9px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #8798be;
  font-family: var(--stage);
  font-size: 22px;
  transition: color .18s, background-color .18s, transform .18s;
}

.auth-tabs button::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 5px;
  left: 18px;
  height: 3px;
  border-radius: 4px;
  background: var(--red-edge);
  transform: scaleX(0);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.25);
}

.auth-tabs button:hover { color: #dbe5ff; background: #ffffff08; }

.auth-tabs button.on {
  color: #fff;
  background: linear-gradient(#d93a46, #ad2633);
  text-shadow: 2px 2px #751923;
  transform: translateY(-1px);
}

.auth-tabs button.on::after { transform: scaleX(1); }

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: authFlip .42s cubic-bezier(.2, .9, .25, 1.1) both;
}

@keyframes authFlip {
  from { opacity: 0; transform: rotateY(-76deg) scale(.96); }
}

.auth-form .in {
  min-height: 48px;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #0a1126;
  color: #fff;
  font-size: 19px;
  letter-spacing: .3px;
  transition: border-color .15s, box-shadow .15s;
}

.auth-form .in::placeholder { color: #6e7ea6; }

.auth-form .in:focus {
  border-color: #5b8cf0;
  outline: 0;
  box-shadow: 0 0 0 3px #5b8cf026;
}

.auth-error {
  margin: 0;
  color: #ff8a93;
  font-size: 16px;
  line-height: 1.3;
}

.btn {
  min-height: 48px;
  margin-top: 2px;
  border: 3px solid #1b1b22;
  border-radius: 0;
  color: #fff;
  font-family: var(--stage);
  font-size: 23px;
  letter-spacing: .8px;
  text-transform: uppercase;
  box-shadow: inset 0 -3px #0000004d;
  transition: transform 80ms, filter .15s;
}

.btn.red {
  background-color: var(--red);
  border-color: var(--red-edge);
  box-shadow: 0 5px #7e1b26;
}

.btn:hover:not(:disabled) { filter: brightness(1.06); }

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px #7e1b26;
}

.btn:disabled {
  opacity: .6;
  filter: saturate(.55) brightness(.85);
  cursor: not-allowed;
}

.auth-legal {
  margin: 0;
  color: var(--mut);
  font-size: 15px;
  line-height: 1.35;
}

.auth-switch {
  padding: 14px 16px 22px;
  text-align: center;
  color: var(--mut);
  font-size: 16px;
}

.auth-switch a { font-weight: 600; }

@media (max-width: 560px) {
  .card-h { min-height: 54px; padding-inline: 16px; }
  .card-h h2 { font-size: 26px; }
  .card-b { gap: 12px; padding: 16px; }
  .auth-form .in { min-height: 44px; font-size: 17px; }
  .btn { min-height: 44px; font-size: 20px; }
}

@media (pointer: coarse) {
  .account-dialog .auth-card { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-form { animation: none; }
  .auth-tabs button, .auth-tabs button::after { transition: none; }
}

.local-badge { margin-left: auto; border: 1px solid #ffffff55; border-radius: 5px; padding: .25em .5em; font-size: .8rem; white-space: nowrap; }
.auth-form .in { min-width: 0; width: 100%; }
