:root {
  --void: #E2E8F0;
  --navy: #FFFFFF;
  --indigo: #475569;
  --glow: rgba(71, 85, 105, 0.08);
  --line: rgba(71, 85, 105, 0.18);
  --line-strong: #0F172A;
  --ice: #334155;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ice);
  background:
    radial-gradient(circle at 50% 48%, rgba(71, 85, 105, 0.06), transparent 45%),
    linear-gradient(180deg, var(--navy) 0%, var(--void) 100%);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(71, 85, 105, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 85, 105, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 72%);
}

.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8vh 24px 24px 24px;
}

.gate-form {
  width: min(90vw, 420px);
  display: grid;
}

.sigil-container {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.sigil {
  position: relative;
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  filter: drop-shadow(0 8px 24px rgba(71, 85, 105, 0.12));
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  box-shadow:
    0 0 20px var(--glow),
    inset 0 0 16px rgba(71, 85, 105, 0.03);
}

.ring::before,
.ring::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1.5px solid rgba(71, 85, 105, 0.16);
  border-radius: 50%;
}

.ring::after {
  inset: 22%;
  border-style: dashed;
  border-color: rgba(71, 85, 105, 0.25);
}

.ring-outer {
  animation: spin-cw 20s linear infinite;
}

.ring-inner {
  inset: 15%;
  border-color: rgba(71, 85, 105, 0.45);
  animation: spin-ccw 14s linear infinite;
}

.core-dot {
  width: 10px;
  height: 10px;
  background-color: var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

.login-card {
  width: 100%;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(71, 85, 105, 0.12);
  border-radius: 12px;
  box-shadow: 
    0 20px 40px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(15, 23, 42, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: grid;
  gap: 30px;
}

.fields-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.step-section {
  display: grid;
  gap: 16px;
  width: 100%;
}

.field-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-label {
  width: 120px;
  text-align: right;
  font-weight: 500;
  font-size: 14px;
  color: var(--ice);
  opacity: 0.85;
}

.fields-wrapper input {
  flex: 1;
  width: 100%;
  height: 42px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0 14px;
  outline: 0;
  color: var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  font-family: inherit;
}

.fields-wrapper input:focus {
  border-color: #64748B;
  background: #FFFFFF;
  box-shadow:
    0 0 0 4px rgba(71, 85, 105, 0.06),
    0 0 16px rgba(71, 85, 105, 0.04);
}

.submit-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, var(--indigo) 0%, #334155 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.12);
  transition: all 0.2s ease;
  font-family: inherit;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
  box-shadow: 0 6px 16px rgba(30, 41, 59, 0.18);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.12);
}

.submit-btn:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 400px) {
  .field-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .field-label {
    text-align: left;
    width: auto;
  }
}

body.devtools-open .gate {
  filter: blur(18px) saturate(0.3);
  pointer-events: none;
}

@keyframes spin-cw {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-ccw {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.88;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@media (max-height: 620px) {
  body {
    overflow-y: auto;
  }

  .gate {
    align-items: start;
  }
}
