@layer components {
  /* Convenience class so we can reuse it for formkit dropdowns as well */
  .has-checkbox-icon {
    &:before,
    &:after {
      @apply block content-[''] w-20 min-w-[20px] h-20 cursor-pointer transition-all ease-in-out duration-250;
    }

    &:after {
      @apply absolute top-0 left-0;
    }

    &:before {
      @apply border border-blue-900 rounded;
    }

    &:focus:before {
      @apply outline-none shadow-purple-600 border-purple-600;
    }

    &[data-checked='true']:before,
    &:checked:before {
      @apply bg-blue-900 border-blue-900;
    }

    &:after {
      @apply opacity-0 content-[""] bg-center bg-[length:12px_12px] bg-no-repeat;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.7071 0.292893C12.0976 0.683417 12.0976 1.31658 11.7071 1.70711L4.70711 8.70711C4.51957 8.89464 4.26522 9 4 9C3.73478 9 3.48043 8.89464 3.29289 8.70711L0.292893 5.70711C-0.0976311 5.31658 -0.0976311 4.68342 0.292893 4.29289C0.683417 3.90237 1.31658 3.90237 1.70711 4.29289L4 6.58579L10.2929 0.292893C10.6834 -0.0976311 11.3166 -0.0976311 11.7071 0.292893Z' fill='#fff'/%3E%3C/svg%3E");
    }

    &[data-checked='true']:after,
    &:checked:after {
      @apply opacity-100;
    }

    &:hover:before {
      @apply border-blue-500 bg-blue-500;
    }

    &:disabled:before {
      @apply border-gray-500 bg-gray-500;
    }
  }

  .checkbox {
    @apply flex flex-row items-center gap-10;
    @apply text-base text-gray-900 pb-0 cursor-pointer;

    & input[type='checkbox'] {
      @apply appearance-none outline-none border-none relative w-20 h-20;

      &:before,
      &:after {
        @apply block content-[''] w-20 min-w-[20px] h-20 cursor-pointer transition-all ease-in-out duration-250;
      }

      &:after {
        @apply absolute top-0 left-0;
      }

      &:before {
        @apply border border-blue-900 rounded;
      }

      &:focus:before {
        @apply outline-none shadow-purple-600 border-purple-600;
      }

      &[data-checked='true']:before,
      &:checked:before {
        @apply bg-blue-900 border-blue-900;
      }

      &:after {
        @apply opacity-0 content-[""] bg-center bg-[length:12px_12px] bg-no-repeat;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.7071 0.292893C12.0976 0.683417 12.0976 1.31658 11.7071 1.70711L4.70711 8.70711C4.51957 8.89464 4.26522 9 4 9C3.73478 9 3.48043 8.89464 3.29289 8.70711L0.292893 5.70711C-0.0976311 5.31658 -0.0976311 4.68342 0.292893 4.29289C0.683417 3.90237 1.31658 3.90237 1.70711 4.29289L4 6.58579L10.2929 0.292893C10.6834 -0.0976311 11.3166 -0.0976311 11.7071 0.292893Z' fill='#fff'/%3E%3C/svg%3E");
      }

      &[data-checked='true']:after,
      &:checked:after {
        @apply opacity-100;
      }

      &:hover:before {
        @apply border-blue-500 bg-blue-500;
      }

      &:disabled:before {
        @apply border-gray-500 bg-gray-500;
      }

      &:before {
        @apply absolute top-0 left-0;
      }
    }
  }
}
