@import "import";

.checkbox *,
.checkbox ::after,
.checkbox ::before {
  box-sizing: border-box;
}
.checkbox {
  min-height: 2.4rem;
  //outline: 1px red solid;

  .cbx {
    position: relative;
    display: block;
    float: left;
    margin-top: 0.22em;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    background-color: transparent;
    border: 0.22rem solid color(white);
    transition: all 0.15s ease;

    svg {
      position: absolute;
      top: 0.2rem;
      left: 0.2rem;
      width: 1.2rem;
      height: 1.3rem;
      fill: none;
      stroke-linecap: unset;
      stroke-linejoin: miter;
      stroke: color(white);
      stroke-width: 3.6;
      stroke-dasharray: 26;
      stroke-dashoffset: 26;
      transform: translate3d(0, 0, 0);
    }
  }
  .cbx + span {
    float: left;
    margin-left: 6px;
  }
}
.checkbox {
  user-select: none;

  label {
    display: inline-block;
    cursor: pointer;

    a {
      text-decoration: underline;
    }
  }
  span.label {
    margin-left: 1rem;

    a {
      &:focus-visible {
        outline: 2px color(white) solid;
      }
    }
  }
  input[type="checkbox"] {
    //display: none;
    //visibility: hidden;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    z-index: -1;
    border: none;

    &:checked + .cbx {
      background-color: transparent;
    }
    &:checked + .cbx svg {
      stroke-dashoffset: 0;
      transition: all 0.4s ease-out;
    }
    &:focus,
    &:focus-visible {
      outline: none !important;
      box-shadow: none !important;
      border: none !important;
    }

    &:focus-visible + .cbx {
      outline: 2px solid color(white);
    }
  }
}
