/* One native checkbox appearance for all site forms. */
body input[type="checkbox"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  box-sizing: border-box;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  flex: 0 0 1.75rem;
  margin: 0;
  border: 2px solid currentColor;
  border-radius: 0.625rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
}

body input[type="checkbox"]::before {
  content: "";
  inline-size: 0.4rem;
  block-size: 0.75rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-0.1rem) rotate(45deg);
  visibility: hidden;
}

body input[type="checkbox"]:is(:checked, :indeterminate) {
  border-color: #5effb5;
  background: #5effb5;
  color: #0e1114;
}

body input[type="checkbox"]:is(:checked, :indeterminate)::before {
  visibility: visible;
}

body input[type="checkbox"]:indeterminate::before {
  inline-size: 0.875rem;
  block-size: 2px;
  border: 0;
  background: currentColor;
  transform: none;
}

body input[type="checkbox"]:focus-visible {
  outline: 2px solid #5effb5;
  outline-offset: 4px;
}

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

body input[type="checkbox"][aria-invalid="true"] {
  border-color: #ff7d7d;
}

@media (forced-colors: active) {
  body input[type="checkbox"] {
    appearance: auto;
    border: revert;
    background: revert;
    color: revert;
  }

  body input[type="checkbox"]::before {
    content: none;
  }
}
