:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #a9b6c4;
  --panel: rgba(7, 13, 21, 0.84);
  --panel-border: rgba(201, 219, 234, 0.2);
  --ice: #9edfff;
  --ice-strong: #4dc4fb;
  --gold: #e8c77f;
  --success: #79e8bc;
  --danger: #ffaaaa;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background: #05080d;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

.background,
.background-shade {
  position: fixed;
  inset: 0;
}

.background {
  z-index: -2;
  background-image: url("/assets/wlk-triumvirate.webp");
  background-position: center;
  background-size: cover;
}

.background-shade {
  z-index: -1;
  background:
    radial-gradient(circle at center, rgba(2, 7, 12, 0.18) 0%, rgba(2, 7, 12, 0.02) 28%, rgba(1, 4, 7, 0.28) 100%),
    linear-gradient(to bottom, rgba(1, 4, 8, 0.06), rgba(1, 4, 8, 0.28));
}

.server-state {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 3;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: #d1d9e1;
  background: rgba(4, 9, 15, 0.72);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  font-size: 13px;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #93a1ad;
  box-shadow: 0 0 0 5px rgba(147, 161, 173, 0.09);
}

.server-state.online .state-dot {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(121, 232, 188, 0.11), 0 0 16px rgba(121, 232, 188, 0.8);
}

main {
  display: grid;
  width: 100%;
  min-height: 100svh;
  place-items: center;
  padding: 82px 20px 28px;
}

.registration-card {
  width: min(430px, 100%);
  padding: 34px 36px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(1.08);
}

h1 {
  margin: 0 0 24px;
  color: #f4f7fa;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei", sans-serif;
  font-size: clamp(34px, 7vw, 43px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 2px 22px rgba(102, 196, 246, 0.2);
}

form {
  display: grid;
  gap: 8px;
}

label {
  margin-top: 4px;
  color: #d5dde5;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(192, 212, 228, 0.24);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: rgba(1, 6, 11, 0.68);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #778695;
}

input:focus {
  border-color: var(--ice-strong);
  box-shadow: 0 0 0 4px rgba(77, 196, 251, 0.12);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 10px;
}

.captcha-image-button {
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(192, 212, 228, 0.24);
  border-radius: 9px;
  background: #101b28;
  cursor: pointer;
}

.captcha-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.submit-button {
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 9px;
  color: #07111a;
  background: linear-gradient(105deg, var(--gold), #fff0b3 50%, var(--ice));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.submit-button:hover,
.captcha-image-button:hover {
  filter: brightness(1.08);
}

.submit-button:hover {
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid rgba(158, 223, 255, 0.55);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.7;
  transform: none;
}

.form-message {
  min-height: 22px;
  margin-top: 2px;
  font-size: 13px;
  text-align: center;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: flex-end;
  margin-top: 2px;
}

.client-download,
.data-query-link {
  margin-top: 2px;
  color: var(--ice);
  font-size: 13px;
  text-decoration: none;
}

.client-download:hover,
.data-query-link:hover {
  color: #d7f3ff;
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .server-state {
    top: 14px;
    right: 14px;
  }

  main {
    padding: 70px 14px 18px;
  }

  .registration-card {
    padding: 27px 22px 22px;
    border-radius: 18px;
  }

  h1 {
    margin-bottom: 20px;
  }

  .captcha-row {
    grid-template-columns: minmax(0, 1fr) 132px;
  }
}

@media (max-height: 720px) and (min-width: 561px) {
  main {
    place-items: start center;
    padding-top: 74px;
  }

  .registration-card {
    padding-top: 26px;
    padding-bottom: 22px;
  }

  h1 {
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
