/* ==================================================================
   THRESHOLD COVER - unauthenticated interstitial
   --------------------------------------------------------------------
   A branded full-viewport screen that occupies every transitional auth
   moment so the bare app chrome (sidenav / topbar / footer) never
   flashes:
     • initial WASM boot          (threshold-boot-screen replacement)
     • RedirectToLogin            (before the Entra redirect fires)
     • RemoteAuthenticatorView    (logging-in / callback / logout)

   Reuses the established brand vocabulary verbatim - CROSSROADS /
   Threshold lockup, oxblood threshold rule, Advant endorsement. Nothing
   here is a new color or type decision; it is the chrome's own
   language, held still at the front door.
   ================================================================== */

.th-cover {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--th-paper);
  color: var(--th-ink);
  font-family: var(--th-font-sans);
  overflow: hidden;
}

/* ---------- Stage ---------- */
.th-cover-stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

/* Faint arch watermark - the only ornament. Single Advant arch, drawn
   in ink at a whisper. Sits behind the lockup, optically centered a
   touch high so the visual weight settles on the wordmark. */
.th-cover-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78vmin, 880px);
  height: min(78vmin, 880px);
  transform: translate(-50%, -56%);
  color: var(--th-ink);
  opacity: 0.035;
  pointer-events: none;
  user-select: none;
}
[data-theme="dark"] .th-cover-watermark { opacity: 0.05; }
.th-cover-watermark svg { width: 100%; height: 100%; display: block; }

/* ---------- Centered column ---------- */
.th-cover-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* Institution eyebrow - the tenant is known from the subdomain slug
   before the user ever authenticates, so we can greet by name. */
.th-inst {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 40px;
}
.th-inst-crest {
  width: 30px;
  height: 30px;
  border-radius: var(--th-radius-3);
  background: var(--th-advant-deep);
  color: var(--th-advant-fg);
  display: grid;
  place-items: center;
  font-family: var(--th-font-serif);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  flex: none;
}
.th-inst-name {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--th-ink-2);
  font-weight: 500;
}

/* ---------- Hero lockup ---------- */
/* The sidenav lockup, monumentalized. Same three parts, same roles:
   wordmark in ink, oxblood threshold rule, product in copper. */
.th-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.th-hero-wordmark {
  font-family: var(--th-font-serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--th-ink);
  line-height: 1;
  /* optical: letter-spacing pushes the block right; nudge back to center */
  text-indent: 0.34em;
  margin-bottom: 22px;
}
.th-hero-rule {
  height: 2px;
  width: 104px;
  background: var(--th-xr-bind);
  border-radius: 1px;
  margin-bottom: 22px;
}
.th-hero-product {
  font-family: var(--th-font-serif);
  font-weight: 600;
  font-size: clamp(52px, 9vmin, 88px);
  letter-spacing: -0.015em;
  color: var(--th-marigold-deep);
  line-height: 0.96;
}

/* ---------- Progress + status ---------- */
.th-cover-progress {
  margin-top: 56px;
  width: 232px;
  height: 2px;
  border-radius: 2px;
  background: var(--th-line-2);
  overflow: hidden;
  position: relative;
}
.th-cover-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 42%;
  border-radius: 2px;
  background: var(--th-xr-bind);
  animation: th-sweep 1.65s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes th-sweep {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

.th-cover-status {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.th-status-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--th-ink-2);
  letter-spacing: 0.005em;
}
.th-status-sub {
  font-family: var(--th-font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--th-ink-4);
}

/* ---------- Footer (Advant endorsement) ---------- */
/* Composed here rather than reusing the chrome <ThresholdFooter> so the
   cover footer can sit centered and quiet, without the working-surface
   Privacy/Terms/Status nav. Same endorsement language and oxblood rule. */
.th-cover-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 26px 24px 30px;
  border-top: 1px solid var(--th-line);
  background: var(--th-paper);
}
.th-cover-foot-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.1;
}
.th-cover-foot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--th-ink-3);
}
.th-cover-foot-line .product-of {
  font-style: italic;
  font-family: var(--th-font-serif);
  color: var(--th-ink-3);
  font-size: 13px;
}
.th-cover-foot-wm {
  font-family: var(--th-font-serif);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--th-ink);
  line-height: 1;
}
.th-cover-foot-rule {
  height: 1px;
  width: 28px;
  background: var(--th-xr-bind);
  border-radius: 0.5px;
}
.th-cover-foot-copy {
  font-family: var(--th-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--th-ink-4);
  letter-spacing: 0.02em;
}

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .th-cover-center > * {
    opacity: 0;
    animation: th-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .th-cover-center > .th-inst        { animation-delay: 0.02s; }
  .th-cover-center > .th-hero        { animation-delay: 0.10s; }
  .th-cover-center > .th-cover-progress { animation-delay: 0.22s; }
  .th-cover-center > .th-cover-status   { animation-delay: 0.28s; }

  @keyframes th-rise {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Reduced motion: no sweep, no rise - show a settled, static bar. */
@media (prefers-reduced-motion: reduce) {
  .th-cover-progress::after {
    animation: none;
    width: 38%;
    transform: none;
  }
}
