$checkbox-width: 1.5rem;
$checkbox-height: 1.5rem;

.checkbox-composite {
  @include flex();
  @include flex-row();
  align-items: center;
  margin-bottom: 1rem;

  label {
    @include stretch();
    margin-left: $default-padding;
  }
}

input[type="checkbox"] {
  width: $checkbox-width;
  height: $checkbox-height;
  background-color: transparent;
  position: relative;
  outline: none;
  display: block;
  border: none;
  @include ignore-device-rendering();
}

input[type="checkbox"]:before {
  display: block;
  width: $checkbox-width;
  height: $checkbox-height;
  line-height: $default-height;
  content: '';
  position: absolute;
  box-sizing: border-box;
  border: $default-border-width-thin solid var(--color-ui-1-80);
  border-radius: $default-border-radius;
}

input[type="checkbox"]:checked:before {
  background-color: var(--color-ui-1-80);
  background-position: center;
}

input[type="checkbox"]:active:before {
  box-shadow: none;
  border-color: var(--color-ui-1);
}

input[type="checkbox"]:checked:active:before {
  background-color: var(--color-ui-1);
}

input[type="checkbox"]:checked::after {
  content: '\2713';
  display: block;
  width: $checkbox-width;
  height: $checkbox-height;
  position: absolute;
  line-height: $default-height;
  text-align: center;
  color: var(--color-ui-4);
  box-sizing: border-box;
}

input[type="checkbox"]:focus:before {
  box-shadow: 0 0 0 0.25rem var(--color-focus-80);
}

input[type="checkbox"]:focus,
input[type="checkbox"]:hover {
  box-shadow: none;
}
