/* auth: login screen shown before the app shell when unauthenticated.
   Full-viewport grid centring a single card that reuses the same surface
   language as .story-modal__dialog (design system continuity). */

.auth-shell {
  align-items: center;
  background: var(--bg-app);
  display: grid;
  inset: 0;
  justify-items: center;
  min-height: 100vh;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-overlay);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: grid;
  gap: var(--space-md);
  max-width: min(100%, var(--modal-w-sm));
  padding: var(--space-xl);
  width: 100%;
}

.auth-card__brand {
  display: grid;
  gap: var(--space-xs);
  justify-items: center;
  margin-bottom: var(--space-xs);
}

.auth-card__logo {
  display: block;
  height: auto;
  max-width: 9rem;
  width: 100%;
}

.auth-card__form {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
}

.auth-card__field {
  display: grid;
  gap: var(--space-2xs);
}

.auth-card__label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.auth-card__error {
  color: var(--vibrance-danger);
  font-size: var(--text-sm);
  min-height: 1.2em;
  margin: 0;
  text-align: center;
}

.auth-card__error:empty {
  display: none;
}

.auth-card__submit {
  margin-top: var(--space-2xs);
  width: 100%;
}

/* When the auth shell is present we hide the normal app shell so the
   login card owns the viewport. */
body[data-auth="out"] .app-shell,
body[data-auth="pending"] .app-shell {
  display: none;
}

body[data-auth="in"] .auth-shell {
  display: none;
}
