/*
 * ZIIC_Login — the choose-first sign-in form (client, 2026-09-30).
 *
 * Two radios choose which of two sibling forms shows. Plain `:checked ~` sibling selectors,
 * no :has(), so no browser can end up with both forms hidden. Without this file both forms
 * show and both still work. Colours are inherited from the theme (currentColor / the
 * theme's own button), so this file carries layout only.
 */

.ziic-login .ziic-login-choose {
  border: 0;
  margin: 24px 0 0;
  padding: 0;
  min-width: 0;
}

.ziic-login .ziic-login-choose-q {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  font-weight: 600;
}

/* The radios stay in the accessibility tree and keyboard order; only their dot is hidden.
   The label is the visible control. */
.ziic-login .ziic-login-kind {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.ziic-login .ziic-login-kind-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(50% - 5px);
  min-height: 48px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px solid #d9e3dd;
  border-radius: 9px;
  background: #fff;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  vertical-align: top;
}

.ziic-login .ziic-login-kind-label + .ziic-login-kind + .ziic-login-kind-label {
  margin-left: 6px;
}

.ziic-login .ziic-login-kind:checked + .ziic-login-kind-label {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.ziic-login .ziic-login-kind:focus-visible + .ziic-login-kind-label {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Only the chosen door's form shows. */
.ziic-login .ziic-login-form {
  display: none;
}

.ziic-login #ziic-kind-mobile:checked ~ .ziic-login-form--mobile,
.ziic-login #ziic-kind-email:checked ~ .ziic-login-form--email {
  display: block;
}

.ziic-login .ziic-login-signup {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #d9e3dd;
  border-radius: 9px;
}

.ziic-login .ziic-login-signup legend {
  padding: 0 6px;
  font-weight: 600;
}

/* ── Step 2: only the code (client, 2026-09-30 round 2) ── */

.ziic-login .ziic-login-sent {
  margin: 0 0 12px;
  font-weight: 600;
}

.ziic-login .ziic-login-resend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 4px 0 0;
}

.ziic-login .ziic-login-resend-form {
  margin: 0;
}

.ziic-login .ziic-login-resend-wait {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* A submit button that reads as a link (it must POST: a resend spends a send). */
.ziic-login .ziic-login-linkbutton,
.ziic-login .ziic-login-linkbutton:hover,
.ziic-login .ziic-login-linkbutton:focus {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Theme button rules set display, which beats the UA's [hidden]; keep it hidden. */
.ziic-login .ziic-login-linkbutton[hidden] {
  display: none;
}

.ziic-login .ziic-login-restart {
  color: inherit;
  text-decoration: underline;
}

/* Busy state (assets/js/login.js): spinner on the pressed button while ZiiCloud answers. */
.ziic-login .button.ziic-login-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  cursor: progress;
}
.ziic-login .button.ziic-login-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1em;
  height: 1.1em;
  margin: -0.55em 0 0 -0.55em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ziic-login-spin 0.7s linear infinite;
}
.ziic-login .ziic-login-linkbutton.ziic-login-busy {
  opacity: 0.55;
  pointer-events: none;
  cursor: progress;
}
@keyframes ziic-login-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ziic-login .button.ziic-login-busy::after {
    animation-duration: 2s;
  }
}
