/* ============================================================================
   Required * next to form labels (components/required-marker.blade.php).
   Hover shows a CSS-only popup - same convention as .credit-note-hover-* in
   dashboard/cost-selling/styles/form.blade.php, so it also works on cloned
   <template> rows and AJAX fragments without any JS init.
   ========================================================================== */
.required-marker {
  position: relative;
  display: inline-block;
  margin-inline-start: 0.25rem;
  font-size: 1.1em;
  font-weight: 700;
  line-height: 0.5;
  vertical-align: -0.15em;
  cursor: help;
}

/* The flag is an icon, not a glyph like *, so it sits on the text; a short
   line box keeps it from making the label taller. */
.required-marker--step {
  font-size: 1.1em;
  line-height: 0.5;
  vertical-align: -0.05em;
  color: var(--bs-info);
}

/* Hidden by required-markers.js when a conditional rule isn't met. */
.required-marker[hidden] {
  display: none;
}

.required-marker--required {
  color: var(--bs-danger);
}

.required-marker--conditional {
  color: #c98500; /* fallback where color-mix isn't supported */
  color: color-mix(in srgb, var(--bs-warning) 80%, #000);
}

.required-marker-popup {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  z-index: 1080;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  color: #566a7f;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
}

.required-marker-popup::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 14px;
  border: 6px solid transparent;
  border-bottom-color: #fff;
}

.required-marker:hover .required-marker-popup {
  display: block;
}
