/* Sign-in, reset and set-password: the form on the left, the story on the right. Tokens only. */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 48%) 1fr;
  background: var(--navy);
  font-family: var(--ui);
}

.auth-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--card); }
.auth-card { width: min(440px, 100%); }

.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 42px; }
.auth-mark {
  width: 46px;
  height: 46px;
  flex: none;
}
.auth-mark img { width: 100%; height: 100%; display: block; }
.auth-brand b { display: block; font: 800 18px var(--display); color: var(--text); }
.auth-brand small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.auth-card h1 { margin: 0 0 8px; font: 800 31px var(--display); letter-spacing: -.035em; color: var(--navy); }
.auth-lede { margin: 0 0 28px; line-height: 1.6; color: var(--muted); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; font-size: 12px; color: var(--muted); }

.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 64px;
  isolation: isolate;
  color: var(--on-navy);
  background: var(--navy-deep);
}
/* The welcome screen's photo (welcome.css), kept quiet behind the words: darker and less coloured than on the welcome, where
   it is the point of the screen. Here it is only a hint of the same place. */
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/assets/images/welcome.webp") center / cover no-repeat, var(--navy-deep);
  filter: brightness(.68) saturate(.8);
}
/* Dimmed with navy, most of all at the bottom left where the words sit, so they read on any part of the photo. */
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(20deg,
    color-mix(in srgb, var(--navy-deep) 95%, transparent) 0%,
    color-mix(in srgb, var(--navy-deep) 82%, transparent) 50%,
    color-mix(in srgb, var(--navy-deep) 50%, transparent) 100%);
}

.auth-copy { position: relative; z-index: 1; max-width: 590px; }
.auth-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--green); }
.auth-copy h2 { margin: 17px 0; font: 800 clamp(32px, 4vw, 58px) var(--display); letter-spacing: -.045em; line-height: 1.03; color: var(--on-navy); }
.auth-copy p { max-width: 520px; font-size: 16px; line-height: 1.7; color: var(--on-navy-2); }

.auth-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.auth-proof div {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--on-navy) 12%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--on-navy) 5.5%, transparent);
}
.auth-proof b { font: 800 18px var(--display); color: var(--green); }
.auth-proof span { display: block; margin-top: 4px; font-size: 11px; color: var(--on-navy-3); }

/* The first thing a person sees, until the app has started. */
.loading-page {
  height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--navy);
  color: var(--on-navy);
  font: 700 14px var(--ui);
}
.loading-dot {
  width: 9px;
  height: 9px;
  margin: 0 auto 25px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 18px 0 var(--green), 36px 0 var(--green);
  transform: translateX(-18px);
  animation: loading-pulse 1s infinite alternate;
}
@keyframes loading-pulse { to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .loading-dot { animation: none; } }

@media (max-width: 850px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 30px 20px; }
  .auth-brand { margin-bottom: 28px; }
}

/* ── two-step sign-in: setting up the authenticator app, and the backup codes ── */

.mfa-steps { margin: 0 0 20px; padding-left: 20px; display: grid; gap: 14px; font-size: 13.5px; line-height: 1.55; color: var(--body); }
.mfa-steps strong { color: var(--text); }
/* The QR code needs dark modules on a light ground, with its own margin, to be read by a phone camera. */
.mfa-qr { width: 196px; margin: 10px 0 8px; padding: 6px; border: 1px solid var(--rule); border-radius: 5px; background: var(--card); color: var(--navy); }
.qr { display: block; width: 100%; height: auto; }
.mfa-key { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.mfa-key .num { display: inline-block; margin-top: 3px; font-size: 13px; letter-spacing: .04em; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.mfa-open { font-size: 12px; }

.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0 0 14px; padding: 14px 16px 14px 34px; border: 1px solid var(--rule); border-radius: 5px; background: var(--sunk); }
.backup-codes li { font-size: 14px; letter-spacing: .04em; color: var(--text); user-select: all; }
.backup-codes__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.backup-codes__confirm { margin-bottom: 14px; }
.modal__note { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--body); }

/* Signed in: the page fades to navy before the welcome screen opens (LEAVE_MS in pages/login.js). */
.auth-page { transition: opacity .35s ease; }
.auth-page--leaving { opacity: 0; }
html:has(.auth-page--leaving) body { background: var(--navy-deep); }
