.inail-checkbox {
  display: flex;
  align-items: center;
}

.inail-checkbox label {
  font-family: "Open Sans", sans-serif;
  margin: 0 !important;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  vertical-align: middle;
  color: #19191a;
  display: flex;
  align-items: center;
}

.inail-checkbox span i {
  cursor: pointer !important;
}

.inail-checkbox label:hover {
  color: #00458f;
}

/* .inail-checkbox:hover .custom-checkbox-background {
  border-color: #00458f !important;
} */

.inail-checkbox input:disabled + label {
  color: #54595d !important;
}

.inail-checkbox-span-error {
  padding-left: 30px !important;
}

/* NEW STYLE */

/* Contenitore flessibile per allineare checkbox ed etichetta */
.custom-checkbox-container {
  display: flex;
  flex-direction: column;
  /* Posiziona gli elementi in colonna */
  align-items: flex-start;
  /* Allinea a sinistra */
  gap: 8px;
  font-family: Arial, sans-serif;
}

/* Nasconde l'input nativo ma lo mantiene accessibile */
.custom-checkbox {
  position: absolute;
  opacity: 0;
  width: 24px;
  height: 24px;
}

input#check_all:indeterminate + label .custom-checkbox-background .inail-checkbox-icon {
  opacity: 1 !important;
}

input#check_all:indeterminate + label .custom-checkbox-background .inail-checkbox-icon::before {
  content: "\f068";
  /* Font Awesome Minus icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  /* Ensure proper rendering */
}

.custom-checkbox-container.inail-indeterminate:hover label .custom-checkbox-background {
  background: #0059b8 !important;
  border-color: #0059b8 !important;
}

/* Stile dell'etichetta, che funge anche da contenitore */
.custom-checkbox-container label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Sfondo del checkbox */
.custom-checkbox-background {
  width: 24px;
  height: 24px;
  border: 2px solid #7e858b;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mostra il checkmark quando il checkbox è selezionato */
.custom-checkbox:checked + label .inail-checkbox-icon {
  opacity: 1 !important;
}

/* Effetto focus quando si usa TAB */
.custom-checkbox:focus + label .custom-checkbox-background {
  outline: 2px solid black;
  /* Indica il focus */
  outline-offset: 2px;
}

/* Hover sull'etichetta */
.custom-checkbox-container label:hover .custom-checkbox-background {
  border-color: #0059b8 !important;
}

/* Cambia colore all'hover quando è selezionato */
.custom-checkbox:checked + label:hover .custom-checkbox-background {
  background: #0059b8 !important;
  border-color: #0059b8 !important;
}

.inail-checkbox-icon::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
}

/* Icona Font Awesome */
.custom-checkbox-background .inail-checkbox-icon {
  font-size: 16px;
  color: #19191a;
}

/* Hover sull'icona */
.custom-checkbox:hover + label .custom-checkbox-background .inail-checkbox-icon {
  color: #0059b8;
  /* Cambia colore all'hover */
}

/* Icona bianca quando il checkbox è selezionato */
.custom-checkbox:checked + label .custom-checkbox-background .inail-checkbox-icon {
  color: white;
}

/* Centra l'icona dentro il checkbox */
.custom-checkbox-background .inail-checkbox-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Disabilita il cursor quando il checkbox è disabilitato */
.custom-checkbox:disabled + label {
  cursor: not-allowed;
}

/* Cambia colore all'hover solo se è disabilitato */
.custom-checkbox:disabled + label .custom-checkbox-background {
  border-color: #a9aeb1 !important;
}

.custom-checkbox:disabled + label .custom-checkbox-background .inail-checkbox-icon {
  color: #a9aeb1;
}

/* Stile per il checkbox in errore */
.custom-checkbox.custom-checkbox-error + label .custom-checkbox-background {
  border-color: #c9291b;
}

/* Nasconde l'icona quando il checkbox NON è selezionato */
.custom-checkbox-background .inail-checkbox-icon {
  opacity: 0;
}

/* Mostra l'icona SOLO quando il checkbox è selezionato */
.custom-checkbox:checked + label .custom-checkbox-background .inail-checkbox-icon {
  display: flex;
}

/* Stato selezionato */
.custom-checkbox:checked + label .custom-checkbox-background {
  background: #002e5f;
  border-color: #002e5f;
}

.custom-checkbox:checked:hover + label .custom-checkbox-background {
  background: #0059b8 !important;
  border-color: #0059b8 !important;
}

.custom-checkbox:disabled:checked + label .custom-checkbox-background {
  background: #e4e5e9 !important;
  border-color: #e4e5e9 !important;
  color: #7e858b !important;
}

.inail-checkbox-legend {
  font-size: 14px !important;
  color: #19191a !important;
  line-height: 24px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
}

.inail-file-uploader-label small {
  color: #000 !important;
  font-weight: 400 !important;
}
