[hidden] {
  display: none !important;
}

:root {
  --auth-ink: #07111c;
  --auth-sky: #38bdf8;
  --auth-amber: #f59e0b;
}

body:not(.is-authenticated) {
  background: var(--auth-ink);
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(56, 189, 248, 0.22), transparent 34%),
    radial-gradient(circle at 86% 78%, rgba(245, 158, 11, 0.18), transparent 36%),
    linear-gradient(155deg, #07111c 0%, #0c1b2a 48%, #132f4c 100%);
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.auth-brand {
  position: absolute;
  z-index: 4;
  top: 30px;
  left: max(30px, calc((100vw - 1180px) / 2));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font: 700 24px/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.auth-brand img {
  display: block;
}

.auth-layout {
  position: relative;
  z-index: 3;
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 90px;
  align-items: center;
  margin-inline: auto;
  padding: 130px 0 70px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.auth-intro h1 {
  font: 700 3.2rem/1.05 "Space Grotesk", sans-serif;
  letter-spacing: -0.045em;
  margin-bottom: 1rem;
}

.auth-intro h1 em {
  font-style: normal;
  color: var(--auth-sky);
}

.auth-intro > p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.05rem;
  max-width: 34rem;
  line-height: 1.65;
}

.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.auth-proof div {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
}

.auth-proof strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  margin-bottom: 0.25rem;
}

.auth-proof span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.login-card {
  background: #fff;
  color: #0c1b2a;
  border-radius: 18px;
  padding: 1.4rem 1.35rem 1.1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.login-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #0c1b2a;
  color: #f59e0b;
  font-weight: 800;
}

.login-card-head p {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: rgba(12, 27, 42, 0.45);
}

.login-card-head h2 {
  font: 700 1.2rem/1.2 "Space Grotesk", sans-serif;
}

.login-hint {
  color: rgba(12, 27, 42, 0.62);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.login-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.login-card input {
  width: 100%;
  border: 1.5px solid rgba(12, 27, 42, 0.14);
  border-radius: 11px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.55rem;
}

.code-input {
  letter-spacing: 0.35em;
  font-weight: 700;
  font-size: 1.15rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 11px;
  padding: 0.85rem 1rem;
  background: #0c1b2a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  gap: 0.4rem;
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-error {
  min-height: 1.2rem;
  color: #b42318;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.demo-code {
  background: rgba(245, 158, 11, 0.14);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
}

.back-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: rgba(12, 27, 42, 0.55);
  font-weight: 650;
  margin-bottom: 0.75rem;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(12, 27, 42, 0.08);
  font-size: 0.75rem;
  color: rgba(12, 27, 42, 0.45);
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.orbit-a {
  width: 520px;
  height: 520px;
  left: -120px;
  top: 12%;
  animation: spin 48s linear infinite;
}

.orbit-b {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: 8%;
  animation: spin 36s linear infinite reverse;
}

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

.auth-node {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.node-one { left: 18%; top: 22%; }
.node-two { left: 28%; top: 68%; }
.node-three { right: 42%; top: 18%; }
.node-four { right: 38%; bottom: 22%; }

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 100px;
  }

  .auth-intro h1 {
    font-size: 2.4rem;
  }

  .auth-proof {
    grid-template-columns: 1fr;
  }
}
