/* ==========================================================================
   Redirect page: shown for a moment before the user leaves for a partner.
   Breakpoints: mobile < 768 ≤ desktop (design: 320 and 1920).
   ========================================================================== */

html,
body {
  background-color: #06483a;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.redirect {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  /* soft glows of the mobile design: top left, under the ring, bottom right */
  background:
    radial-gradient(ellipse 140px 130px at 70px 70px, #0e533d, rgba(14, 83, 61, 0)),
    radial-gradient(ellipse 130px 110px at 50% calc(50% + 100px), rgba(22, 90, 69, 0.8), rgba(22, 90, 69, 0)),
    radial-gradient(ellipse 120px 110px at calc(100% - 60px) calc(100% - 130px), #0c4b33, rgba(12, 75, 51, 0)),
    radial-gradient(ellipse 170px 60% at 0 75%, #0a5141, rgba(10, 81, 65, 0)),
    linear-gradient(#084c3d, #054236);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.redirect__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
}

/* All animations start together on page load. The ring, its glow and the
   title share a 3s cycle; the progress bar and the partner card a 2s one. */
.redirect__text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
  animation: redirect-pulse 3s ease-in-out infinite;
}

/* dims to half and back: the title and the partner card */
@keyframes redirect-pulse {
  50% {
    opacity: 0.5;
  }
}

/* Spinning ring with a soft glow behind it
   ========================================================================== */

.redirect__spinner {
  position: relative;
  width: 100px;
  height: 100px;
  margin-top: 31px;
}

/* ::before is the ring's own halo, ::after the glow that swells while the
   ring turns fastest. The ring is 100px: its band runs from 37px to 50px
   from the centre and hides that part of both gradients. */
.redirect__spinner::before,
.redirect__spinner::after {
  content: "";
  position: absolute;
  inset: -65px;
}

.redirect__spinner::before {
  background: radial-gradient(
    circle closest-side,
    rgba(137, 228, 81, 0.02),
    rgba(137, 228, 81, 0.045) 14px,
    rgba(137, 228, 81, 0.065) 20px,
    rgba(137, 228, 81, 0.11) 28px,
    rgba(137, 228, 81, 0.17) 37px,
    rgba(137, 228, 81, 0.16) 50px,
    rgba(137, 228, 81, 0.1) 57px,
    rgba(137, 228, 81, 0.06) 63px,
    rgba(137, 228, 81, 0.04) 70px,
    rgba(137, 228, 81, 0.02) 76px,
    rgba(137, 228, 81, 0.01) 90px,
    rgba(137, 228, 81, 0) 110px
  );
}

.redirect__spinner::after {
  background: radial-gradient(
    circle closest-side,
    rgba(137, 228, 81, 0.16),
    rgba(137, 228, 81, 0.155) 10px,
    rgba(137, 228, 81, 0.13) 19px,
    rgba(137, 228, 81, 0.095) 28px,
    rgba(137, 228, 81, 0.055) 33px,
    rgba(137, 228, 81, 0.045) 57px,
    rgba(137, 228, 81, 0.06) 64px,
    rgba(137, 228, 81, 0.06) 72px,
    rgba(137, 228, 81, 0.048) 80px,
    rgba(137, 228, 81, 0.032) 88px,
    rgba(137, 228, 81, 0.022) 95px,
    rgba(137, 228, 81, 0.012) 102px,
    rgba(137, 228, 81, 0) 115px
  );
  opacity: 0;
  animation: redirect-glow 3s ease-in-out infinite;
}

@keyframes redirect-glow {
  50% {
    opacity: 1;
  }
}

/* the ring image is 141px: its visible ring is 100px in the middle */
.redirect__ring {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 141px;
  max-width: none;
  height: 141px;
  margin: -70.5px 0 0 -70.5px;
  animation: redirect-spin 3s ease-in-out infinite;
}

/* one turn per cycle: slow start, fastest halfway, slow finish.
   -40deg undoes the tilt ring.svg was exported with */
@keyframes redirect-spin {
  from {
    transform: rotate(-40deg);
  }

  to {
    transform: rotate(320deg);
  }
}

/* Progress: a gradient bar slides in from the left and out to the right
   ========================================================================== */

.redirect__progress {
  position: relative;
  width: 200px;
  height: 3px;
  margin-top: 28px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.redirect__progress-bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #cfffc0, #a5ef80 40%, #89e451 70%, #68c50f);
  transform: translateX(-100%);
  animation: redirect-sweep 2s ease-in-out infinite;
}

/* the easing applies to each half: it slows down when the bar fills the
   track and when it has left it */
@keyframes redirect-sweep {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Partner logo display block
   ========================================================================== */

.redirect__partner {
  display: grid;
  place-items: center;
  width: 168px;
  height: 49px;
  margin-top: 28px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  cursor: default;
  pointer-events: none;
  user-select: none;
  animation: redirect-pulse 2s ease-in-out infinite;
}

.redirect__logo {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 36px;
}

.redirect__fallback {
  max-width: 280px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 20px;
  white-space: normal;
}

.redirect__fallback a {
  color: #ffffff;
}

@media (min-width: 768px) {
  .redirect {
    background: #06483a;
    color: rgba(255, 255, 255, 0.45);
  }
}

/* keep a slow, even motion so the page still looks busy; no pulsing */
@media (prefers-reduced-motion: reduce) {
  .redirect__text,
  .redirect__partner {
    animation: none;
  }

  .redirect__spinner::after {
    opacity: 1;
    animation: none;
  }

  .redirect__ring {
    animation-duration: 6s;
    animation-timing-function: linear;
  }

  .redirect__progress-bar {
    animation-duration: 4s;
  }
}
