body.login {
  min-height: 100vh;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
}

.spiral-login {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #000000;
}

#spiralCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
}

.login-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(520px, calc(100% - 36px));
  transform: translate(-50%, -50%);
}

.login-overlay::before {
  content: "";
  position: absolute;
  inset: -58px -72px -46px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(0, 0, 0, .72), rgba(0, 0, 0, .34) 48%, transparent 74%);
}

.login-overlay h1 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: .24em;
  text-transform: uppercase;
  animation: pulseText 2.4s ease-in-out infinite;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(160px, 100%);
  margin-top: 26px;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.dingtalk-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 2px;
  color: rgba(255, 255, 255, .88);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.dingtalk-login:hover {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
}

.dingtalk-login:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .86);
  outline-offset: 3px;
}

.dingtalk-login.is-loading {
  pointer-events: none;
  color: rgba(255, 255, 255, .56);
}

.emergency-toggle {
  appearance: none;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .5);
  font-family: var(--font-sans);
  font-size: 10.5px;
  cursor: pointer;
}

.emergency-toggle:hover,
.emergency-toggle:focus-visible {
  color: rgba(255, 255, 255, .82);
}

.emergency-toggle:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .68);
  outline-offset: 3px;
}

.emergency-panel {
  display: grid;
  gap: 12px;
}

.emergency-panel[hidden] {
  display: none;
}

.field {
  display: block;
  min-width: 0;
}

.login-form input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
  border-radius: 0;
  background: transparent !important;
  color: #ffffff !important;
  caret-color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  outline: none;
  backdrop-filter: none;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, .48);
}

.login-form input:hover {
  border-bottom-color: rgba(255, 255, 255, .48);
}

.login-form input:focus {
  border-bottom-color: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 18px -16px rgba(255, 255, 255, .72);
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:autofill {
  border-bottom-color: rgba(255, 255, 255, .86);
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 0 0 1000px #000000 inset !important;
  transition: background-color 9999s ease-out, color 9999s ease-out;
}

.emergency-submit {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 2px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .82);
  font: 500 11px/1 var(--font-sans);
  cursor: pointer;
}

.emergency-submit:hover,
.emergency-submit:focus-visible {
  border-color: rgba(255, 255, 255, .64);
  background: rgba(255, 255, 255, .1);
  color: #ffffff;
}

.emergency-submit:disabled {
  cursor: wait;
  opacity: .62;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #ffffff;
  border-radius: 50%;
}

.form-error {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(232px, calc(100vw - 40px));
  min-height: 34px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 2px;
  background: rgba(0, 0, 0, .32);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  backdrop-filter: blur(8px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseText {
  0%,
  100% {
    opacity: .78;
    letter-spacing: .2em;
  }

  50% {
    opacity: 1;
    letter-spacing: .3em;
  }
}

@media (max-width: 720px) {
  body.login {
    overflow-y: auto;
  }

  .spiral-login {
    min-height: 100svh;
  }

  .login-overlay {
    width: min(360px, calc(100% - 32px));
  }

  .login-overlay h1 {
    font-size: 28px;
  }

  .login-form {
    grid-template-columns: 1fr;
    width: min(168px, 100%);
    margin-top: 28px;
  }

  .login-form input {
    height: 32px;
  }

  .dingtalk-login {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-overlay h1,
  .spinner {
    animation: none;
  }
}
