:root {
    --primary: rgba(50, 150, 0, 0.8);
    --other: rgba(0, 0, 0, 0.5);
}

/* label */
label.custom-checkbox {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;

  margin: 0 12px;

  cursor: pointer;
  position: relative;
}

/* input */
label.custom-checkbox input {
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

/* .design */
label.custom-checkbox .design {
  width: 16px;
  height: 16px;

  border: 1px solid var(--other);
  border-radius: 100%;
  margin-right: 5px;

  position: relative;
}

label.custom-checkbox .design::before, .design::after {
  content: "";
  display: block;

  width: inherit;
  height: inherit;

  border-radius: inherit;

  position: absolute;
  transform: scale(0);
  transform-origin: center center;
}

label.custom-checkbox .design:before {
  background: var(--other);
  opacity: 0;
  transition: 0.3s;
}

label.custom-checkbox .design::after {
  background: var(--primary);
  opacity: 0.4;
  transition: 0.6s;
}

/* .text */
label.custom-checkbox .text {
  color: var(--other);
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  font-weight: bold;
}

/* checked state */
label.custom-checkbox input:checked + .design::before {
  opacity: 1;
  transform: scale(0.5);
}

/* other states */
label.custom-checkbox input:hover + .design,
label.custom-checkbox input:focus + .design {
  border: 1px solid var(--primary);
}

label.custom-checkbox input:hover + .design:before,
label.custom-checkbox input:focus + .design:before {
  background: var(--primary);
}

label.custom-checkbox input:hover ~ .text {
  color: var(--primary);
}

label.custom-checkbox input:focus + .design::after,
label.custom-checkbox input:active + .design::after {
  opacity: 0.1;
  transform: scale(2.0);
}
