:root {
  color-scheme: light;
  --background: #f8f8f5;
  --field: #fff;
  --text: #191a19;
  --muted: #565952;
  --login-line: #c4c7be;
  --action: #202420;
  --action-text: #fff;
  --error: #9b2c23;
  font-family: "Geist", "Inter", system-ui, "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #181a18;
  --field: #222522;
  --text: #f5f5ef;
  --muted: #bdbfb6;
  --login-line: #696e64;
  --action: #e8ede1;
  --action-text: #171a16;
  --error: #ffa49a;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.login-team {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr);
  padding: clamp(24px, 3.5vw, 56px);
  color: #fff;
  background: linear-gradient(145deg, #747e87 0%, #626c75 53%, #4e5861 100%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -.035em;
}

.login-brand span {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #e9ece3;
  color: #222722;
  font-size: 19px;
}

.team-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 22px 0 10px;
}

.team-lineup {
  position: relative;
  isolation: isolate;
  width: min(100%, 530px);
  aspect-ratio: 1.54;
}

.team-lineup::before {
  content: "";
  position: absolute;
  inset: auto 0 4% 0;
  height: 16%;
  background: radial-gradient(ellipse, #293139b0, transparent 69%);
}

.team-member {
  position: absolute;
  inset: auto auto 12% var(--left);
  width: var(--width);
  height: var(--height);
  z-index: var(--layer, 1);
  transform-origin: 50% 100%;
}

/* The eyes and role accessories sit directly on each character's silhouette. */
.member-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--cap, 33% 33% 13% 13% / 22% 22% 9% 9%);
  background: linear-gradient(140deg, #fff5, transparent 44%, #16151b24), var(--color);
  box-shadow: inset 0 1px #ffffff50, inset 0 -3px #1a182019, 2px 7px 20px #141a1466;
}

.member-face {
  position: absolute;
  z-index: 1;
  top: var(--eye-top, 27%);
  left: 50%;
  width: 53%;
  display: flex;
  justify-content: center;
  gap: 13%;
  transform: translateX(-50%);
}

.member-face i {
  position: relative;
  width: 38%;
  aspect-ratio: .86;
  border-radius: 50%;
  background: #fffcf0;
  box-shadow: inset 0 -1px 2px #554c4633;
}

.member-face i::after {
  content: "";
  position: absolute;
  inset: 25% auto auto 31%;
  width: 42%;
  height: 55%;
  border-radius: 50%;
  background: #242122;
  transform: translate(var(--gaze-x, var(--look-x, 0px)), var(--gaze-y, var(--look-y, 0px)));
}

.member-detail {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.member-market { --left: 1%; --width: 23%; --height: 42%; --color: #ff9a70; --cap: 51% 51% 15% 17% / 49% 49% 10% 10%; --layer: 3; --eye-top: 38%; --rest: -3deg; }
.member-theme { --left: 17%; --width: 20%; --height: 69%; --color: #ab8af8; --rest: -3deg; }
.member-stock { --left: 30%; --width: 21%; --height: 54%; --color: #c8b9ff; --layer: 2; --rest: 2deg; }
.member-trader { --left: 46%; --width: 21%; --height: 76%; --color: #78dab0; --rest: 3deg; }
.member-risk { --left: 61%; --width: 20%; --height: 45%; --color: #ffd566; --cap: 50% 50% 16% 16% / 43% 43% 11% 11%; --layer: 3; --eye-top: 39%; --rest: -2deg; }
.member-review { --left: 76%; --width: 22%; --height: 59%; --color: #85d2fa; --layer: 2; --rest: 4deg; }

.member-market .member-detail {
  top: 63%; left: 47%; width: 36%; height: 11%;
  border-radius: 4px;
  background: #533d36;
  box-shadow: inset 0 2px #ffffff40;
  transform: rotate(-25deg);
}

.member-market .member-detail::after {
  content: "";
  position: absolute;
  left: 73%; top: -36%; width: 42%; height: 172%;
  border: 2px solid #f5ddc6;
  border-radius: 38%;
  background: #424341;
}

.member-theme .member-detail {
  top: 9%; left: 60%; width: 5%; height: 7%;
  background: #ede3fa;
  border-radius: 9px;
  transform: rotate(28deg);
  box-shadow: 7px 3px #ede3fa;
}

.member-stock .member-face i {
  outline: 2px solid #484455;
  outline-offset: 2px;
}

.member-stock .member-detail {
  top: 32%; left: 45%; width: 10%; height: 2px;
  background: #484455;
}

.member-trader .member-detail {
  top: 8%; left: 33%; width: 42%; height: 15%;
  border-radius: 85% 10% 79% 12%;
  background: #e1ead7;
  box-shadow: -7px 4px #c9d9be;
  transform: rotate(-16deg);
}

.member-risk .member-detail {
  top: 7%; left: 13%; width: 74%; height: 25%;
  border-radius: 58% 58% 8% 8% / 95% 95% 15% 15%;
  background: linear-gradient(90deg, #fff0c2 44%, #d9ae60 44% 52%, #fff0c2 52%);
  box-shadow: 0 3px #af8446;
}

.member-review .member-detail {
  top: 57%; left: 51%; width: 30%; height: 26%;
  border-radius: 3px;
  border-top: 3px dotted #55656a;
  background: #dce7e9;
  transform: rotate(12deg);
  box-shadow: 2px 3px #54646b45;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: clamp(22px, 6vw, 86px);
}

.login-card { width: min(100%, 368px); }
h1 { margin: 0 0 26px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.045em; }
#login-help { margin: -14px 0 24px; color: var(--muted); line-height: 1.6; }
label { display: block; margin: 20px 0 8px; font-size: 14px; font-weight: 600; }
input, button { font: inherit; }
input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--login-line);
  border-radius: 9px;
  background: var(--field);
  color: var(--text);
}

.password-field { position: relative; }
.password-field input { padding-inline-end: 88px; }
button { cursor: pointer; }
#password-visibility {
  position: absolute;
  inset: 3px 4px 3px auto;
  padding-inline: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
#password-visibility:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
#login-status { color: var(--error); min-height: 1.3em; margin: 10px 0; font-size: 14px; }
#login-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: var(--action);
  color: var(--action-text);
  font-weight: 650;
}
#login-submit:disabled { opacity: .65; cursor: wait; }
#login-mode {
  margin-block-start: 14px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}
#registration-note {
  margin-block: .75rem 0;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.5;
}
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.team-member {
  transform: rotate(calc(var(--rest, 0deg) + var(--lean, 0deg)));
}

.team-lineup[data-pose="email"] { --look-x: 3px; --look-y: -1px; }
.team-lineup[data-pose="password"] { --look-x: 3px; --look-y: 2px; }
.team-lineup[data-pose="away"] { --look-x: -3px; --look-y: -2px; }

@media (prefers-reduced-motion: no-preference) {
  .team-member {
    transition: transform 380ms cubic-bezier(.22,.68,.25,1.13);
    transition-delay: var(--reaction, 0ms);
  }

  .member-body {
    transition: translate 240ms cubic-bezier(.22,.68,.25,1.15);
    transition-delay: var(--reaction, 0ms);
  }

  .team-lineup[data-typing]:is([data-pose="email"], [data-pose="password"])
  :is(.member-market, .member-stock, .member-review) .member-body {
    translate: 0 -4%;
  }

  .member-face i::after { transition: transform 160ms ease-out; }
  .team-lineup[data-pose="away"] .member-face i {
    animation: glance-blink 190ms ease-in-out var(--reaction, 0ms) both;
  }

  @keyframes glance-blink {
    0%, 100% { transform: scaleY(1); }
    39% { transform: scaleY(.15); }
  }
  .team-lineup[data-pose="email"] { --lean: 5deg; }
  .team-lineup[data-pose="password"] { --lean: 7deg; }
  .team-lineup[data-pose="away"] { --lean: -8deg; }
  .member-theme, .member-risk { --reaction: 50ms; }
  .member-stock, .member-review { --reaction: 90ms; }
}

@media (max-width: 720px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-team { grid-template-rows: auto auto; padding: 18px 22px 8px; }
  .login-brand { font-size: 16px; }
  .login-brand span { width: 31px; }
  .team-stage { padding: 6px 0 0; }
  .team-lineup { width: min(72%, 258px); }
  .login-form-panel { align-items: start; padding: 32px 22px; }
  .team-lineup[data-pose="email"], .team-lineup[data-pose="password"] { --look-x: 0px; --look-y: 2px; }
  .team-lineup[data-pose="away"] { --look-x: -2px; --look-y: -1px; }
}
