/* Soft red highlighting for validation errors on forms */

/* Error text blocks (Yii2/Bootstrap variants) */
.has-error .help-block,
.has-error .help-block-error,
.help-block-error,
.invalid-feedback {
  color: #842029;              /* soft red text */
  background: #fdecea;         /* very light red background */
  border-left: 3px solid #f5c2c0; /* subtle accent */
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Input borders/backgrounds when invalid */
.has-error .form-control,
.form-control.is-invalid,
.is-invalid {
  border-color: #e88181;
  background-color: #fff6f6;
  box-shadow: 0 0 0 0.12rem rgba(220, 53, 69, 0.1);
}

/* Labels in error state */
.has-error .control-label,
.has-error label {
  color: #b94a48;
}

/* Error summary box */
.error-summary {
  border: 1px solid #f5c2c0;
  background: #fdecea;
  color: #842029;
  padding: 10px 12px;
  border-radius: 4px;
}

/* Required field asterisk styling */
/* Yii adds the .required class to form-group when an attribute has a required rule */
.required > label::after,
.required .control-label::after,
.form-group.required > label.control-label::after {
  content: " *";
  color: #d9534f; /* soft red, Bootstrap-like */
  font-weight: normal;
}

/* Fix horizontal menu dropdown positioning on scroll/resize.
   On desktop, force the collapse-based dropdown to behave like an
   absolute-positioned dropdown anchored below its parent nav-item. */
@media (min-width: 1024.1px) {
  [data-layout=horizontal] .navbar-nav .nav-item {
    position: relative;
  }

  /* When Bootstrap collapse opens the menu-dropdown, override its
     block-flow position and make it absolute below the nav-item */
  [data-layout=horizontal] .navbar-nav .nav-item > .menu-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: auto !important;
    min-width: 12rem;
  }

  /* Prevent the open dropdown from pushing other nav items down */
  [data-layout=horizontal] .navbar-nav .nav-item > .menu-dropdown.show {
    display: block !important;
    height: auto !important;
  }
}
