@font-face {
  font-family: "DIN Medium";
  src: url("assets/login/DIN-Medium.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

:root {
  color-scheme: dark;
  --login-background: #1f2128;
  --login-foreground: #ffffff;
  --login-muted: #b2b3bd;
  --login-surface: #242731;
  --login-border: #36383e;
  --login-accent: #ff5722;
  --login-font: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
  --login-scale: .92;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--login-background);
  color: var(--login-foreground);
  font-family: var(--login-font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--login-accent);
  outline-offset: 3px;
}

.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;
}

.login-page {
  position: fixed;
  inset: 0;
  min-width: 320px;
  min-height: 560px;
}

.login-background {
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

.login-card {
  position: fixed;
  z-index: 2;
  inset: 0;
  display: flex;
  width: 542px;
  height: 649px;
  margin: auto;
  padding: 56px 40px 49px;
  border: 1px solid color-mix(in srgb, var(--login-foreground) 10%, transparent);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(61, 63, 75, .97) 0%, rgba(36, 34, 45, .97) 100%);
  align-items: center;
  flex-direction: column;
  transform: scale(var(--login-scale));
}

.login-logo {
  display: block;
  width: 228px;
  height: 80px;
  flex: none;
}

.login-logo img {
  display: block;
  width: 228px;
  height: 80px;
  object-fit: cover;
  object-position: center;
}

.login-form {
  position: static;
  display: flex;
  width: 100%;
  flex-direction: column;
}

.login-field {
  display: flex;
  width: 100%;
  height: 74px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--login-foreground) 10%, transparent);
  align-items: center;
  gap: 16px;
}

.login-field:first-of-type {
  margin-top: 38px;
}

.login-field + .login-field {
  margin-top: 38px;
}

.login-field:focus-within {
  border-color: color-mix(in srgb, var(--login-foreground) 28%, transparent);
}

.login-field.is-invalid {
  border-color: var(--login-accent);
}

.login-field-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
}

.login-input {
  display: block;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--login-foreground);
  flex: 1 1 auto;
  font-size: 16px;
  line-height: 1;
}

.login-input::placeholder {
  color: color-mix(in srgb, var(--login-muted) 44%, transparent);
  opacity: 1;
}

.password-toggle {
  display: flex;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.password-toggle img {
  display: block;
  width: 24px;
  height: 24px;
}

.login-error {
  position: absolute;
  top: 366px;
  right: 40px;
  left: 40px;
  margin: 0;
  color: var(--login-accent);
  font-size: 12px;
  line-height: 20px;
  text-align: left;
}

.login-options {
  display: flex;
  width: 100%;
  height: 24px;
  margin-top: 40px;
  align-items: center;
  justify-content: space-between;
}

.remember-control {
  display: flex;
  min-height: 44px;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.remember-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.remember-box {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  background: url("assets/login/checkbox.svg") center / 24px 24px no-repeat;
  flex: none;
}

.remember-control input:checked + .remember-box {
  border: 1px solid var(--login-accent);
  border-radius: 6px;
  background: var(--login-accent);
}

.remember-control input:checked + .remember-box::after {
  position: absolute;
  top: 4px;
  left: 7px;
  width: 7px;
  height: 12px;
  border-right: 2px solid var(--login-foreground);
  border-bottom: 2px solid var(--login-foreground);
  content: "";
  transform: rotate(45deg);
}

.remember-control input:focus-visible + .remember-box {
  outline: 2px solid var(--login-accent);
  outline-offset: 3px;
}

.login-options span,
.forgot-password {
  font-size: 16px;
  line-height: 24px;
}

.forgot-password {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.login-submit {
  display: flex;
  width: 100%;
  height: 80px;
  margin-top: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ab612e 0%, #aa3b17 100%);
  color: var(--login-muted);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.login-submit[disabled] {
  cursor: wait;
  opacity: .72;
}

.login-footer {
  display: flex;
  width: 100%;
  height: 24px;
  margin-top: 40px;
  align-items: center;
  justify-content: space-between;
}

.service-link,
.register-copy {
  display: flex;
  min-height: 44px;
  border: 0;
  background: transparent;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
}

.service-link {
  padding: 0 10px;
  gap: 10px;
}

.service-link img {
  display: block;
  width: 24px;
  height: 24px;
}

.register-copy {
  padding: 0 12px 0 0;
  color: var(--login-muted);
  gap: 8px;
}

.register-copy strong {
  color: var(--login-foreground);
  font-weight: 400;
}

@media (hover: hover) {
  .forgot-password:hover,
  .service-link:hover,
  .register-copy:hover {
    color: var(--login-foreground);
  }

  .login-submit:hover {
    filter: brightness(1.08);
  }
}

@media (max-height: 780px), (max-width: 760px) {
  :root {
    --login-scale: .85;
  }
}

@media (max-width: 520px) {
  :root {
    --login-scale: .68;
  }

  .login-page {
    min-height: 500px;
  }
}

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