/* ===== Icono de ayuda ===== */
.fa-help-icon {
  position: relative;
  display: inline-block;
  margin: 0 0.25em;
  color: #007bff;
  font-weight: bold;
  cursor: pointer;
  width: 1em;
  text-align: center;
}

.fa-help-icon::after {
  content: attr(data-help);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.4em);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0.4em 0.6em;
  border-radius: 0.4em;
  white-space: normal;
  overflow-wrap: break-word;
  width: 300px;
  font-size: 0.85em;

  /* ————— Aquí ————— */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* —————————— */

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  text-align: left;
  z-index: 100;
}

/* ===== Flecha del tooltip ===== */
.fa-help-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 4px);               /* justo debajo del tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

/* ===== Mostrar tooltip al pasar el cursor ===== */
.fa-help-icon:hover::after,
.fa-help-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ===== Label con tooltip: texto e icono en línea, luego el campo ===== */
#fa-form-agendamiento .fa-section > label[data-help] {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;                        /* para que el input baje */
}

/* Separación entre el texto del label y el “?” */
#fa-form-agendamiento .fa-section > label[data-help] .fa-help-icon {
  margin-left: 0.25em;
}

/* El campo (input/select/textarea) ocupa toda la línea debajo */
#fa-form-agendamiento .fa-section > label[data-help] input,
#fa-form-agendamiento .fa-section > label[data-help] select,
#fa-form-agendamiento .fa-section > label[data-help] textarea {
  flex: 0 0 100%;
  margin-top: 0.5em;
}

/* ===== Ajustes para tablet ===== */
@media (max-width: 768px) {
  .fa-help-icon::after {
    max-width: 150px;
    font-size: 0.8em;
    padding: 0.3em 0.5em;
  }
  .fa-help-icon::before {
    border-width: 3px;
  }
}

/* ===== Ajustes para móvil ===== */
@media (max-width: 480px) {
  .fa-help-icon::after {
    max-width: 120px;
    font-size: 0.75em;
    padding: 0.25em 0.4em;
  }
  .fa-help-icon::before {
    border-width: 2px;
  }
}
