:root {
  --login-viewport-height: 100vh;
  --design-width: 660;
  --design-height: 1434;
  --phone-width: min(100vw, calc(var(--login-viewport-height) * var(--design-width) / var(--design-height)));
  --unit: calc(var(--phone-width) / var(--design-width));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: #0a0b0e;
}

body {
  margin: 0;
  min-height: var(--login-viewport-height);
  overflow-x: hidden;
  background: #0a0b0e;
  font-family:
    Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: calc(3 * var(--unit)) solid rgba(255, 255, 255, 0.85);
  outline-offset: calc(4 * var(--unit));
}

.login-stage {
  display: grid;
  min-height: var(--login-viewport-height);
  place-items: center;
  background: #0a0b0e;
}

.login-phone {
  position: relative;
  width: var(--phone-width);
  height: calc(var(--phone-width) * var(--design-height) / var(--design-width));
  max-height: var(--login-viewport-height);
  aspect-ratio: var(--design-width) / var(--design-height);
  overflow: hidden;
  background: #1eddff;
  color: #000;
  isolation: isolate;
}

.login-base,
.login-sky-gradient,
.login-lower-glow,
.login-card,
.login-footer,
.login-wordmark,
.login-robot,
.login-header,
.login-form,
.feedback-button,
.login-feedback-modal,
.login-toast {
  position: absolute;
}

.login-base {
  inset: 0;
  background: #1eddff url("./assets/login-frame4-bg.png") center / 112% 112% no-repeat;
  animation: loginBgDrift 7.5s ease-in-out infinite alternate;
  z-index: 0;
}

.login-base::after {
  content: "";
  position: absolute;
  inset: calc(-80 * var(--unit)) calc(-42 * var(--unit));
  background:
    radial-gradient(circle at 31% 27%, rgba(255, 255, 255, 0.36), transparent 18%),
    radial-gradient(circle at 70% 56%, rgba(255, 255, 255, 0.22), transparent 22%),
    linear-gradient(150deg, transparent 0 22%, rgba(255, 255, 255, 0.16) 37%, transparent 58%);
  filter: blur(calc(12 * var(--unit)));
  opacity: 0.58;
  transform: translate3d(0, 0, 0);
  animation: loginLightDrift 8s ease-in-out infinite alternate;
}

.login-sky-gradient {
  left: 0;
  top: calc(166 * var(--unit));
  width: 100%;
  height: calc(1268 * var(--unit));
  background: linear-gradient(
    0deg,
    rgba(104, 117, 255, 0.5) 23.56%,
    rgba(126, 255, 255, 0) 95.19%
  );
  opacity: 0.44;
  mix-blend-mode: screen;
  animation: loginGradientSwell 9s ease-in-out infinite alternate;
  z-index: 1;
}

.login-wordmark {
  left: calc(62 * var(--unit));
  top: calc(72 * var(--unit));
  width: calc(546 * var(--unit));
  height: calc(281 * var(--unit));
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.login-robot {
  left: calc(31 * var(--unit));
  top: calc(225 * var(--unit));
  width: calc(588 * var(--unit));
  height: calc(784 * var(--unit));
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

.login-lower-glow {
  left: 0;
  top: calc(634 * var(--unit));
  width: 100%;
  height: calc(705 * var(--unit));
  background: linear-gradient(
    0deg,
    rgba(60, 89, 255, 0.2) 13.46%,
    rgba(0, 0, 0, 0) 87.02%
  );
  z-index: 4;
}

.login-card {
  left: calc(62 * var(--unit));
  top: calc(690 * var(--unit));
  width: calc(536 * var(--unit));
  height: calc(723 * var(--unit));
  border: calc(1 * var(--unit)) solid #000;
  border-radius: calc(30 * var(--unit));
  background: #fff;
  box-shadow:
    0 calc(22 * var(--unit)) calc(58 * var(--unit)) rgba(0, 49, 118, 0.2),
    0 calc(5 * var(--unit)) calc(14 * var(--unit)) rgba(0, 0, 0, 0.09);
  animation: cardFloat 4.8s ease-in-out infinite;
  z-index: 5;
}

.login-footer {
  left: 0;
  bottom: 0;
  width: 100%;
  height: calc(108 * var(--unit));
  background: #000;
  z-index: 6;
}

.login-header {
  left: calc(62 * var(--unit));
  top: calc(49 * var(--unit));
  width: calc(529 * var(--unit));
  height: calc(61 * var(--unit));
  z-index: 10;
}

.date-diamond {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: calc(61 * var(--unit));
  height: calc(61 * var(--unit));
  place-items: center;
  color: #fff;
  font-size: calc(20 * var(--unit));
  font-weight: 800;
  line-height: 1;
}

.date-diamond::before {
  content: "";
  position: absolute;
  inset: calc(9 * var(--unit));
  border-radius: calc(10 * var(--unit));
  background: #000;
  transform: rotate(45deg);
  z-index: -1;
}

.login-title-row {
  position: absolute;
  right: 0;
  top: calc(15 * var(--unit));
  display: flex;
  align-items: center;
  gap: calc(9 * var(--unit));
}

.login-title-row h1 {
  margin: 0;
  font-size: calc(26 * var(--unit));
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-title-row time {
  display: grid;
  min-width: calc(73 * var(--unit));
  height: calc(23 * var(--unit));
  place-items: center;
  border-radius: calc(13 * var(--unit));
  background: #000;
  color: #fff;
  font-size: calc(20 * var(--unit));
  font-weight: 800;
  line-height: 1;
}

.login-form {
  inset: 0;
  z-index: 11;
}

.login-field {
  position: absolute;
  left: calc(111 * var(--unit));
  display: block;
  width: calc(438 * var(--unit));
}

.account-field {
  top: calc(746 * var(--unit));
}

.password-field {
  top: calc(881 * var(--unit));
}

.login-field span {
  display: block;
  height: calc(31 * var(--unit));
  margin: 0 0 calc(15 * var(--unit));
  color: #000;
  font-size: calc(26 * var(--unit));
  font-weight: 400;
  line-height: calc(31 * var(--unit));
  letter-spacing: 0;
}

.login-field input {
  display: block;
  width: 100%;
  height: calc(74 * var(--unit));
  border: 0;
  border-radius: calc(50 * var(--unit));
  outline: 0;
  background: #e5e5e5;
  color: #111;
  font-size: calc(24 * var(--unit));
  line-height: 1;
  padding: 0 calc(32 * var(--unit));
  appearance: none;
}

.password-field input {
  padding-right: calc(92 * var(--unit));
}

.login-field input::selection {
  background: rgba(95, 154, 255, 0.32);
}

.password-eye {
  position: absolute;
  left: calc(477 * var(--unit));
  top: calc(942 * var(--unit));
  display: grid;
  width: calc(43 * var(--unit));
  height: calc(43 * var(--unit));
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
}

.password-eye img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.password-eye .eye-visible-icon,
.password-eye[aria-pressed="true"] .eye-hidden-icon {
  display: none;
}

.password-eye[aria-pressed="true"] .eye-visible-icon {
  display: block;
}

.login-submit,
.signup-submit,
.forgot-password,
.feedback-button {
  border: 0;
  padding: 0;
  letter-spacing: 0;
}

.login-submit,
.signup-submit {
  position: absolute;
  left: calc(204 * var(--unit));
  width: calc(242 * var(--unit));
  height: calc(57 * var(--unit));
  border-radius: calc(50 * var(--unit));
  color: #fff;
  font-size: calc(26 * var(--unit));
  font-weight: 800;
  line-height: 1;
}

.login-submit {
  top: calc(1057 * var(--unit));
  background: #030303;
}

.signup-submit {
  top: calc(1165 * var(--unit));
  border: calc(1 * var(--unit)) solid #000;
  background: #5f9aff;
}

.login-or {
  position: absolute;
  left: calc(312 * var(--unit));
  top: calc(1124 * var(--unit));
  width: calc(26 * var(--unit));
  color: #000;
  font-size: calc(26 * var(--unit));
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.forgot-password {
  position: absolute;
  left: calc(280 * var(--unit));
  top: calc(1250 * var(--unit));
  width: calc(91 * var(--unit));
  height: calc(24 * var(--unit));
  background: transparent;
  color: #828282;
  font-size: calc(20 * var(--unit));
  font-weight: 400;
  line-height: calc(24 * var(--unit));
  white-space: nowrap;
}

.feedback-button {
  left: calc(265 * var(--unit));
  bottom: calc(36 * var(--unit));
  width: calc(120 * var(--unit));
  height: calc(37 * var(--unit));
  border-radius: calc(30 * var(--unit));
  background: #fff;
  color: #000;
  font-size: calc(20 * var(--unit));
  font-weight: 800;
  line-height: 1;
  z-index: 12;
}

.login-feedback-modal {
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: calc(28 * var(--unit));
}

.login-feedback-modal[hidden] {
  display: none;
}

.login-feedback-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 18, 36, 0.34);
  backdrop-filter: blur(calc(7 * var(--unit)));
}

.login-feedback-sheet {
  position: relative;
  display: grid;
  width: min(100%, calc(514 * var(--unit)));
  gap: calc(14 * var(--unit));
  border: calc(1 * var(--unit)) solid rgba(0, 0, 0, 0.18);
  border-radius: calc(26 * var(--unit));
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 calc(28 * var(--unit)) calc(70 * var(--unit)) rgba(0, 29, 75, 0.28),
    0 calc(8 * var(--unit)) calc(20 * var(--unit)) rgba(0, 0, 0, 0.12);
  padding: calc(22 * var(--unit));
  animation: feedbackSheetIn 180ms ease-out both;
}

.login-feedback-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--unit));
}

.login-feedback-sheet header span {
  color: #071b33;
  font-size: calc(25 * var(--unit));
  font-weight: 900;
  line-height: 1.2;
}

.login-feedback-sheet header button {
  min-width: calc(72 * var(--unit));
  height: calc(40 * var(--unit));
  border: 0;
  border-radius: calc(28 * var(--unit));
  background: #e6eef8;
  color: #526575;
  font-size: calc(17 * var(--unit));
  font-weight: 800;
  padding: 0 calc(16 * var(--unit));
}

.login-feedback-hint {
  margin: 0;
  color: #526575;
  font-size: calc(18 * var(--unit));
  font-weight: 600;
  line-height: 1.42;
}

.login-feedback-form {
  display: grid;
  gap: calc(10 * var(--unit));
}

.login-feedback-form label {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--unit));
  min-height: calc(48 * var(--unit));
  border: calc(1 * var(--unit)) solid rgba(95, 154, 255, 0.24);
  border-radius: calc(13 * var(--unit));
  background: #f4f8ff;
  color: #071b33;
  font-size: calc(18 * var(--unit));
  font-weight: 800;
  line-height: 1.2;
  padding: 0 calc(14 * var(--unit));
}

.login-feedback-form input {
  flex: 0 0 auto;
  width: calc(18 * var(--unit));
  height: calc(18 * var(--unit));
  accent-color: #5f9aff;
}

.login-feedback-form textarea {
  width: 100%;
  min-height: calc(92 * var(--unit));
  border: calc(1 * var(--unit)) solid rgba(95, 154, 255, 0.28);
  border-radius: calc(16 * var(--unit));
  outline: 0;
  background: #f4f8ff;
  color: #071b33;
  font-size: calc(18 * var(--unit));
  line-height: 1.35;
  padding: calc(14 * var(--unit));
  resize: none;
}

.login-feedback-form textarea::placeholder {
  color: #8a99a8;
}

.login-feedback-submit {
  height: calc(50 * var(--unit));
  border: 0;
  border-radius: calc(30 * var(--unit));
  background: #071b33;
  color: #fff;
  font-size: calc(20 * var(--unit));
  font-weight: 900;
}

.login-toast {
  left: 50%;
  bottom: calc(72 * var(--unit));
  z-index: 40;
  width: max-content;
  max-width: calc(520 * var(--unit));
  border-radius: calc(28 * var(--unit));
  background: rgba(7, 27, 51, 0.94);
  color: #fff;
  font-size: calc(18 * var(--unit));
  font-weight: 800;
  line-height: 1.35;
  padding: calc(12 * var(--unit)) calc(18 * var(--unit));
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 calc(12 * var(--unit)) calc(30 * var(--unit)) rgba(0, 0, 0, 0.22);
}

.login-toast[hidden] {
  display: none;
}

.login-form[data-invalid="true"] .login-field input:invalid,
.login-form[data-invalid="true"] .login-field input {
  box-shadow:
    0 0 0 calc(3 * var(--unit)) rgba(255, 122, 96, 0.86),
    0 0 calc(18 * var(--unit)) rgba(255, 122, 96, 0.25);
}

@media (max-aspect-ratio: 660 / 1434) {
  .login-stage {
    align-items: start;
  }
}

@media (min-aspect-ratio: 660 / 1434) {
  .login-phone {
    height: var(--login-viewport-height);
    width: calc(var(--login-viewport-height) * var(--design-width) / var(--design-height));
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-base,
  .login-base::after,
  .login-sky-gradient,
  .login-card {
    animation: none;
  }
}

@keyframes loginBgDrift {
  0% {
    background-position: 47% 47%;
  }

  45% {
    background-position: 54% 51%;
  }

  100% {
    background-position: 49% 57%;
  }
}

@keyframes loginLightDrift {
  0% {
    opacity: 0.34;
    transform: translate3d(calc(-28 * var(--unit)), calc(-18 * var(--unit)), 0) scale(1);
  }

  100% {
    opacity: 0.68;
    transform: translate3d(calc(30 * var(--unit)), calc(36 * var(--unit)), 0) scale(1.08);
  }
}

@keyframes loginGradientSwell {
  0% {
    opacity: 0.28;
    transform: translate3d(0, calc(-20 * var(--unit)), 0) scaleY(0.98);
  }

  100% {
    opacity: 0.56;
    transform: translate3d(0, calc(28 * var(--unit)), 0) scaleY(1.04);
  }
}

@keyframes cardFloat {
  0%,
  100% {
    box-shadow:
      0 calc(18 * var(--unit)) calc(48 * var(--unit)) rgba(0, 49, 118, 0.18),
      0 calc(4 * var(--unit)) calc(12 * var(--unit)) rgba(0, 0, 0, 0.08);
    transform: translate3d(0, 0, 0);
  }

  50% {
    box-shadow:
      0 calc(30 * var(--unit)) calc(72 * var(--unit)) rgba(0, 49, 118, 0.32),
      0 calc(8 * var(--unit)) calc(18 * var(--unit)) rgba(0, 0, 0, 0.11);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes feedbackSheetIn {
  from {
    opacity: 0;
    transform: translate3d(0, calc(20 * var(--unit)), 0) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
