:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(18, 26, 39, 0.92);
  --panel-2: rgba(11, 17, 27, 0.82);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef4ff;
  --muted: #94a3ba;
  --blue: #78adff;
  --teal: #2fc7bd;
  --green: #74dfa4;
  --red: #ff8a8a;
  --font-ui: "Avenir Next", "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(47, 199, 189, 0.16), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(120, 173, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #070b12 0%, #0b111b 52%, #080c13 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 86%);
}

.auth-shell {
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--teal) 62%, var(--green));
  color: #07111e;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(47, 199, 189, 0.22);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 850;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 44%),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(125, 171, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(125, 171, 255, 0.14);
}

button,
.link-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(135deg, var(--blue), var(--teal) 58%, var(--green));
  color: #06101f;
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(47, 199, 189, 0.2);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.row,
.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.captcha-panel {
  display: grid;
  grid-template-columns: minmax(120px, auto) auto;
  gap: 8px;
  align-items: center;
}

.captcha-question {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.message {
  min-height: 22px;
  color: var(--muted);
  line-height: 1.45;
}

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

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

.switch-line {
  text-align: center;
  color: var(--muted);
}

.switch-line a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 520px) {
  .captcha-row,
  .captcha-panel {
    grid-template-columns: 1fr;
  }
}
