.wrapper {
  display: inline-flex;
  cursor: pointer;
  padding: 8px 16px 8px 14px;
  line-height: 20px;
  border-radius: 2px;
  gap: 10px;
  flex-direction: row;
  user-select: none;
}

.wrapper:not(.disabled):hover {
  background-color: var(--color-background-light-transparent);
}

.wrapper:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.disabled {
  composes: wrapper;
  cursor: not-allowed;
  color: var(--color-text-muted);
}

.label {
  flex: 1;
}

.input {
  display: none;
}

.checkbox {
  appearance: none;
  background-color: var(--color-background);
  margin: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-dark);
  border-radius: 2px;
  position: relative;
  transition: background-color .3s ease, border-color .3s ease;
  color: transparent;
  display: flex;

  stroke-dasharray: 16 16;
  stroke-dashoffset: 16;
}

.input:checked ~ .checkbox {
  background-color: var(--color-focus);
  border-color: var(--color-focus);
  color: var(--color-background);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .3s ease;
}

.input:indeterminate ~ .checkbox {
  background-color: var(--color-focus);
  border-color: var(--color-focus);
}

.input:indeterminate ~ .checkbox::after {
  content: '';
  position: absolute;
  height: 1px;
  width: 8px;
  background-color: var(--color-background);
  display: block;
  top: 8px;
  left: 4px;
  border-radius: 1px;
}

.disabled > .input:checked ~ .checkbox,
.disabled > .input:indeterminate ~ .checkbox {
  opacity: .5;
  background-color: var(--color-text-muted);
  border-color: var(--color-text-muted);
}
