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

:root {
  --bg: #06060f;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --text-muted: #5a5a75;
  --accent-blue: #4f8fff;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06d6a0;
  --accent-red: #ff6b6b;
  --border: rgba(255, 255, 255, 0.08);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 20% 0%,   rgba(79, 143, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 55% 50% at 80% 15%,  rgba(139, 92, 246, 0.16), transparent 65%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(6, 214, 160, 0.12),  transparent 70%);
}

.grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.07);
  white-space: pre;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  padding: 4px 6px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 55%, transparent 100%);
}

.auth {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  gap: 28px;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  background: linear-gradient(135deg, #ffffff, #cdd6ff 45%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand span { font-weight: 300; }

.card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  border: 1px solid var(--border);
  background: rgba(15, 15, 30, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.card .sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}

form label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin: 14px 0 6px;
  text-transform: uppercase;
}

form input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
form input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

form .hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cf-turnstile { margin: 18px 0 4px; }

button.btn {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(79, 143, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
button.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(139, 92, 246, 0.38); }
button.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.msg {
  margin-top: 14px;
  font-size: 0.85rem;
  min-height: 1.2em;
  line-height: 1.5;
}
.msg.ok  { color: var(--accent-cyan); }
.msg.err { color: var(--accent-red); }

.foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}
.foot a { color: var(--text-dim); text-decoration: none; margin: 0 6px; }
.foot a:hover { color: var(--text); }

.status-box {
  text-align: center;
  padding: 24px 0 8px;
}
.status-box .icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}
.status-box p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}
.status-box .icon.ok  { color: var(--accent-cyan); }
.status-box .icon.err { color: var(--accent-red); }

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