/* auth.css — the anonymous auth/error shell (_Layout) and its pages (Login,
   Register, SetPassword, Setup, AccessDenied, Error, Logout). These are the only
   pages NOT on the app cockpit shells (_DashboardLayout / _ShareLayout): a minimal,
   centered cockpit layout with no sidebar or nav. The form classes (.auth-form …)
   are also used by /Account, which links this sheet from its Styles section. */

.auth-shell {
  position: relative;
  z-index: 0; /* stacking context: the fixed .auth-scene (z -1) paints above body bg, below content */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.auth-brand {
  padding: 20px 24px;
}
.auth-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-0);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.auth-brand-link:hover { color: var(--acc-cyan); }

/* body.cockpit-active is overflow:hidden / height:100dvh, so the scroll box lives
   here (mirrors .cockpit-main) — a short page centers, a tall one scrolls. */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

/* The centered panel shared by the login card and the message pages. */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
}

/* Pixel-art backdrop (_PixelSceneBackdrop). A light scrim keeps the card + brand readable without dulling it; the art itself keeps
   its heroes outside the card's footprint (see scripts/gen-pixel-scenes.mjs). */
.auth-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.auth-scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
}
.auth-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 50% at 50% 45%, color-mix(in oklch, var(--bg-0) 40%, transparent), transparent),
    linear-gradient(to bottom, color-mix(in oklch, var(--bg-0) 30%, transparent), transparent 50%);
}
/* The card floats over the scene: see-through so it reads as part of it, firming up once the visitor
   engages — pointer over it (a click or tap included) or a required field filled (typed or autofilled).
   Not :focus-within: Login/SetPassword autofocus a field, which would make it solid on page load. */
.auth-main:has(.auth-scene) .auth-card {
  background: color-mix(in oklch, var(--bg-2) 62%, transparent);
  backdrop-filter: blur(4px);
  transition: background-color 4s ease-in-out, backdrop-filter 4s ease-in-out;
}
.auth-main:has(.auth-scene) .auth-card:is(:hover, :has(.auth-input[required]:valid)) {
  background: color-mix(in oklch, var(--bg-2) 94%, transparent);
  backdrop-filter: blur(8px);
}

/* Phones get the portrait crop (breakpoint matches _PixelSceneBackdrop's <source>): its foreground is in
   the bottom quarter, so the card rides up to leave it visible. */
@media (max-width: 600px) {
  .auth-main:has(.auth-scene) {
    align-items: flex-start;
    padding: 8px 16px 28dvh;
  }
  .auth-main:has(.auth-scene) .auth-card { padding: 24px 20px; }
}

.auth-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
}
.auth-icon--danger { color: var(--acc-red); }

.auth-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-0);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--fg-2);
  margin: 0 0 24px;
  line-height: 1.5;
}

/* Full-width primary action (the sign-in button). */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
}

.auth-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.auth-error-code {
  font-size: 12px;
  color: var(--fg-2);
  margin: 0 0 4px;
}
.auth-error-code code {
  font-family: var(--font-mono);
  color: var(--fg-1);
}

/* Credential forms: stacked label/input fields, left-aligned inside the centered card. */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg-0);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.12s;
}
.auth-input:focus { border-color: var(--acc-cyan); }
.auth-hint { font-size: 11px; color: var(--fg-3); margin: 0; }
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-1);
}
.auth-message {
  font-size: 13px;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin: 0;
  text-align: left;
}
.auth-message--error {
  color: var(--acc-red);
  border: 1px solid var(--acc-red);
}
.auth-message--ok {
  color: var(--acc-lime);
  border: 1px solid var(--acc-lime);
}
.auth-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
}
.auth-links a { color: var(--fg-2); }
.auth-links a:hover { color: var(--acc-cyan); }
.auth-code {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}
