:root {
  --page-bg: #242645;
  --input-text: #d3d7f7;
  --accent: #01aaed;
  --danger: #ff4d4f;
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 0; min-height: 100%; margin: 0; }
body { min-height: 100vh; overflow-x: hidden; color: #d3d7f7; background: var(--page-bg); }
button, input { font: inherit; }

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-page {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 24px 12px;
  place-items: center;
}

.login-card {
  width: 400px;
  max-width: calc(100vw - 24px);
  min-height: 430px;
  padding: 50px 40px 40px;
  background: linear-gradient(230deg, rgba(53, 57, 74, 0) 0%, #000 100%);
  box-shadow: rgba(6, 17, 47, .7) -15px 15px 15px;
}

.login-card h1 { margin: 0 0 20px; font-size: 20px; font-weight: 400; }
#loginForm { margin: 0; }
.login-field { position: relative; display: block; height: 47px; margin-top: 15px; }
.field-icon { position: absolute; z-index: 2; top: 16px; left: 4px; max-width: 17px; max-height: 16px; opacity: .5; }
.validation-icon { position: absolute; z-index: 2; top: 20px; right: 22px; width: 11px; height: 8px; opacity: .9; }

.login-field input {
  width: 100%;
  height: 47px;
  padding: 10px 42px 10px 34px;
  border: 0;
  border-bottom: 1px solid rgba(97, 191, 255, .13);
  border-radius: 0;
  outline: 0;
  color: var(--input-text);
  background: transparent;
  font-size: 16px;
}
.login-field input::placeholder { color: rgba(211, 215, 247, .8); }
.login-field input:focus { border-bottom-color: rgba(97, 191, 255, .75); box-shadow: 0 1px 0 rgba(97, 191, 255, .18); }
.login-field input[aria-invalid="true"] { border-bottom-color: var(--danger); }

.captcha-field { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
.captcha-field label { position: relative; min-width: 0; }
.captcha-field input { padding-right: 8px; }
#captchaButton {
  align-self: center;
  width: 100px;
  height: 30px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
}
#captchaCanvas { display: block; width: 100px; height: 30px; }
#captchaButton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.login-status { min-height: 18px; margin: 3px 0 0; color: var(--danger); font-size: 12px; line-height: 18px; }
.login-status.is-success { color: #5fb878; }
.login-actions { display: flex; align-items: flex-start; flex-direction: column; }
#loginButton {
  width: 66px;
  height: 38px;
  padding: 0;
  border: 1px solid #c9c9c9;
  border-radius: 100px;
  color: #555;
  background: #fff;
  cursor: pointer;
}
#loginButton:hover { border-color: #c1c7c7; color: #5c5c5c; background: #f5fcfe; }
#loginButton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#registerLink { margin: 6px 0 0 4px; color: #ff4242; font-size: 14px; text-decoration: none; }
#registerLink:hover { color: #ff4242; text-decoration: none; }
#registerLink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-support { margin: 17px 0 0; color: #f33; font-size: 11px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .login-page { min-height: 100svh; padding: 18px 12px; }
  .login-card { width: min(400px, calc(100vw - 24px)); min-height: 0; padding: 42px 32px 34px; }
  .login-support { white-space: normal; line-height: 1.5; }
}

@media (max-width: 360px) {
  .login-card { padding-inline: 24px; }
}

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