.custom-checkbox-square {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.custom-checkbox-square input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
}

.checkmark,
.checkmark-black {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  border: 2px solid #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 1.25rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.checkmark-black {
  border: 2px solid #d9d9d9;
}

/* При наведении — слегка подсвечиваем */
.custom-checkbox-square:hover .checkmark {
  border-color: #999;
}
.custom-checkbox-square:hover .checkmark-black {
  border-color: #6e6e6e;
}

/* Когда отмечен — делаем белый фон и показываем галочку */
.custom-checkbox-square input:checked ~ .checkmark {
  background-color: transparent;
  border-color: #fff;
  color: black;
}

.custom-checkbox-square input:checked ~ .checkmark-black {
  color: #272727;
}

/* Анимация появления галочки */
.custom-checkbox-square input:checked ~ .checkmark::before {
  color: black;
  font-size: 1.25rem;
  font-weight: bold;
  animation: fadeInCheck 0.2s ease-out;
}

@keyframes fadeInCheck {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
