@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/vendor/fonts/space-grotesk-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/vendor/fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/vendor/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/vendor/fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0C1A2B;
  --muted: #68788E;
  --line: #DEE5EF;
  --navy: #10243D;
  --navy-deep: #081422;
  --accent: #C9F24D;
  --accent-ink: #1D2B10;
  --teal: #0E9C85;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.auth-page {
  font-family: var(--font);
  background: #F3F5F9;
  color: var(--ink);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

.auth-shell { display: grid; grid-template-columns: 56% 44%; min-height: 100vh; }

/* ============ Visual Side ============ */
.auth-visual {
  position: relative;
  background:
    radial-gradient(circle at 15% 12%, rgba(201,242,77,.11), transparent 32%),
    radial-gradient(circle at 90% 85%, rgba(46,107,230,.13), transparent 40%),
    linear-gradient(145deg, #0B1727 0%, #10243D 55%, #0D2036 100%);
  color: #fff;
  padding: 34px 40px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 720px;
}
.visual-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.038) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 78%);
}
.visual-grid::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 37%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,242,77,.3), transparent);
}
.visual-scan {
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  top: -140px;
  background: linear-gradient(to bottom, transparent, rgba(201,242,77,.035), transparent);
  animation: scanMove 9s linear infinite;
}
@keyframes scanMove { 0% { top: -140px; } 100% { top: 110%; } }

.visual-top { position: relative; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.visual-brand { display: flex; align-items: center; gap: 9px; color: var(--accent); }
.visual-brand svg { width: 29px; height: 29px; }
.visual-brand b { font-family: var(--font-display); font-size: 13px; letter-spacing: .18em; font-weight: 700; }
.visual-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em;
  color: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 3px;
  padding: 3px 7px;
}
.visual-status i { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px rgba(201,242,77,.12); }

.visual-core { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; min-height: 270px; }
.core-radar {
  width: 320px; height: 320px;
  position: relative;
  border-radius: 50%;
  display: grid; place-items: center;
}
.radar-ring {
  position: absolute;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
}
.radar-ring.r1 { inset: 0; }
.radar-ring.r2 { inset: 52px; border-color: rgba(201,242,77,.14); }
.radar-ring.r3 { inset: 104px; border-color: rgba(255,255,255,.12); }
.radar-ring.r1::before, .radar-ring.r2::before, .radar-ring.r3::before {
  content: ""; position: absolute; left: 50%; top: -3px; width: 5px; height: 5px; background: rgba(201,242,77,.55); border-radius: 50%;
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(201,242,77,.22), transparent 22%, transparent);
  animation: sweep 7s linear infinite;
  mask-image: radial-gradient(circle, transparent 20%, #000 21%, #000 100%);
}
@keyframes sweep { to { transform: rotate(360deg); } }
.core-center {
  position: relative; z-index: 2; text-align: center;
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(16,36,61,.85), rgba(8,20,34,.6));
  border: 1px solid rgba(201,242,77,.25);
  box-shadow: 0 0 40px rgba(201,242,77,.07), inset 0 0 30px rgba(201,242,77,.05);
}
.core-center b { font-family: var(--font-display); font-size: 31px; color: var(--accent); letter-spacing: -.5px; }
.core-center em { font-style: normal; font-size: 9px; color: rgba(255,255,255,.48); letter-spacing: .12em; margin-top: 1px; }
.node {
  position: absolute;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: rgba(255,255,255,.42);
  white-space: nowrap;
  z-index: 2;
}
.node i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(201,242,77,.08); }
.node.n1 { top: 18px; left: 12px; }
.node.n2 { top: 74px; right: -14px; }
.node.n3 { bottom: 26px; right: 6px; }
.node.n4 { bottom: 88px; left: -22px; }
.node.n2 i, .node.n4 i { background: #5BB8FF; box-shadow: 0 0 0 4px rgba(91,184,255,.09); }

.visual-copy { position: relative; z-index: 2; max-width: 520px; }
.visual-kicker { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .22em; color: rgba(201,242,77,.7); margin-bottom: 10px; }
.visual-copy h1 { font-size: 38px; line-height: 1.22; font-weight: 700; letter-spacing: .5px; margin: 0; }
.visual-copy h1 span { color: var(--accent); }
.visual-copy p { font-size: 12px; line-height: 1.9; color: rgba(255,255,255,.52); margin: 13px 0 0; max-width: 440px; }
.visual-points { display: flex; gap: 18px; margin-top: 20px; flex-wrap: wrap; }
.visual-points div { display: flex; align-items: center; gap: 6px; font-size: 10px; color: rgba(255,255,255,.62); }
.visual-points i { color: var(--accent); font-size: 13px; }
.visual-foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 9.5px;
  color: rgba(255,255,255,.3);
}
.visual-code { font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; }

/* ============ Form Side ============ */
.auth-form-side {
  position: relative;
  background:
    linear-gradient(rgba(16,36,61,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,36,61,.018) 1px, transparent 1px),
    #F7F9FC;
  background-size: 26px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
}
.auth-corner { position: absolute; width: 26px; height: 26px; border-color: rgba(16,36,61,.22); }
.auth-corner.tl { left: 26px; top: 26px; border-left: 1px solid; border-top: 1px solid; }
.auth-corner.br { right: 26px; bottom: 26px; border-right: 1px solid; border-bottom: 1px solid; }
.auth-form-wrap { width: 100%; max-width: 354px; position: relative; z-index: 1; }
.auth-eyebrow { font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; color: var(--teal); }
.auth-head h2 { font-size: 26px; font-weight: 700; margin: 7px 0 5px; letter-spacing: .5px; }
.auth-head p { font-size: 11px; color: var(--muted); margin: 0 0 22px; line-height: 1.7; }

.auth-alert {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 11px;
  border-radius: 4px;
  font-size: 10.5px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.auth-alert.error { background: #FFF3F3; border: 1px solid rgba(214,67,67,.22); color: #B73535; }
.auth-alert.success { background: #F1FBF6; border: 1px solid rgba(14,156,133,.22); color: #0B806D; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 10.5px; font-weight: 600; color: #34445A; letter-spacing: .2px; }
.field-box {
  display: flex; align-items: center; gap: 8px;
  height: 41px;
  padding: 0 11px;
  border: 1px solid #D5DFEA;
  border-radius: 4px;
  background: #fff;
  transition: .16s;
}
.field-box:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16,36,61,.06); }
.field-box > i { font-size: 14px; color: #8D9BAE; }
.field-box input, .field-box select {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 12.5px; height: 100%;
}
.field-box input::placeholder { color: #A6B2C1; font-size: 11.5px; }
.field-box select { cursor: pointer; color: var(--ink); }
.field-action {
  border: 0; background: transparent; color: #8D9BAE; padding: 2px; display: grid; place-items: center;
}
.field-action:hover { color: var(--navy); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.auth-safe { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #8D9BAE; }
.auth-safe i { font-size: 11px; }
.auth-link { font-size: 10.5px; color: var(--teal); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-submit {
  height: 43px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-top: 2px;
  transition: .18s;
  box-shadow: 0 4px 0 rgba(8,20,34,.13);
}
.auth-submit i { color: var(--accent); font-size: 14px; transition: transform .18s; }
.auth-submit:hover { background: var(--navy-deep); }
.auth-submit:hover i { transform: translateX(3px); }
.auth-hint {
  display: flex; gap: 6px; align-items: flex-start;
  margin-top: 18px;
  padding: 9px 10px;
  border: 1px dashed #D9E2EC;
  border-radius: 4px;
  font-size: 9.5px;
  color: #8D9BAE;
  line-height: 1.6;
  background: rgba(255,255,255,.55);
}
.auth-hint i { color: #AEBAC8; font-size: 11px; margin-top: 1px; }
.auth-foot {
  display: flex; justify-content: space-between;
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid #E2E9F1;
  font-size: 8.5px;
  color: #A6B2C1;
}

/* ============ Register ============ */
.register-mode .auth-form-side { align-items: flex-start; padding-top: 34px; padding-bottom: 28px; }
.register-wrap { max-width: 470px; }
.register-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.register-form .field-box { height: 38px; }
.register-form .field-box input, .register-form .field-box select { font-size: 11.5px; }
.register-form .auth-submit { width: 100%; margin-top: 16px; }
.auth-switch { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 14px; }
.auth-switch a { color: var(--teal); font-weight: 500; margin-left: 3px; }
.auth-switch a:hover { text-decoration: underline; }
.register-copy .visual-copy h1 { font-size: 34px; }
.register-flow { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.register-flow > i { color: rgba(255,255,255,.22); font-size: 11px; }
.flow-step {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px;
  color: rgba(255,255,255,.36);
}
.flow-step span {
  width: 19px; height: 19px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 7.5px;
}
.flow-step.done { color: rgba(201,242,77,.85); }
.flow-step.done span { border-color: rgba(201,242,77,.45); background: rgba(201,242,77,.08); color: var(--accent); }

@media (max-width: 1180px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-side { min-height: 100vh; }
  .auth-shell.register-mode .auth-form-side { padding-top: 44px; }
}
@media (max-width: 560px) {
  .auth-form-side { padding: 32px 20px; }
  .auth-form-wrap { max-width: 100%; }
  .register-form .form-grid { grid-template-columns: 1fr; }
  .auth-corner { display: none; }
  .auth-head h2 { font-size: 23px; }
}
