body {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.checkbox input {
  display: none;
}

label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 1.5rem;
  position: relative;
  user-select: none;
}

.checkbox label:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid #4caf50;
  margin-right: 0.5rem;
  border-radius: 2px;
  transition: all 0.3s;
}

.checkbox-1 label:after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-block;
  width: 4px;
  height: 10px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.3s;
}

.checkbox-1 input:checked + label:before,
.checkbox-2 input:checked + label:before {
  background-color: #4caf50;
}

.checkbox-1 input:checked + label:after {
  transform: rotate(45deg) scale(1);
}

.checkbox-2 label:after {
  content: "\2713";
  position: absolute;
  left: 1px;
  top: -2px;
  transform: rotate(10deg) scale(0);
  color: #fff;
  transition: transform 0.3s;
}

.checkbox-2 input:checked + label:after {
  transform: rotate(10deg) scale(0.9);
}
