.checkbox {
  opacity: 0;
  position: absolute;
}

.checkbox-label {
  background-color: #2b2828;
  border-radius: 50px;
  position: relative;
  padding: 3px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 36px;
  height: 20px;
  margin: 5px;
  box-sizing: border-box;
}

.fa-moon,
.fa-sun {
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 50%;
}

.fa-moon {
  color: #f1c40f;
}

.fa-sun {
  color: #f39c12;
}

.checkbox-label .ball {
  background-color: #fff;
  width: 14px;
  height: 14px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  transition: transform 0.2s linear;
}

.checkbox:checked + .checkbox-label .ball {
  transform: translateX(16px);
}

.darklight {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 767px) {
  #_mobile_user_info .darklight {
    margin-left: .5rem;
  }

  .checkbox-label { /* pour le tactile */
    width: 40px;
    height: 22px;
    padding: 3px;
  }

  .checkbox-label .ball {
    width: 16px;
    height: 16px;
  }

  .checkbox:checked + .checkbox-label .ball {
    transform: translateX(18px);
  }
}

#_desktop_user_info,
#_mobile_user_info {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .5rem;      /* petit espace régulier entre items */
  min-width: 0;
}

.user-info.darklight-item { /* ton bouton devient un "vrai" item */
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;       /* évite les marges par défaut */
  padding: 0;
}

/* ton style existant */
.darklight-item .checkbox-label {
  width: 36px;
  height: 20px;
  padding: 3px;
}

@media (max-width: 767px) {
  .darklight-item .checkbox-label {
    width: 40px;
    height: 22px;
  }
}
