/* =========================================================
   Help tooltip used on form pages. Small info icon that
   reveals its description on hover / keyboard focus.
   ========================================================= */

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: right;
  width: 20px;
  height: 20px;
  margin: 0 0 0 0.4rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  cursor: help;
  z-index: 2;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.help-tip::before {
  font-family: "FontAwesome";
  content: "\f05a"; /* fa-info-circle */
  font-weight: 400;
  display: inline-block;
}

.help-tip:hover,
.help-tip:focus,
.help-tip:focus-within {
  color: #2563eb;
  transform: translateY(-1px);
  outline: 0;
}

/* Popup card — hidden until hover/focus. */
.help-tip p {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  width: 280px;
  max-width: 80vw;
  margin: 0;
  padding: 0.8rem 0.95rem;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  z-index: 9999;
  cursor: auto;
}

.help-tip:hover p,
.help-tip:focus p,
.help-tip:focus-within p {
  display: block;
  animation: help-tip-fade 0.15s ease-out;
}

/* Arrow pointing up to the icon */
.help-tip p::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 9px;
  width: 13px;
  height: 13px;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: rotate(45deg);
}

/* Transparent hover-bridge so crossing the gap to the popup doesn't
   dismiss it. */
.help-tip p::after {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

@keyframes help-tip-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 575.98px) {
  .help-tip p {
    width: 240px;
    right: -4px;
  }
}
