.login-materials {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f7f4f0;
}

.login-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Both pages preserve the original landscape proportions across the full viewport width. */
.login-scene-window {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.login-paper-extension {
  display: block;
  width: 100%;
  height: max(0px, calc(100% - 33.935546875vw + 1px));
}

.login-scene {
  position: absolute;
  bottom: 0;
  width: 100%;
  aspect-ratio: 2048 / 695;
}

.login-scene > img {
  position: absolute;
  display: block;
  max-width: none;
}

.login-scene-base {
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-character {
  left: calc(var(--x) / 2048 * 100%);
  top: calc(var(--y) / 695 * 100%);
  width: calc(var(--w) / 2048 * 100%);
  height: auto;
}

.login-stage-contact {
  position: absolute;
  left: calc(1014 / 2048 * 100%);
  top: calc(383.5 / 695 * 100%);
  width: calc(22 / 2048 * 100%);
  height: calc(3 / 695 * 100%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 65% 50%, #66513acc 0%, #79624780 23%, #8a72513d 48%, transparent 72%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(332px, 100%);
  height: 112px;
}

#loginScreen > .login-brand {
  position: absolute;
  top: 24px;
  left: 32px;
}

.login-brand-icon {
  display: block;
  flex: 0 1 112px;
  width: 112px;
  min-width: 0;
  height: auto;
  transform: translateY(-8px);
}

.login-brand-wordmark {
  display: grid;
  justify-items: start;
  flex: 0 1 208px;
  min-width: 0;
  color: #5c6e7a;
  font: 18px/24px "Microsoft YaHei", "PingFang SC", sans-serif;
}

.login-brand-wordmark::before {
  content: "";
  display: block;
  width: 100%;
  height: 68px;
  background: url("/assets/login-materials/brand.png") no-repeat right top / 302px 94px;
}

.login-brand-wordmark span {
  padding-inline-start: 11px;
}

.login-corner-slogan {
  position: absolute;
  top: 61.6px;
  right: 28.8px;
  width: 473.44px;
  margin: 0;
  line-height: 0;
}

.login-corner-slogan img {
  display: block;
  width: 100%;
  height: auto;
}

.login-panel-position {
  position: relative;
  width: min(384px, calc(100% - 80px));
  align-self: center;
  justify-self: end;
  margin: 44px 40px;
}

.material-login-card {
  position: relative;
  isolation: isolate;
  display: grid;
  min-width: 0;
  padding: 24px 25px 23px;
  color: #395066;
  font: 14px/1.4 "Microsoft YaHei", "PingFang SC", sans-serif;
}

.material-login-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px 4px 3px;
  border-radius: 22px 11px 22px 11px;
  background: radial-gradient(ellipse at 100% 0, #eee7f3, transparent 52%), #faf8f5;
}

.material-card-brand {
  display: flex;
  gap: 10px;
  min-height: 49px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid #ded8e3;
}

.material-card-brand > span {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 11px 5px 11px 5px;
  background: linear-gradient(145deg, #3c546b, #6b798e);
  color: #fffefa;
  font: 17px "STKaiti", "KaiTi", serif;
}

.material-card-brand div {
  display: grid;
  align-content: start;
  gap: 1px;
  padding-top: 2px;
}

.material-card-brand small {
  color: #6b798e;
  font-size: 10px;
  line-height: 14px;
}

.material-card-brand h2 {
  margin: 0;
  color: inherit;
  font: bold 15px/20px "STKaiti", "KaiTi", serif;
  letter-spacing: 1.2px;
}

.material-login-fields {
  display: grid;
  gap: 9px;
}

.material-login-field {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  height: 45px;
  border: 1px solid #dcd6e1;
  border-radius: 11px;
  background: #fbfaf8;
}

.material-login-field > span {
  color: #5b6c7e;
  font-size: 13px;
  text-align: center;
}

.material-login-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 9px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 14px Arial, "Microsoft YaHei", sans-serif;
}

.material-login-field:focus-within {
  outline: 2px solid #6b798e;
}

#loginStatus {
  margin: 6px 0 0;
  color: #984954;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.material-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 15px;
  padding: 0 8px;
  border: 0;
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 84% -15%, #a38abcca 0, #8b799088 24%, transparent 62%),
    radial-gradient(ellipse at 14% 125%, #9aa7b1b3 0, #6b798e8c 30%, transparent 68%),
    radial-gradient(ellipse at 100% 100%, #d4b89650, transparent 38%),
    linear-gradient(110deg, #354c60, #395066 48%, #45465e);
  color: #fffefa;
  box-shadow: 0 12px 24px #3950662e;
  font-size: 18px;
  font-weight: 800;
}

.material-login-submit:hover:not(:disabled) {
  box-shadow: 0 12px 24px #39506640, inset 0 0 0 1px #c5b3d36b;
}

.material-login-submit:disabled {
  cursor: wait;
  opacity: .7;
}

.material-login-submit b {
  color: #e5c87b;
  font-size: 23px;
}

.material-login-card > footer {
  margin-top: 16px;
  color: #606e7a;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

.login-materials :is(button, a, [tabindex]):focus-visible {
  outline: 2px solid #395066;
  outline-offset: 2px;
}

@media (min-width: 901px) and (max-height: 840px) {
  .login-panel-position {
    align-self: start;
    margin-top: 276px;
  }
}

@media (max-width: 900px) {
  #loginScreen {
    align-content: start;
    justify-items: center;
    gap: 24px;
    padding: 12px 16px 44px;
  }

  #loginScreen > .login-brand,
  .login-corner-slogan {
    position: static;
  }

  .login-corner-slogan {
    width: min(473.44px, 100%);
  }

  .login-panel-position {
    width: min(384px, 100%);
    justify-self: center;
    margin: 0;
  }
}
