/* =====================================================================
   NEURA — Sign in (.auth-*)
   Full-screen gate shown above the workspace until M9 confirms a session.
   Reuses the .atmos-panel glass recipe and the global text tokens so this
   reads as the same product, not a bolted-on form. Scene tokens are declared
   here rather than borrowed from world-select.css so sign-in stands alone.
   ===================================================================== */
.auth-root {
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow: hidden;
  --auth-bg: #060609;
  --auth-text-primary: var(--text-primary);
  --auth-text-secondary: var(--text-secondary);
  --auth-text-tertiary: var(--text-muted);
  background-color: var(--auth-bg);
  color: var(--auth-text-primary);
  font-family: "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
}

/* Schooling light particles. Sits under the form, above the flat backdrop. */
.auth-shoal {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-logo {
  position: absolute;
  top: 5%;
  left: 4%;
  z-index: 3;
  display: flex;
  align-items: center;
}
.auth-logo__img {
  height: 18px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.auth-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: clamp(28px, 6vh, 64px) clamp(24px, 6vw, 120px);
  text-align: center;
}

.auth-headline {
  font-size: clamp(30px, 3.6vw, 35px);
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: var(--auth-text-primary);
}
.auth-subhead {
  margin-top: clamp(8px, 1.6vh, 18px);
  font-size: 16px;
  font-weight: 300;
  color: var(--auth-text-secondary);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: clamp(28px, 4vh, 44px);
  padding: 32px;
  width: min(380px, 100%);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(38, 42, 41, 0.6) 0%, rgba(26, 30, 29, 0.58) 100%);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-field__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--auth-text-tertiary);
}
.auth-field__input {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(10, 12, 11, 0.45);
  color: var(--auth-text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.auth-field__input::placeholder {
  color: var(--text-muted);
}
.auth-field__input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(10, 12, 11, 0.65);
}
.auth-field__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* First and last name share a row so the sign-up card stays one screen tall. */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* Grid items default to min-width: auto, so the tracks refuse to shrink below
   the input's intrinsic width (its default size attribute, ~20 characters) and
   the row overhangs the card. */
.auth-row > .auth-field {
  min-width: 0;
}

.auth-switch {
  margin: 2px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--auth-text-secondary);
}
.auth-switch__btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--auth-text-primary);
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-switch__btn:hover:not(:disabled) {
  opacity: 0.75;
}
.auth-switch__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-error {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--accent-red);
}

.auth-submit {
  margin-top: 4px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--auth-text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.auth-submit:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}
.auth-submit:disabled {
  opacity: 0.55;
  cursor: progress;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px;
  }
  .auth-stage {
    justify-content: flex-start;
    padding-top: 18vh;
  }
  .auth-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field__input,
  .auth-submit {
    transition: none;
  }
}
