/* Shared checkbox treatment for every section of the admin panel. */
input[type="checkbox"],
.formStack input[type="checkbox"],
.formGrid input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  place-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bk-border-strong, #3a414d);
  border-radius: 6px;
  background: var(--bk-surface-raised, #111317);
  color: var(--bk-inverse, #090a0b);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="checkbox"]::after {
  width: 4px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(.75);
  transition: opacity 120ms ease, transform 120ms ease;
}

input[type="checkbox"]:checked {
  border-color: var(--bk-text, #f3f4f6);
  background: var(--bk-text, #f3f4f6);
}

input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(45deg) translate(-1px, -1px) scale(1);
}

input[type="checkbox"]:indeterminate {
  border-color: var(--bk-text, #f3f4f6);
  background: var(--bk-text, #f3f4f6);
}

input[type="checkbox"]:indeterminate::after {
  width: 8px;
  height: 2px;
  border: 0;
  background: currentColor;
  opacity: 1;
  transform: none;
}

input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--bk-muted, #a3aab6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk-text, #f3f4f6) 9%, transparent);
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--bk-accent, #628cff);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .5;
}

@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"],
  input[type="checkbox"]::after {
    transition: none;
  }
}
