* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #04070f;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --text: #e5f3ff;
  --muted: #7e93ad;
  --line: rgba(103, 232, 249, 0.18);
  --panel: rgba(10, 18, 34, 0.58);
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.bg-grid {
  position: fixed;
  inset: -50%;
  z-index: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(58deg);
  animation: grid-move 14s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
}

@keyframes grid-move {
  to {
    transform: perspective(600px) rotateX(58deg) translateY(56px);
  }
}

.bg-glow {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
}

.glow-1 {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 65%);
  top: -160px;
  left: -120px;
  animation: float-a 9s ease-in-out infinite alternate;
}

.glow-2 {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35), transparent 65%);
  bottom: -180px;
  right: -140px;
  animation: float-b 11s ease-in-out infinite alternate;
}

@keyframes float-a {
  to {
    transform: translate(60px, 40px) scale(1.12);
  }
}

@keyframes float-b {
  to {
    transform: translate(-50px, -30px) scale(1.08);
  }
}

.auth-wrap {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
}

.brand {
  text-align: center;
}

.brand-mark {
  font-size: 58px;
  font-weight: 800;
  letter-spacing: 10px;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--cyan);
  text-shadow:
    0 0 18px rgba(34, 211, 238, 0.8),
    0 0 46px rgba(167, 139, 250, 0.55);
}

.brand-mark span {
  color: transparent;
  -webkit-text-stroke: 1px var(--violet);
}

.brand-slogan {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
}

.panel {
  position: relative;
  width: min(420px, 92vw);
  padding: 34px 36px 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(34, 211, 238, 0.04);
  animation: panel-in 0.7s ease both;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border: 2px solid var(--cyan);
  opacity: 0.8;
  pointer-events: none;
}

.panel::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 16px;
}

.panel::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 16px;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 26px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  padding: 11px 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, text-shadow 0.25s;
}

.tab.active {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.7);
  background: rgba(34, 211, 238, 0.08);
}

.form {
  display: none;
}

.form.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: form-in 0.35s ease;
}

@keyframes form-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  padding-right: 44px;
  background: rgba(4, 10, 22, 0.75);
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.field input:focus {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.14),
    0 0 18px rgba(34, 211, 238, 0.18);
  background: rgba(8, 18, 36, 0.9);
}

.field input::placeholder {
  color: #52657d;
}

.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 6px;
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
}

.eye:hover,
.eye.show {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
  line-height: 1.6;
}

.btn-submit {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #02131a;
  background: linear-gradient(135deg, var(--cyan), #38bdf8 55%, var(--violet));
  box-shadow: 0 8px 26px rgba(34, 211, 238, 0.35);
  transition: transform 0.2s, box-shadow 0.25s, filter 0.25s;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 12px 34px rgba(34, 211, 238, 0.5),
    0 0 30px rgba(167, 139, 250, 0.35);
  filter: brightness(1.08);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.75;
  cursor: wait;
}

.btn-submit.loading {
  letter-spacing: 3px;
}

.message {
  min-height: 20px;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #f87171;
  letter-spacing: 0.5px;
}

.message.ok {
  color: var(--green);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.auth-footer {
  position: absolute;
  bottom: 18px;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(126, 147, 173, 0.6);
  font-family: "Consolas", "Courier New", monospace;
}

@media (max-width: 520px) {
  .brand-mark {
    font-size: 44px;
  }
  .panel {
    padding: 26px 22px 24px;
  }
}
