/* Auth pages + modal — shared across all Multiverse brands */

.auth-body {
  min-height: 100vh;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 48px;
  overflow: hidden;
}

.auth-page__aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(0, 212, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 45% 35% at 80% 20%, rgba(123, 97, 255, 0.28), transparent 50%),
    radial-gradient(ellipse 40% 40% at 60% 80%, rgba(255, 110, 199, 0.18), transparent 55%);
  animation: auth-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.auth-page__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}
.auth-page__orb--a {
  width: 220px;
  height: 220px;
  left: 12%;
  top: 18%;
  background: var(--accent-a, #00d4ff);
  animation: auth-float 9s ease-in-out infinite;
}
.auth-page__orb--b {
  width: 280px;
  height: 280px;
  right: 10%;
  bottom: 12%;
  background: var(--accent-b, #7b61ff);
  animation: auth-float 11s ease-in-out infinite reverse;
}

@keyframes auth-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, -3%, 0) scale(1.05); }
}
@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

.auth-page__brand {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg, #0d0f14);
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  z-index: 2;
}
.auth-page__mark {
  background: var(--infinity-grad, linear-gradient(135deg, #00d4ff, #7b61ff, #ff6ec7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.4rem;
}

.auth-card,
.auth-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  background: var(--bg-glass, rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.09));
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  padding: 22px 24px 26px;
}

html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .auth-modal__dialog {
  background: rgba(18, 20, 28, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-card__tabs,
.auth-modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--bg-surface-2, #f0f4f9);
}

.auth-card__tab,
.auth-modal__tab {
  border: 0;
  background: transparent;
  color: var(--fg-muted, #718096);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-card__tab.is-active,
.auth-modal__tab.is-active {
  background: var(--bg-surface, #fff);
  color: var(--fg, #0d0f14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-card__title,
.auth-modal__title {
  margin: 0 0 6px;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.auth-card__lede,
.auth-modal__lede {
  margin: 0 0 18px;
  color: var(--fg-muted, #718096);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-modal__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.auth-modal__cta--primary {
  color: #fff;
  background: var(--btn, linear-gradient(135deg, #00a8ff, #7b61ff));
  border: 0;
  box-shadow: 0 8px 22px rgba(0, 168, 255, 0.22);
}

.auth-modal__cta--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.auth-modal__cta--secondary {
  color: var(--fg, #0d0f14);
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border, rgba(0, 0, 0, 0.12));
}

.auth-modal__cta--secondary:hover {
  background: var(--bg-surface-2, #f0f4f9);
  transform: translateY(-1px);
}

.auth-card__error,
.auth-modal__error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  font-size: 0.88rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-2, #4a5568);
  letter-spacing: 0.02em;
}

.auth-field__req {
  color: #e11d48;
  font-weight: 700;
}

.auth-form__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--fg-muted, #718096);
}

.auth-field__input {
  width: 100%;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.09));
  background: var(--bg-surface, #fff);
  color: var(--fg, #0d0f14);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field__input:focus {
  border-color: var(--border-focus, #00a8ff);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.18);
}

.auth-form__submit {
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--btn-fg, #fff);
  background: var(--btn, linear-gradient(135deg, #00a8ff, #7b61ff));
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s, opacity 0.12s;
}

.auth-form__submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.auth-form__submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.auth-card__footer {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--fg-muted, #718096);
}

.auth-card__footer a {
  color: var(--link, #0055cc);
  font-weight: 600;
  text-decoration: none;
}

/* ---- Modal ---- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(8, 10, 18, 0.52);
  backdrop-filter: blur(6px);
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  animation: auth-pop 0.22s ease;
}

@keyframes auth-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-surface-2, #f0f4f9);
  color: var(--fg-2, #4a5568);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__close:hover {
  color: var(--fg, #0d0f14);
}

/* ---- Compact account chip (Multiverse switcher bar) ---- */
.auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
  max-width: 100%;
}

.auth-nav__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 160px;
  padding: 4px 12px 4px 4px;
  border: 1.5px solid var(--sw-border, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  background: var(--sw-bg, rgba(255, 255, 255, 0.92));
  color: var(--sw-fg, #0d0f14);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 40, 120, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.auth-nav__account:hover {
  border-color: rgba(0, 168, 255, 0.45);
  box-shadow: 0 4px 16px rgba(0, 168, 255, 0.16);
  transform: translateY(-1px);
}

.auth-nav__account--guest {
  padding-right: 14px;
}

.auth-nav__avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00a8ff, #7b61ff);
  text-transform: uppercase;
}

.auth-nav__avatar--guest {
  background: var(--sw-bg-2, #f0f4f9);
  color: var(--sw-fg-soft, #5a6e85);
}

.auth-nav__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.auth-nav__icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--sw-border, rgba(0, 0, 0, 0.08));
  background: var(--sw-bg, rgba(255, 255, 255, 0.92));
  color: var(--sw-fg-soft, #5a6e85);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.auth-nav__icon-btn:hover {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(254, 226, 226, 0.65);
}

.auth-card--wide {
  max-width: 480px;
}

.auth-card__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3, #718096);
}

.auth-card__success {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 0.88rem;
  font-weight: 550;
}

.auth-field__combo {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 12px;
  background: var(--bg-surface, #fff);
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.auth-field__combo:focus-within {
  border-color: rgba(0, 168, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.15);
}

.auth-field__prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-3, #718096);
  white-space: nowrap;
  user-select: none;
  background: var(--bg-surface-2, #f4f7fb);
  border-right: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  padding-right: 10px;
}

.auth-field__input--combo {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
}

@media (max-width: 560px) {
  .auth-form__row { grid-template-columns: 1fr; }
  .auth-page { padding-top: 72px; }
  .auth-nav__name { display: none; }
  .auth-nav__account {
    max-width: none;
    padding: 4px;
  }
  .auth-nav__account--guest {
    padding: 4px;
  }
}
