*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050a14;
  --surface: #0c1424;
  --border: rgba(56, 189, 248, 0.15);
  --accent: #38bdf8;
  --accent2: #0ea5e9;
  --glow: rgba(56, 189, 248, 0.25);
  --text: #e2f3ff;
  --muted: #64748b;
  --error: #f87171;
  --success: #34d399;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  font-family: 'Syne', sans-serif;
  overflow: hidden;
  position: relative;
}

/* === BACKGROUND EFFECTS === */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
          linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
          linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.35;
}
.bg-glow-1 {
  top: -200px; left: -200px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  animation: driftA 12s ease-in-out infinite alternate;
}
.bg-glow-2 {
  bottom: -200px; right: -200px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation: driftB 15s ease-in-out infinite alternate;
}

@keyframes driftA { from { transform: translate(0, 0); } to { transform: translate(60px, 40px); } }
@keyframes driftB { from { transform: translate(0, 0); } to { transform: translate(-50px, -30px); } }

/* Floating particles */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* === CARD === */
.card-wrap {
  position: relative;
  z-index: 10;
  width: 420px;
  animation: slideIn 0.7s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px 36px;
  box-shadow:
          0 0 0 1px rgba(56, 189, 248, 0.05),
          0 24px 60px rgba(0, 0, 0, 0.6),
          inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

/* Top accent bar */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), #6366f1, transparent);
  border-radius: 20px 20px 0 0;
}

/* Subtle inner shimmer */
.card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* === HEADER === */
.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.logo-hex {
  width: 54px; height: 54px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.logo-hex svg {
  position: absolute;
  inset: 0;
  animation: spin 20s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.logo-inner {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.brand {
  margin-left: 14px;
}

.brand-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-sub {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-top: 4px;
  opacity: 0.8;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin-bottom: 28px;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #fca5a5;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  width: 100%;
  justify-content: center;
}

.access-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f87171;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* === FORM === */
.field {
  margin-bottom: 18px;
  position: relative;
}

.field-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
  transition: color 0.2s;
}

.field:focus-within .field-label {
  color: var(--accent);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  width: 16px;
  height: 16px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: color 0.2s;
  flex-shrink: 0;
}

.field:focus-within .field-icon {
  color: var(--accent);
}

.field input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 10px;
  padding: 12px 44px 12px 42px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  letter-spacing: 0.03em;
}

.field input::placeholder {
  color: rgba(100, 116, 139, 0.6);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.field input:focus {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 0 0 3px var(--glow), 0 0 20px rgba(56, 189, 248, 0.08);
}

/* Toggle password */
.toggle-pw {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  outline: none;
}

.toggle-pw:hover {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.toggle-pw svg { width: 16px; height: 16px; }

/* === SUBMIT BUTTON === */
.btn-submit {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none;
  border-radius: 10px;
  color: #050a14;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.45);
  filter: brightness(1.08);
}

.btn-submit:active {
  transform: translateY(0) scale(0.99);
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s;
}

.btn-submit:hover::before { left: 100%; }

.btn-inner {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Loading spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(5, 10, 20, 0.3);
  border-top-color: #050a14;
  border-radius: 50%;
  animation: rotate 0.7s linear infinite;
  display: none;
}

@keyframes rotate { to { transform: rotate(360deg); } }

/* === CONSOLE === */
.console-wrap {
  margin-top: 20px;
  border: 1px solid rgba(56, 189, 248, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.console-header {
  background: rgba(56, 189, 248, 0.06);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-r { background: #f87171; }
.dot-y { background: #fbbf24; }
.dot-g { background: #34d399; animation: blink 2s infinite; }

.console-title {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.08em;
}

.console-body {
  height: 120px;
  overflow-y: auto;
  background: #07111f;
  padding: 10px 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

.console-body::-webkit-scrollbar { width: 4px; }
.console-body::-webkit-scrollbar-track { background: transparent; }
.console-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.log-line { display: flex; gap: 8px; }
.log-time { color: #334155; flex-shrink: 0; }
.log-info  .log-msg { color: #94a3b8; }
.log-ok    .log-msg { color: var(--success); }
.log-warn  .log-msg { color: #fbbf24; }
.log-err   .log-msg { color: var(--error); }
.log-sys   .log-msg { color: var(--accent); }

/* === ERROR MSG === */
.error-msg {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--error);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* === FOOTER === */
.card-footer {
  margin-top: 20px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #334155;
  letter-spacing: 0.06em;
}

.card-footer span { color: var(--muted); }