/* kit-icons.css — replacements for Apple's "SF Pro Icons" glyph icons.

   The saved pages reference font-family:"SF Pro Icons" for three icons (checkbox
   checkmark U+F30B, external-link U+F32D, error warning). That font is not shipped
   with the pages (it is installed by macOS/iOS only), so those glyphs render as
   blank boxes. Each is replaced here with the matching SF Symbols shape as inline
   SVG via mask-image, so it inherits color exactly like the font glyph did. */

:root {
  --kit-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3.2 10.4a1.1 1.1 0 0 0-1.55 1.56l4.6 4.6c.43.43 1.13.43 1.56 0l8.5-8.5a1.1 1.1 0 0 0-1.55-1.56l-7.72 7.72-3.84-3.82Z' fill='%23000'/%3E%3C/svg%3E");
  --kit-icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9.2 3.2c.5 0 .9.4.9.9s-.4.9-.9.9H5.3c-.66 0-1.2.54-1.2 1.2v8.5c0 .66.54 1.2 1.2 1.2h8.5c.66 0 1.2-.54 1.2-1.2v-3.9c0-.5.4-.9.9-.9s.9.4.9.9v3.9a3 3 0 0 1-3 3H5.3a3 3 0 0 1-3-3V6.2a3 3 0 0 1 3-3h3.9Z' fill='%23000'/%3E%3Cpath d='M11.1 3.2c0-.5.4-.9.9-.9h4.9c.5 0 .9.4.9.9v4.9a.9.9 0 1 1-1.8 0V5.37l-6.27 6.27a.9.9 0 0 1-1.27-1.27l6.26-6.27h-2.72a.9.9 0 0 1-.9-.9Z' fill='%23000'/%3E%3C/svg%3E");
  --kit-icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.6c.62 0 1.19.34 1.5.9l7.3 12.9c.3.54.3 1.2-.01 1.73-.31.54-.88.87-1.49.87H2.7c-.61 0-1.18-.33-1.49-.87a1.73 1.73 0 0 1-.01-1.73L8.5 2.5c.31-.56.88-.9 1.5-.9Zm0 5.1c-.5 0-.9.4-.9.9v3.4a.9.9 0 0 0 1.8 0V7.6c0-.5-.4-.9-.9-.9Zm0 6.4a1.05 1.05 0 1 0 0 2.1 1.05 1.05 0 0 0 0-2.1Z' fill='%23000'/%3E%3C/svg%3E");
}

/* ---- checkbox checkmark ("Keep me signed in" / "Remember me") ----
   Apple draws a font glyph at font-size:18px absolutely positioned; replace with the mask. */
.kit-icons .form-checkbox-input:checked~.form-label .form-checkbox-indicator:after {
  content: "";
  font-family: sans-serif;
  font-size: 0;
  width: 13px;
  height: 13px;
  left: 1.5px;
  top: 0px;
  background-color: currentColor;
  -webkit-mask: var(--kit-icon-check) center / contain no-repeat;
  mask: var(--kit-icon-check) center / contain no-repeat;
}

/* ---- external-link arrow ("Forgot password?" / iforgot links) ----
   NOTE: font-size is zeroed to hide the missing glyph, so the box must use
   absolute units (an em here would resolve to 0). */
.kit-icons .sk-icon-external:after,
.kit-icons .sk-icon-external:before {
  content: "";
  font-family: sans-serif;
  font-size: 0;
  width: 11px;
  height: 11px;
  top: .02em;
  padding-left: .3em;                /* Apple's .sk-icon-after:after spacing */
  box-sizing: content-box;
  background-color: currentColor;
  background-clip: content-box;
  -webkit-mask: var(--kit-icon-external) left center / 11px 11px no-repeat;
  mask: var(--kit-icon-external) left center / 11px 11px no-repeat;
}

/* ---- error warning ("Incorrect verification code." / "Check the account information…") ---- */
.kit-icons .form-message-wrapper:before {
  content: "";
  font-family: sans-serif;
  font-size: 0;
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  background-color: currentColor;
  -webkit-mask: var(--kit-icon-error) center / contain no-repeat;
  mask: var(--kit-icon-error) center / contain no-repeat;
}
.kit-icons .sec-code-wrapper .form-message-wrapper:before { height: 15px; }

/* ---- privacy paragraph legibility ------------------------------------------
   The saved widget hard-codes the LIGHT-mode text colour (#494949) on the
   caption wrapper. In dark mode that is near-invisible on the dark card, so
   re-state it per theme on every element that carries it. */
.kit-icons .ue-privacy,
.kit-icons .ue-privacy .privacy-wrapper,
.kit-icons .ue-privacy .tk-caption,
.kit-icons .ue-privacy p,
.kit-icons .ue-privacy a {
  color: #494949;
  opacity: 1;
}
.kit-icons .ue-privacy a { color: #0066cc; }
/* dark theme: the outer page sets data-theme / the widget mirrors it via .theme-dark */
.kit-icons.theme-dark .ue-privacy,
.kit-icons.theme-dark .ue-privacy .privacy-wrapper,
.kit-icons.theme-dark .ue-privacy .tk-caption,
.kit-icons.theme-dark .ue-privacy p,
.kit-icons .theme-dark .ue-privacy,
.kit-icons .theme-dark .ue-privacy .privacy-wrapper,
.kit-icons .theme-dark .ue-privacy .tk-caption,
.kit-icons .theme-dark .ue-privacy p { color: #d6d6d6; }
.kit-icons.theme-dark .ue-privacy a,
.kit-icons .theme-dark .ue-privacy a { color: #2997ff; }
.kit-icons .ue-privacy--hide { opacity: 0; }

/* ---- dark theme text colours ---------------------------------------------------
   Apple's live widget loads its dark palette at runtime (a stylesheet the saved
   page does not include), so text that is not covered by the 167 .theme-dark
   rules in the base CSS keeps its LIGHT colour: #1d1d1f on a near-black card.
   Re-state Apple's own dark values (same as the widget's dark variable block). */
.kit-icons.theme-dark body,
.kit-icons .theme-dark body,
.kit-icons.theme-dark .form-label,
.kit-icons .theme-dark .form-label,
.kit-icons.theme-dark .signin,
.kit-icons .theme-dark .signin,
.kit-icons.theme-dark .signin-content,
.kit-icons .theme-dark .signin-content,
.kit-icons.theme-dark .si-remember-password,
.kit-icons .theme-dark .si-remember-password,
.kit-icons.theme-dark .tk-caption,
.kit-icons .theme-dark .tk-caption,
.kit-icons.theme-dark .signin-content__footer,
.kit-icons .theme-dark .signin-content__footer {
  color: hsla(0, 0%, 100%, .98);
}
/* links: Apple's dark-mode link blue */
.kit-icons.theme-dark .si-link,
.kit-icons .theme-dark .si-link,
.kit-icons.theme-dark a.si-forgot-password,
.kit-icons .theme-dark a.si-forgot-password,
.kit-icons.theme-dark .button-link,
.kit-icons .theme-dark .button-link {
  color: #2997ff;
}
/* the 2FA / PIN step copy */
.kit-icons.theme-dark .si-info,
.kit-icons .theme-dark .si-info,
.kit-icons.theme-dark .verify-device,
.kit-icons .theme-dark .verify-device,
.kit-icons.theme-dark .tk-intro,
.kit-icons .theme-dark .tk-intro { color: hsla(0, 0%, 100%, .98); }
.kit-icons.theme-dark .sec-code-wrapper .tk-caption,
.kit-icons .theme-dark .sec-code-wrapper .tk-caption { color: hsla(0, 0%, 100%, .66); }
/* errors keep Apple's dark red */
.kit-icons.theme-dark .form-message-wrapper,
.kit-icons .theme-dark .form-message-wrapper { color: #ff3037 !important; }
.kit-icons.theme-dark .is-error .form-textbox-label,
.kit-icons .theme-dark .is-error .form-textbox-label,
.kit-icons.theme-dark .form-textbox.is-error .form-textbox-label { color: #ff3037 !important; }

/* ================================================================
   In-widget controls (these styles are linked inside the srcdoc iframe)
   ================================================================ */

/* ---- in-field continue arrow (account step) ---- */
.kit-icons .kit-arrow {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #0071e3;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .15s ease;
}
.kit-icons .kit-arrow.show { opacity: 1; pointer-events: auto; }
.kit-icons .kit-arrow:active { transform: translateY(-50%) scale(.9); }

/* ---- show / hide password (password step + wrong-credentials step) ----
   Apple reserves 43px of right padding on the password input for exactly this
   control (.fed-auth .password .form-textbox-input{padding-right:43px}). */
.kit-icons .kit-pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #6e6e73;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, background-color .15s ease;
}
.kit-icons .kit-pw-toggle.show { opacity: 1; pointer-events: auto; }
.kit-icons .kit-pw-toggle:hover { background: rgba(120,120,128,.12); }
.kit-icons .kit-pw-toggle.on { color: #0071e3; }
.kit-icons .theme-dark .kit-pw-toggle { color: #9d9da2; }
.kit-icons .theme-dark .kit-pw-toggle.on { color: #2997ff; }

/* ---- PIN step submit button ----
   Reuses Apple's widget button classes, but the code-verification page's stylesheet
   does not include the generic .button rules the sign-in page has (those are what
   give "Sign In" its 8px radius and 1px border), so the values are restated here:
   radius 8px, 1px transparent border, 8px/15px padding, 14px/20px type -> 38px tall. */
.kit-icons .pin-wrap,
.kit-icons .form-security-code:has(.pin-wrap),
.kit-icons .verify-device__sec-code:has(.pin-wrap),
.kit-icons .sec-code-wrapper:has(.pin-wrap) { overflow: visible; }
.kit-icons .pin-submit,
.kit-icons .kit-pin-submit {
  display: block;
  width: 260px;                      /* matches the PIN field width */
  max-width: 78vw;
  box-sizing: border-box;
  margin: 20px auto 0;
  min-height: 38px;
  padding: 8px 15px;
  color: #fff;
  background-color: #0071e3;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.kit-icons .kit-pin-submit:hover:not(:disabled) { background-color: #0077ed; }
.kit-icons .kit-pin-submit:active:not(:disabled) { background-color: #006edb; }
.kit-icons .kit-pin-submit:disabled { opacity: .42; cursor: default; }

/* ================================================================
   Sign-in steps. Both live in one document; <html class="kit-step2"> marks
   the password step. Markup that belongs to only one of Apple's snapshots is
   held back until that step is shown.
   ================================================================ */
.kit-icons:not(.kit-step2) .kit-step2-only { display: none !important; }
.kit-icons.kit-step2 .kit-step1-only { display: none !important; }
.kit-icons.kit-step2 .kit-arrow { display: none !important; }
