:root {
  color-scheme: dark;
  --night: #1d201e;
  --night-soft: #282c29;
  --paper: #f1eee6;
  --paper-strong: #fbf9f3;
  --ink: #20221f;
  --muted: #817f77;
  --line: #d8d2c6;
  --orange: #e65232;
  --acid: #d6ed77;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--night); }

body.login-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(135deg, transparent 0 49.9%, #ffffff08 50% 50.15%, transparent 50.25%),
    repeating-linear-gradient(0deg, transparent 0 67px, #ffffff07 68px, transparent 69px),
    var(--night);
}

.login-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 74px);
  gap: clamp(36px, 8vw, 120px);
  align-items: center;
}

.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: min(730px, calc(100vh - 100px));
  padding: 2px 0 0;
  overflow: hidden;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--paper);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--night);
  background: var(--acid);
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -.08em;
  transform: skew(-8deg);
}

.login-brand i { color: var(--orange); font-style: normal; }

.story-index, .story-foot, .card-topline, .card-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #a6a79e;
  font: 700 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
}

.story-index { margin-top: 74px; padding-top: 13px; border-top: 1px solid #ffffff24; }
.story-index span:last-child { color: #737870; text-align: right; }
.story-main { position: relative; z-index: 1; max-width: 640px; margin: 44px 0 0; }
.story-kicker, .card-kicker { color: var(--orange); font: 850 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
.story-kicker { display: flex; align-items: center; gap: 9px; }
.story-kicker span { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 4px #e6523225; }
.story-main h1 { margin: 22px 0 17px; color: var(--paper); font-size: clamp(48px, 6.5vw, 86px); line-height: .99; letter-spacing: -.075em; font-weight: 850; }
.story-copy { max-width: 410px; margin: 0; color: #a9aaa1; font-size: 14px; line-height: 1.9; }

.track-art { position: relative; max-width: 620px; margin: 6px 0 24px; opacity: .92; }
.track-art svg { display: block; width: 100%; overflow: visible; }
.track-art path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.track-shadow { stroke: #ffffff16; stroke-width: 16; }
.track-line { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 7 8; }
.track-art circle { fill: var(--acid); stroke: var(--night); stroke-width: 4; }
.track-label { position: absolute; top: 50%; left: 8%; color: #aeb1a7; font: 750 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.track-label b { padding: 0 7px; color: var(--orange); }
.story-foot { margin: 0; padding-top: 15px; border-top: 1px solid #ffffff24; }
.story-foot span:first-child { color: var(--paper); }

.login-card {
  position: relative;
  padding: clamp(28px, 4.5vw, 58px);
  color: var(--ink);
  background:
    linear-gradient(145deg, transparent 0 91%, #e6523212 91.1% 91.4%, transparent 91.5%),
    var(--paper-strong);
  border: 1px solid #ffffffa8;
  box-shadow: 18px 22px 0 #0d0f0e55;
}

.card-topline { color: #77766f; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.card-topline b { color: var(--orange); }
.card-heading { margin: 44px 0 30px; }
.card-kicker { margin: 0 0 14px; }
.card-heading h2 { margin: 0; color: var(--ink); font-size: clamp(32px, 3vw, 43px); line-height: 1.1; letter-spacing: -.055em; font-weight: 850; }
.card-heading > p:last-child { margin: 11px 0 0; color: var(--muted); font-size: 13px; }

.login-error { margin: -11px 0 22px; padding: 11px 13px; color: #842b1e; background: #f9e1d9; border-left: 3px solid var(--orange); font-size: 13px; line-height: 1.5; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 9px; color: #4d4e49; font-size: 12px; font-weight: 800; }
.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #bdb7ab;
  border-radius: 0;
  font: inherit;
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.login-form input:hover { border-color: #77746d; }
.login-form input:focus-visible { outline: 3px solid #e6523240; outline-offset: 2px; border-color: var(--orange); }
.login-form button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 0 17px;
  color: white;
  background: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease;
}
.login-form button .button-arrow { font-size: 19px; }
.login-form button:hover { background: #c94125; transform: translateY(-1px); }
.login-form button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.login-form button:disabled { cursor: wait; opacity: .84; transform: none; }
.login-submitting { margin: 3px 0 0; color: #56574f; font-size: 12px; }
.login-redirect-note { margin: -9px 0 20px; padding: 10px 12px; color: #56574f; background: #f0ede5; font-size: 12px; line-height: 1.65; }
.login-redirect-note a { display: inline-block; margin-left: 6px; color: #842b1e; font-weight: 750; text-underline-offset: 3px; }
.login-redirect-note a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.login-recovery { display: grid; gap: 15px; margin-top: 26px; }
.login-recovery a { width: fit-content; color: var(--ink); font-size: 13px; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.login-recovery .recovery-primary { display: flex; justify-content: space-between; align-items: center; gap: 18px; width: 100%; min-height: 52px; padding: 0 17px; color: white; background: var(--orange); text-decoration: none; }
.login-recovery .recovery-primary span { font-size: 19px; }
.login-recovery .recovery-primary:hover { background: #c94125; }
.login-recovery a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.card-note { margin: 21px 0 30px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.card-rule { height: 1px; background: var(--line); }
.card-foot { margin: 14px 0 0; color: #8c8980; font-size: 8px; }

@media (max-width: 880px) {
  .login-stage { grid-template-columns: minmax(0, 1fr) minmax(330px, .92fr); gap: 36px; padding: 34px; }
  .login-story { min-height: 650px; }
  .story-index { flex-wrap: wrap; margin-top: 56px; }
}

@media (max-width: 680px) {
  .login-stage { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 18px 22px; }
  .login-story { min-height: auto; overflow: visible; }
  .login-brand { font-size: 9px; }
  .brand-mark { width: 32px; height: 32px; }
  .story-index, .story-kicker, .track-art { display: none; }
  .story-main { margin: 15px 0 0; }
  .story-main h1 { margin: 0 0 7px; font-size: clamp(32px, 8.7vw, 40px); line-height: .96; }
  .story-copy { font-size: 11px; line-height: 1.5; }
  .story-foot { display: none; }
  .login-card { padding: 20px 20px 18px; box-shadow: 6px 7px 0 #0d0f0e55; }
  .card-heading { margin: 19px 0 15px; }
  .card-kicker { display: none; }
  .card-heading h2 { font-size: 28px; }
  .card-heading > p:last-child { margin-top: 7px; font-size: 12px; }
  .login-error { margin: -5px 0 13px; padding: 8px 10px; font-size: 12px; }
  .login-redirect-note { margin: -3px 0 14px; padding: 8px 10px; font-size: 11px; }
  .login-form { gap: 7px; }
  .login-form label { margin-top: 5px; font-size: 11px; }
  .login-form input { min-height: 43px; padding: 9px 11px; font-size: 14px; }
  .login-form button { min-height: 46px; margin-top: 12px; }
  .card-note { margin: 12px 0 0; font-size: 10px; }
  .card-rule, .card-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
