/* Emailed-code sign-in page: the stage and the white card (logo, title, step panels). */

/* ---------- stage + card ---------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
}

.card-wrap {
  width: min(26.5rem, 100%);
  position: relative;
}

.card-float {
  position: relative;
  animation: arrive 0.75s var(--ease-out) backwards;
}

@keyframes arrive {
  from { opacity: 0; transform: translate3d(0, 1.1rem, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 1.125rem;
  background: rgba(255, 255, 255, 0.99);
  box-shadow:
    0 2rem 4rem -1.25rem rgba(6, 24, 56, 0.5),
    0 0.6rem 1.4rem -0.6rem rgba(6, 24, 56, 0.28);
}

.progress {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  display: none;
  overflow: hidden;
  background: #dbe6f9;
}

.progress i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
}

.card.is-busy .progress {
  display: block;
}

.card.is-busy .progress i {
  animation: progress-run 1.25s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

@keyframes progress-run {
  from { transform: translate3d(-100%, 0, 0); }
  to { transform: translate3d(265%, 0, 0); }
}

@keyframes progress-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.brand {
  display: flex;
  justify-content: center;
  padding: 1.75rem 2rem 0;
}

.brand img {
  display: block;
  width: 14.5rem;
  max-width: 100%;
  height: auto;
}

.panels {
  position: relative;
  display: grid;
  padding: 0.5rem 2rem 1.5rem;
}

.panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel:not(.is-active) {
  /* Taken out of the grid's own sizing (position: absolute) so the card fits whichever panel
     is actually showing, instead of always matching whichever of the two is taller. Safe with
     the slide transition below: a panel only becomes inactive after its own slide-out animation
     already finished (see slideSwap in login-otp.js), so nothing is ever mid-animation here. */
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel.is-active .rise {
  animation: rise 0.6s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 120ms);
}

.panel.is-active.entered .rise {
  animation: none;
}

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 0.6rem, 0); }
  to { opacity: 1; transform: none; }
}

.title {
  margin: 1.1rem 0 0;
  font: 600 1.5rem/1.25 var(--font-display);
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  color: var(--ink);
}

.lede {
  margin: 0.5rem auto 0;
  max-width: 22.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  color: var(--text);
}

#code-lede {
  min-height: 3.5rem;
}

#code-form[data-phase='expired'] #code-lede,
#code-form[data-phase='locked'] #code-lede {
  min-height: 0;
}

.lede-line,
.lede-note {
  display: block;
}

.lede-note {
  margin-top: 0.1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}
