/* Keep this rule in the public login stylesheet and set data-auth-locked in initial HTML. */
html[data-auth-locked] [data-auth-protected],
html[data-auth-locked] body > :not(#root) {
  display: none !important;
}
/* A hidden tab is masked, not unmounted: blurring keeps the layout, the
   scroll position and the keyboard focus intact for the return. */
html[data-auth-masked] [data-auth-protected],
html[data-auth-masked] body > :not(#root) {
  filter: blur(16px) !important;
  user-select: none !important;
  pointer-events: none !important;
}
.auth-screen {
  --auth-bg: #fafafa;
  --auth-panel: #fff;
  --auth-text: #18181b;
  --auth-muted: #71717a;
  --auth-line: #e4e4e7;
  min-height: 100dvh;
  background: var(--auth-bg);
  color: var(--auth-text);
  display: flex;
  flex-direction: column;
  font-family: "Geist Variable", system-ui, sans-serif;
}
.dark .auth-screen {
  --auth-bg: #09090b;
  --auth-panel: #18181b;
  --auth-text: #fafafa;
  --auth-muted: #a1a1aa;
  --auth-line: #3f3f46;
}
.auth-header,
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
}
.auth-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.auth-mark {
  background: var(--auth-text);
  color: var(--auth-bg);
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.4rem;
  font-size: 1.2rem;
  font-weight: 750;
}
.auth-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8rem;
}
.auth-controls select {
  border: 1px solid var(--auth-line);
  border-radius: 0.4rem;
  padding: 0.5rem;
  color: var(--auth-text);
  background: var(--auth-panel);
  font: inherit;
}
.auth-card {
  width: min(100% - 3rem, 27rem);
  margin: auto;
  padding: 4rem 0;
}
.auth-eyebrow {
  color: var(--auth-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 0 0 1.25rem;
}
.auth-card h1 {
  font-size: clamp(1.65rem, 4vw, 2rem);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.auth-card h1:focus {
  outline: none;
}
.auth-message {
  margin: 1rem 0 2rem;
  min-height: 3rem;
  color: var(--auth-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.auth-local {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.auth-local-notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--auth-line);
  border-radius: 0.6rem;
  background: var(--auth-panel);
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.6;
}
.auth-local-notice strong {
  font-size: 0.75rem;
}
.auth-local-notice p {
  color: var(--auth-muted);
  margin: 0.3rem 0 0;
}
.auth-local label {
  font-size: 0.8rem;
  font-weight: 550;
}
.auth-local input {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  border: 1px solid var(--auth-line);
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--auth-panel);
  color: var(--auth-text);
  font: inherit;
}
.auth-local input:focus-visible {
  border-color: var(--auth-text);
}
.auth-local :disabled {
  cursor: wait;
  opacity: 0.65;
}
.auth-local .auth-retry {
  margin-top: 0.5rem;
}
.auth-local-error {
  margin: 0.25rem 0;
  color: #dc2626;
  font-size: 0.8rem;
  line-height: 1.6;
}
.dark .auth-local-error {
  color: #fca5a5;
}
.auth-slack,
.auth-retry {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--auth-line);
  border-radius: 0.6rem;
  background: var(--auth-panel);
  color: var(--auth-text);
  text-decoration: none;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
.auth-retry {
  color: var(--auth-bg);
  background: var(--auth-text);
  border-color: var(--auth-text);
}
.auth-slack:hover,
.auth-slack:focus-visible {
  border-color: var(--auth-muted);
}
/* No detached ring anywhere, so each control says it has focus in its own
   colour: the wordmark darkens, the bordered ones tint. */
.auth-wordmark:focus-visible {
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}
.auth-controls select:focus-visible,
.auth-retry:focus-visible {
  border-color: var(--auth-muted);
}
.auth-note,
.auth-storage-warning {
  color: var(--auth-muted);
  font-size: 0.75rem;
  line-height: 1.65;
  margin: 1.3rem 0 0;
}
.auth-footer {
  color: var(--auth-muted);
  font-size: 0.7rem;
}
.auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.auth-progress {
  height: 3rem;
  display: grid;
  place-items: center;
}
.auth-progress span {
  width: 1.3rem;
  height: 1.3rem;
  border: 2px solid var(--auth-line);
  border-top-color: var(--auth-text);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-progress span {
    animation: none;
  }
}
@media (max-width: 520px) {
  .auth-header,
  .auth-footer {
    padding: 1.25rem;
  }
  .auth-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .auth-controls {
    gap: 1rem;
  }
  .auth-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
