input[type='checkbox']{ height: 0; width: 0; }

input[type='checkbox'] + label{
  position: relative;
  display: flex;
  align-items: center;
  color: #32271c;
  transition: color 250ms cubic-bezier(.4,.0,.23,1);
  text-align: left;
}
input[type='checkbox'] + label > ins{
  position: absolute;
  display: block;
  bottom: 0;
  left: 2em;
  height: 0;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
  transition: height 300ms cubic-bezier(.4,.0,.23,1);
}
input[type='checkbox'] + label > ins > i{
  position: absolute;
  bottom: 0;
  font-style: normal;
  color: #4FC3F7;
}
input[type='checkbox'] + label > span{
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 0.5em;
  margin-left: -0.5em;
  width: 1.2em;
  height: 1.2em;
  background: transparent;
  border: 2px solid var(--dark-color);
  border-radius: 2px;
  cursor: pointer;  
  transition: all 250ms cubic-bezier(.4,.0,.23,1);
  box-sizing: border-box;
  padding: 0.2em;
}

input[type='checkbox'] + label:hover, input[type='checkbox']:focus + label{
  color: #000;
}
input[type='checkbox'] + label:hover > span, input[type='checkbox']:focus + label > span{
  background: rgba(255,255,255,.1);
}
input[type='checkbox']:checked + label > ins{ height: 100%; }

input[type='checkbox']:checked + label > span{
  background-color: var(--dark-color);
  animation: shrink-bounce 200ms cubic-bezier(.4,.0,.23,1);
  box-sizing: border-box;
}
input[type='checkbox']:checked + label > span:before{
  content: "";
  position: absolute;
  left: -0.25em;
  border-right: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: rotate(45deg);
  transform-origin: 0% 100%;
  animation: checkbox-check 125ms 250ms cubic-bezier(.4,.0,.23,1) forwards;
  filter: invert();
}

@keyframes shrink-bounce{
  0%{
    transform: scale(1);
  }
  33%{    
    transform: scale(.85);
  }
  100%{
    transform: scale(1);    
  }
}
@keyframes checkbox-check{
  0%{
    width: 0;
    height: 0;
    border-color: #212121;
    transform: translate3d(0,0,0) rotate(45deg);
  }
  33%{
    width: .2em;
    height: 0;
    transform: translate3d(0,0,0) rotate(45deg);
  }
  100%{    
    width: .2em;
    height: .5em;    
    border-color: #212121;
    transform: translate3d(0,-.5em,0) rotate(45deg);
  }
}


input[type="radio"] {
  display: none;  
  & + label {
    position: relative;
    display: inline-block;
    padding-left: 24px;
    margin-right: 32px;
    cursor: pointer;
    line-height: 16px;
    transition: all .2s ease-in-out;
    margin-bottom: 10px;
    &:before, &:after {
      content: '';
      position: absolute;
      top: -1px;
      left: 0;
      width: 16px;
      height: 16px;
      text-align: center;
      color:  var(--dark-color);
      font-family: Times;
      border-radius: 50%;
      transition: all .3s ease;
    }
  }
}
input[type="radio"] + label {
  &:before {    
    box-shadow:
      inset 0 0 0 1px #666565,
      inset 0 0 0 16px #fff,
      inset 0 0 0 16px var(--dark-color);
  }
  &:hover{
    color: var(--dark-color);
  }
  &:hover:before {
    transition: all .3s ease;
    animation-duration: .5s;
    animation-name: change-size;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    box-shadow:
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 16px #fff,
      inset 0 0 0 16px var(--dark-color);
  }
}
input[type="radio"]:checked + label {
  &:hover{
    color: #3d2f23;
    cursor: default;
  }
  &:before {
    transition: all .3s ease;
    animation-duration: .2s;
    animation-name: select-radio;
    animation-iteration-count: 1;
    animation-direction: Normal;
    box-shadow:
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 3px #fff,
      inset 0 0 0 16px var(--dark-color);
  }

}

@keyframes change-size{
  from {
    box-shadow: 0 0 0 0 var(--dark-color),
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 16px #fff,
      inset 0 0 0 16px var(--dark-color);      
  }

  to {
    box-shadow: 0 0 0 1px var(--dark-color),
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 16px #fff,
      inset 0 0 0 16px var(--dark-color);
  }
}


@keyframes select-radio{
  0% {
    box-shadow:
      0 0 0 0 #91DEAC,
      inset 0 0 0 2px #fff,
      inset 0 0 0 3px var(--dark-color),
      inset 0 0 0 16px #fff,
      inset 0 0 0 16px var(--dark-color);   
  }

  90% {
    box-shadow:
      0 0 0 10px #E8FFF0,
       inset 0 0 0 0 #fff,
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 2px #fff,
      inset 0 0 0 16px var(--dark-color);
  }
  
  100% {
    box-shadow:
      0 0 0 12px #E8FFF0,
      inset 0 0 0 0 #fff,
      inset 0 0 0 1px var(--dark-color),
      inset 0 0 0 3px #fff,
      inset 0 0 0 16px var(--dark-color);
  }
}
