.d-checkbox {
  z-index: 0;
  position: relative;
  display: inline-block;
  color: rgba(0, 0, 0, 0.87);
  font-size: 16px;
  line-height: 1.5;
  width: fit-content;
}

.d-checkbox.error {
  color: #b00020;
}

.d-checkbox.error > p {
  font-size: 10px;
  margin-left: 8px;
  display: block;
  color: #b00020;
  margin-top: 2px;
  width: 100%;
  margin-block-end: 0;
  position: absolute;
}

.d-checkbox > p {
  display: none;
}

.d-checkbox > input {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  z-index: -1;
  position: absolute;
  left: -10px;
  top: -8px;
  display: block;
  margin: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.6);
  box-shadow: none;
  outline: none;
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s;
}

.d-form .d-grid .d-checkbox > input,
.d-tab-form .d-grid .d-checkbox > input {
  top: 0;
}

.d-checkbox > span {
  display: inline-block;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.d-form .d-grid .d-checkbox > span,
.d-tab-form .d-grid .d-checkbox > span {
  margin-top: 8px;
}

.d-checkbox > span::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  margin: 3px 11px 3px 1px;
  border: 2px solid rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  width: 18px;
  height: 18px;
  vertical-align: top;
  transition: border-color 0.2s, background-color 0.2s;
}

.d-checkbox.error > span::before {
  border: 2px solid #b00020;
}

.d-checkbox > span::after {
  content: "";
  display: block;
  position: absolute;
  top: 4px;
  left: 2px;
  width: 10px;
  height: 5px;
  border: solid 2px transparent;
  border-right: none;
  border-top: none;
  transform: translate(3px, 4px) rotate(-45deg);
}

.d-form .d-grid .d-checkbox > span::after,
.d-tab-form .d-grid .d-checkbox > span::after {
  top: 12px;
  left: 2px;
}

.d-checkbox > input:checked,
.d-checkbox > input:indeterminate {
  background-color: #2185d0;
}

.d-checkbox.error > input:checked,
.d-checkbox.error > input:indeterminate {
  background-color: #b00020;
}

.d-checkbox > input:checked + span::before,
.d-checkbox > input:indeterminate + span::before {
  border-color: #2185d0;
  background-color: #2185d0;
}

.d-checkbox.error > input:checked + span::before,
.d-checkbox.error > input:indeterminate + span::before {
  border-color: #b00020;
  background-color: #b00020;
}

.d-checkbox > input:checked + span::after,
.d-checkbox > input:indeterminate + span::after {
  border-color: rgb(255, 255, 255);
}

.d-checkbox > input:indeterminate + span::after {
  border-left: none;
  transform: translate(4px, 3px);
}

.d-checkbox:hover > input {
  opacity: 0.08;
}

.d-checkbox > input:focus {
  opacity: 0.12;
}

.d-checkbox:hover > input:focus {
  opacity: 0.16;
}

.d-checkbox > input:active {
  opacity: 1;
  transform: scale(0);
  transition: transform 0s, opacity 0s;
}

.d-checkbox > input:active + span::before {
  border-color: #2185d0;
}

.d-checkbox.error > input:active + span::before {
  border-color: #b00020;
}

.d-checkbox > input:checked:active + span::before {
  border-color: transparent;
  background-color: rgba(0, 0, 0, 0.6);
}

.d-checkbox > input:disabled {
  opacity: 0;
}

.d-checkbox > input:disabled + span {
  color: rgba(0, 0, 0, 0.38);
  cursor: initial;
}

.d-checkbox > input:disabled + span::before {
  border-color: currentColor;
}

.d-checkbox > input:checked:disabled + span::before,
.d-checkbox > input:indeterminate:disabled + span::before {
  border-color: transparent;
  background-color: currentColor;
}
