/* Styled replacement for the browser's native constraint-validation bubble.
   Paired with public/js/form-validation.js (frontend layouts only). */

.fv-tip {
  position: fixed;
  top: 0;
  right: auto;
  left: 0;
  z-index: 20000;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid var(--tb-sale, #e53935);
  border-radius: var(--tb-radius-sm, 10px);
  background: #fff5f5;
  box-shadow: 0 10px 26px rgba(229, 57, 53, .22);
  color: var(--tb-sale-dark, #c62828);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  text-align: right;
  direction: rtl;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  pointer-events: none;
}

.fv-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fv-tip__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--tb-sale, #e53935);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.fv-tip__icon::before {
  content: "!";
}

.fv-tip__text {
  flex: 1 1 auto;
}

/* Arrow — --fv-arrow-x is set by the script so it points at the field's center. */
.fv-tip::before,
.fv-tip::after {
  content: "";
  position: absolute;
  left: var(--fv-arrow-x, 20px);
  width: 0;
  height: 0;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.fv-tip[data-placement="bottom"]::before {
  bottom: 100%;
  border-bottom: 7px solid var(--tb-sale, #e53935);
}

.fv-tip[data-placement="bottom"]::after {
  bottom: calc(100% - 1px);
  border-bottom: 7px solid #fff5f5;
}

.fv-tip[data-placement="top"]::before {
  top: 100%;
  border-top: 7px solid var(--tb-sale, #e53935);
}

.fv-tip[data-placement="top"]::after {
  top: calc(100% - 1px);
  border-top: 7px solid #fff5f5;
}

/* The offending control, while it stays invalid. */
.fv-invalid,
.fv-invalid.form-control,
.fv-invalid.form-select {
  border-color: var(--tb-sale, #e53935) !important;
  box-shadow: 0 0 0 .18rem rgba(229, 57, 53, .16) !important;
}

.fv-invalid.btn-check + .btn {
  border-color: var(--tb-sale, #e53935);
  color: var(--tb-sale-dark, #c62828);
}
