/* The loading state the page shows while a person decides.
 *
 * Two things are going on here and both matter on a phone.
 *
 * 1. The artwork is Apple's, not invented. account.apple.com draws its spinners from eight
 *    "nib" bars rotated around one point, and home-0aa20955…css scales that artwork by
 *    transform:scale(.075) to make a 16px spinner (scale(.15) for .spinner-large, 32px). The
 *    nib geometry itself is 66px long starting 40px out from the origin — an unscaled spinner
 *    is therefore 212px across, and app-sk7.css, which is loaded after it, does reset the
 *    scale (`.signin .spinner-container{transform:none}`). The nibs, the rotations, the
 *    .8s delays and the fade keyframes below are Apple's own numbers, so the spinner that
 *    paints is the spinner Apple paints; only the scale is stated explicitly instead of
 *    left to a cascade two stylesheets disagree about.
 *
 * 2. It is centred on the *device*, not on the card. The sign-in form lives in an iframe that
 *    js/page.js sizes to its content, so a full-height overlay inside that iframe is centred on
 *    the card — which on a phone is taller than the screen, and its centre is off-screen. This
 *    overlay is position:fixed in whichever document it is used in: the parent page shows it, so
 *    it is centred in the real viewport at every size from 320px phones to desktops.
 *
 * Nothing here uses inset, gap or aspect-ratio: the visitor logs seen on this box include
 * iOS 14.4, which does not understand `inset`.
 */

.tk-load {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483646; /* above Apple's sticky nav and any popover, this covers everything */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  cursor: progress;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  opacity: 0;
  -webkit-animation: tk-load-in 0.16s ease-out 0.05s forwards;
  animation: tk-load-in 0.16s ease-out 0.05s forwards;
}

/* The point the nibs rotate around. A zero-size box keeps the artwork centred on the flex
 * centre of the overlay; the scale is what makes it 32px instead of 212px. */
.tk-load__ring {
  position: relative;
  width: 0;
  height: 0;
  -webkit-transform: scale(0.15);
  transform: scale(0.15);
}

.tk-load__nib {
  position: absolute;
  top: -12.5px;
  left: 0;
  width: 66px;
  height: 28px;
  background: transparent;
  border-radius: 25% / 50%;
  -webkit-transform-origin: left center;
  transform-origin: left center;
}

.tk-load__nib::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 25% / 50%;
  -webkit-animation: tk-load-fade 0.8s linear infinite;
  animation: tk-load-fade 0.8s linear infinite;
}

.tk-load__nib-1 {
  -webkit-transform: rotate(0deg) translateX(40px);
  transform: rotate(0deg) translateX(40px);
}
.tk-load__nib-1::before {
  -webkit-animation-delay: -0.8s;
  animation-delay: -0.8s;
}
.tk-load__nib-2 {
  -webkit-transform: rotate(45deg) translateX(40px);
  transform: rotate(45deg) translateX(40px);
}
.tk-load__nib-2::before {
  -webkit-animation-delay: -0.7s;
  animation-delay: -0.7s;
}
.tk-load__nib-3 {
  -webkit-transform: rotate(90deg) translateX(40px);
  transform: rotate(90deg) translateX(40px);
}
.tk-load__nib-3::before {
  -webkit-animation-delay: -0.6s;
  animation-delay: -0.6s;
}
.tk-load__nib-4 {
  -webkit-transform: rotate(135deg) translateX(40px);
  transform: rotate(135deg) translateX(40px);
}
.tk-load__nib-4::before {
  -webkit-animation-delay: -0.5s;
  animation-delay: -0.5s;
}
.tk-load__nib-5 {
  -webkit-transform: rotate(180deg) translateX(40px);
  transform: rotate(180deg) translateX(40px);
}
.tk-load__nib-5::before {
  -webkit-animation-delay: -0.4s;
  animation-delay: -0.4s;
}
.tk-load__nib-6 {
  -webkit-transform: rotate(225deg) translateX(40px);
  transform: rotate(225deg) translateX(40px);
}
.tk-load__nib-6::before {
  -webkit-animation-delay: -0.3s;
  animation-delay: -0.3s;
}
.tk-load__nib-7 {
  -webkit-transform: rotate(270deg) translateX(40px);
  transform: rotate(270deg) translateX(40px);
}
.tk-load__nib-7::before {
  -webkit-animation-delay: -0.2s;
  animation-delay: -0.2s;
}
.tk-load__nib-8 {
  -webkit-transform: rotate(315deg) translateX(40px);
  transform: rotate(315deg) translateX(40px);
}
.tk-load__nib-8::before {
  -webkit-animation-delay: -0.1s;
  animation-delay: -0.1s;
}

@-webkit-keyframes tk-load-fade {
  0%,
  to {
    opacity: 0.55;
  }
  1% {
    opacity: 0.55;
  }
  95% {
    opacity: 0.08;
  }
}

@keyframes tk-load-fade {
  0%,
  to {
    opacity: 0.55;
  }
  1% {
    opacity: 0.55;
  }
  95% {
    opacity: 0.08;
  }
}

@-webkit-keyframes tk-load-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tk-load-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Reduced motion still has to read as "working", so the spinner keeps turning; only the
 * veil's fade is dropped. */
@media (prefers-reduced-motion: reduce) {
  .tk-load {
    -webkit-animation: none;
    animation: none;
    opacity: 1;
  }
}
