/* Bootstrap 4 -> 5 compatibility shim for legacy templates. */

/* Legacy accessibility helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Legacy close button support */
.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  background: transparent;
  border: 0;
  padding: 0;
}

.close:hover,
.close:focus {
  opacity: 0.75;
  text-decoration: none;
}

.close:not(:disabled):not(.disabled) {
  cursor: pointer;
}

/* Utility aliases removed in Bootstrap 5 */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

@media (min-width: 576px) {
  .text-sm-left { text-align: left !important; }
  .text-sm-right { text-align: right !important; }
}

@media (min-width: 768px) {
  .text-md-left { text-align: left !important; }
  .text-md-right { text-align: right !important; }
}

@media (min-width: 992px) {
  .text-lg-left { text-align: left !important; }
  .text-lg-right { text-align: right !important; }
}

@media (min-width: 1200px) {
  .text-xl-left { text-align: left !important; }
  .text-xl-right { text-align: right !important; }
}

@media (min-width: 1400px) {
  .text-xxl-left { text-align: left !important; }
  .text-xxl-right { text-align: right !important; }
}

.float-left { float: left !important; }
.float-right { float: right !important; }

.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-italic { font-style: italic !important; }

/* Legacy full-width button utility */
.btn-block {
  display: block;
  width: 100%;
}

/* Legacy contextual badge classes removed in Bootstrap 5 */
.badge-primary { background-color: #0d6efd; color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-success { background-color: #198754; color: #fff; }
.badge-danger { background-color: #dc3545; color: #fff; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-info { background-color: #0dcaf0; color: #212529; }
.badge-light { background-color: #f8f9fa; color: #212529; }
.badge-dark { background-color: #212529; color: #fff; }

/* Explicit spacing aliases retained for old templates */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }
.m-auto { margin: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mt-auto { margin-top: auto !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mb-auto { margin-bottom: auto !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-4 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-5 { margin-left: 3rem !important; margin-right: 3rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.my-auto { margin-top: auto !important; margin-bottom: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* Spacing aliases: left/right -> start/end */
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }
.mr-auto { margin-right: auto !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* Responsive spacing aliases for BS4 left/right utilities */
@media (min-width: 576px) {
  .ml-sm-0 { margin-left: 0 !important; }
  .ml-sm-1 { margin-left: 0.25rem !important; }
  .ml-sm-2 { margin-left: 0.5rem !important; }
  .ml-sm-3 { margin-left: 1rem !important; }
  .ml-sm-4 { margin-left: 1.5rem !important; }
  .ml-sm-5 { margin-left: 3rem !important; }
  .ml-sm-auto { margin-left: auto !important; }

  .mr-sm-0 { margin-right: 0 !important; }
  .mr-sm-1 { margin-right: 0.25rem !important; }
  .mr-sm-2 { margin-right: 0.5rem !important; }
  .mr-sm-3 { margin-right: 1rem !important; }
  .mr-sm-4 { margin-right: 1.5rem !important; }
  .mr-sm-5 { margin-right: 3rem !important; }
  .mr-sm-auto { margin-right: auto !important; }

  .pl-sm-0 { padding-left: 0 !important; }
  .pl-sm-1 { padding-left: 0.25rem !important; }
  .pl-sm-2 { padding-left: 0.5rem !important; }
  .pl-sm-3 { padding-left: 1rem !important; }
  .pl-sm-4 { padding-left: 1.5rem !important; }
  .pl-sm-5 { padding-left: 3rem !important; }

  .pr-sm-0 { padding-right: 0 !important; }
  .pr-sm-1 { padding-right: 0.25rem !important; }
  .pr-sm-2 { padding-right: 0.5rem !important; }
  .pr-sm-3 { padding-right: 1rem !important; }
  .pr-sm-4 { padding-right: 1.5rem !important; }
  .pr-sm-5 { padding-right: 3rem !important; }

  .mt-sm-0 { margin-top: 0 !important; }
  .mt-sm-1 { margin-top: 0.25rem !important; }
  .mt-sm-2 { margin-top: 0.5rem !important; }
  .mt-sm-3 { margin-top: 1rem !important; }
  .mt-sm-4 { margin-top: 1.5rem !important; }
  .mt-sm-5 { margin-top: 3rem !important; }
  .mt-sm-auto { margin-top: auto !important; }

  .mb-sm-0 { margin-bottom: 0 !important; }
  .mb-sm-1 { margin-bottom: 0.25rem !important; }
  .mb-sm-2 { margin-bottom: 0.5rem !important; }
  .mb-sm-3 { margin-bottom: 1rem !important; }
  .mb-sm-4 { margin-bottom: 1.5rem !important; }
  .mb-sm-5 { margin-bottom: 3rem !important; }
  .mb-sm-auto { margin-bottom: auto !important; }

  .pt-sm-0 { padding-top: 0 !important; }
  .pt-sm-1 { padding-top: 0.25rem !important; }
  .pt-sm-2 { padding-top: 0.5rem !important; }
  .pt-sm-3 { padding-top: 1rem !important; }
  .pt-sm-4 { padding-top: 1.5rem !important; }
  .pt-sm-5 { padding-top: 3rem !important; }

  .pb-sm-0 { padding-bottom: 0 !important; }
  .pb-sm-1 { padding-bottom: 0.25rem !important; }
  .pb-sm-2 { padding-bottom: 0.5rem !important; }
  .pb-sm-3 { padding-bottom: 1rem !important; }
  .pb-sm-4 { padding-bottom: 1.5rem !important; }
  .pb-sm-5 { padding-bottom: 3rem !important; }
}

@media (min-width: 768px) {
  .ml-md-0 { margin-left: 0 !important; }
  .ml-md-1 { margin-left: 0.25rem !important; }
  .ml-md-2 { margin-left: 0.5rem !important; }
  .ml-md-3 { margin-left: 1rem !important; }
  .ml-md-4 { margin-left: 1.5rem !important; }
  .ml-md-5 { margin-left: 3rem !important; }
  .ml-md-auto { margin-left: auto !important; }

  .mr-md-0 { margin-right: 0 !important; }
  .mr-md-1 { margin-right: 0.25rem !important; }
  .mr-md-2 { margin-right: 0.5rem !important; }
  .mr-md-3 { margin-right: 1rem !important; }
  .mr-md-4 { margin-right: 1.5rem !important; }
  .mr-md-5 { margin-right: 3rem !important; }
  .mr-md-auto { margin-right: auto !important; }

  .pl-md-0 { padding-left: 0 !important; }
  .pl-md-1 { padding-left: 0.25rem !important; }
  .pl-md-2 { padding-left: 0.5rem !important; }
  .pl-md-3 { padding-left: 1rem !important; }
  .pl-md-4 { padding-left: 1.5rem !important; }
  .pl-md-5 { padding-left: 3rem !important; }

  .pr-md-0 { padding-right: 0 !important; }
  .pr-md-1 { padding-right: 0.25rem !important; }
  .pr-md-2 { padding-right: 0.5rem !important; }
  .pr-md-3 { padding-right: 1rem !important; }
  .pr-md-4 { padding-right: 1.5rem !important; }
  .pr-md-5 { padding-right: 3rem !important; }

  .mt-md-0 { margin-top: 0 !important; }
  .mt-md-1 { margin-top: 0.25rem !important; }
  .mt-md-2 { margin-top: 0.5rem !important; }
  .mt-md-3 { margin-top: 1rem !important; }
  .mt-md-4 { margin-top: 1.5rem !important; }
  .mt-md-5 { margin-top: 3rem !important; }
  .mt-md-auto { margin-top: auto !important; }

  .mb-md-0 { margin-bottom: 0 !important; }
  .mb-md-1 { margin-bottom: 0.25rem !important; }
  .mb-md-2 { margin-bottom: 0.5rem !important; }
  .mb-md-3 { margin-bottom: 1rem !important; }
  .mb-md-4 { margin-bottom: 1.5rem !important; }
  .mb-md-5 { margin-bottom: 3rem !important; }
  .mb-md-auto { margin-bottom: auto !important; }

  .pt-md-0 { padding-top: 0 !important; }
  .pt-md-1 { padding-top: 0.25rem !important; }
  .pt-md-2 { padding-top: 0.5rem !important; }
  .pt-md-3 { padding-top: 1rem !important; }
  .pt-md-4 { padding-top: 1.5rem !important; }
  .pt-md-5 { padding-top: 3rem !important; }

  .pb-md-0 { padding-bottom: 0 !important; }
  .pb-md-1 { padding-bottom: 0.25rem !important; }
  .pb-md-2 { padding-bottom: 0.5rem !important; }
  .pb-md-3 { padding-bottom: 1rem !important; }
  .pb-md-4 { padding-bottom: 1.5rem !important; }
  .pb-md-5 { padding-bottom: 3rem !important; }
}

@media (min-width: 992px) {
  .ml-lg-0 { margin-left: 0 !important; }
  .ml-lg-1 { margin-left: 0.25rem !important; }
  .ml-lg-2 { margin-left: 0.5rem !important; }
  .ml-lg-3 { margin-left: 1rem !important; }
  .ml-lg-4 { margin-left: 1.5rem !important; }
  .ml-lg-5 { margin-left: 3rem !important; }
  .ml-lg-auto { margin-left: auto !important; }

  .mr-lg-0 { margin-right: 0 !important; }
  .mr-lg-1 { margin-right: 0.25rem !important; }
  .mr-lg-2 { margin-right: 0.5rem !important; }
  .mr-lg-3 { margin-right: 1rem !important; }
  .mr-lg-4 { margin-right: 1.5rem !important; }
  .mr-lg-5 { margin-right: 3rem !important; }
  .mr-lg-auto { margin-right: auto !important; }

  .pl-lg-0 { padding-left: 0 !important; }
  .pl-lg-1 { padding-left: 0.25rem !important; }
  .pl-lg-2 { padding-left: 0.5rem !important; }
  .pl-lg-3 { padding-left: 1rem !important; }
  .pl-lg-4 { padding-left: 1.5rem !important; }
  .pl-lg-5 { padding-left: 3rem !important; }

  .pr-lg-0 { padding-right: 0 !important; }
  .pr-lg-1 { padding-right: 0.25rem !important; }
  .pr-lg-2 { padding-right: 0.5rem !important; }
  .pr-lg-3 { padding-right: 1rem !important; }
  .pr-lg-4 { padding-right: 1.5rem !important; }
  .pr-lg-5 { padding-right: 3rem !important; }

  .mt-lg-0 { margin-top: 0 !important; }
  .mt-lg-1 { margin-top: 0.25rem !important; }
  .mt-lg-2 { margin-top: 0.5rem !important; }
  .mt-lg-3 { margin-top: 1rem !important; }
  .mt-lg-4 { margin-top: 1.5rem !important; }
  .mt-lg-5 { margin-top: 3rem !important; }
  .mt-lg-auto { margin-top: auto !important; }

  .mb-lg-0 { margin-bottom: 0 !important; }
  .mb-lg-1 { margin-bottom: 0.25rem !important; }
  .mb-lg-2 { margin-bottom: 0.5rem !important; }
  .mb-lg-3 { margin-bottom: 1rem !important; }
  .mb-lg-4 { margin-bottom: 1.5rem !important; }
  .mb-lg-5 { margin-bottom: 3rem !important; }
  .mb-lg-auto { margin-bottom: auto !important; }

  .pt-lg-0 { padding-top: 0 !important; }
  .pt-lg-1 { padding-top: 0.25rem !important; }
  .pt-lg-2 { padding-top: 0.5rem !important; }
  .pt-lg-3 { padding-top: 1rem !important; }
  .pt-lg-4 { padding-top: 1.5rem !important; }
  .pt-lg-5 { padding-top: 3rem !important; }

  .pb-lg-0 { padding-bottom: 0 !important; }
  .pb-lg-1 { padding-bottom: 0.25rem !important; }
  .pb-lg-2 { padding-bottom: 0.5rem !important; }
  .pb-lg-3 { padding-bottom: 1rem !important; }
  .pb-lg-4 { padding-bottom: 1.5rem !important; }
  .pb-lg-5 { padding-bottom: 3rem !important; }
}

@media (min-width: 1200px) {
  .ml-xl-0 { margin-left: 0 !important; }
  .ml-xl-1 { margin-left: 0.25rem !important; }
  .ml-xl-2 { margin-left: 0.5rem !important; }
  .ml-xl-3 { margin-left: 1rem !important; }
  .ml-xl-4 { margin-left: 1.5rem !important; }
  .ml-xl-5 { margin-left: 3rem !important; }
  .ml-xl-auto { margin-left: auto !important; }

  .mr-xl-0 { margin-right: 0 !important; }
  .mr-xl-1 { margin-right: 0.25rem !important; }
  .mr-xl-2 { margin-right: 0.5rem !important; }
  .mr-xl-3 { margin-right: 1rem !important; }
  .mr-xl-4 { margin-right: 1.5rem !important; }
  .mr-xl-5 { margin-right: 3rem !important; }
  .mr-xl-auto { margin-right: auto !important; }

  .pl-xl-0 { padding-left: 0 !important; }
  .pl-xl-1 { padding-left: 0.25rem !important; }
  .pl-xl-2 { padding-left: 0.5rem !important; }
  .pl-xl-3 { padding-left: 1rem !important; }
  .pl-xl-4 { padding-left: 1.5rem !important; }
  .pl-xl-5 { padding-left: 3rem !important; }

  .pr-xl-0 { padding-right: 0 !important; }
  .pr-xl-1 { padding-right: 0.25rem !important; }
  .pr-xl-2 { padding-right: 0.5rem !important; }
  .pr-xl-3 { padding-right: 1rem !important; }
  .pr-xl-4 { padding-right: 1.5rem !important; }
  .pr-xl-5 { padding-right: 3rem !important; }

  .mt-xl-0 { margin-top: 0 !important; }
  .mt-xl-1 { margin-top: 0.25rem !important; }
  .mt-xl-2 { margin-top: 0.5rem !important; }
  .mt-xl-3 { margin-top: 1rem !important; }
  .mt-xl-4 { margin-top: 1.5rem !important; }
  .mt-xl-5 { margin-top: 3rem !important; }
  .mt-xl-auto { margin-top: auto !important; }

  .mb-xl-0 { margin-bottom: 0 !important; }
  .mb-xl-1 { margin-bottom: 0.25rem !important; }
  .mb-xl-2 { margin-bottom: 0.5rem !important; }
  .mb-xl-3 { margin-bottom: 1rem !important; }
  .mb-xl-4 { margin-bottom: 1.5rem !important; }
  .mb-xl-5 { margin-bottom: 3rem !important; }
  .mb-xl-auto { margin-bottom: auto !important; }

  .pt-xl-0 { padding-top: 0 !important; }
  .pt-xl-1 { padding-top: 0.25rem !important; }
  .pt-xl-2 { padding-top: 0.5rem !important; }
  .pt-xl-3 { padding-top: 1rem !important; }
  .pt-xl-4 { padding-top: 1.5rem !important; }
  .pt-xl-5 { padding-top: 3rem !important; }

  .pb-xl-0 { padding-bottom: 0 !important; }
  .pb-xl-1 { padding-bottom: 0.25rem !important; }
  .pb-xl-2 { padding-bottom: 0.5rem !important; }
  .pb-xl-3 { padding-bottom: 1rem !important; }
  .pb-xl-4 { padding-bottom: 1.5rem !important; }
  .pb-xl-5 { padding-bottom: 3rem !important; }
}

@media (min-width: 1400px) {
  .mt-xxl-0 { margin-top: 0 !important; }
  .mt-xxl-1 { margin-top: 0.25rem !important; }
  .mt-xxl-2 { margin-top: 0.5rem !important; }
  .mt-xxl-3 { margin-top: 1rem !important; }
  .mt-xxl-4 { margin-top: 1.5rem !important; }
  .mt-xxl-5 { margin-top: 3rem !important; }
  .mt-xxl-auto { margin-top: auto !important; }

  .mb-xxl-0 { margin-bottom: 0 !important; }
  .mb-xxl-1 { margin-bottom: 0.25rem !important; }
  .mb-xxl-2 { margin-bottom: 0.5rem !important; }
  .mb-xxl-3 { margin-bottom: 1rem !important; }
  .mb-xxl-4 { margin-bottom: 1.5rem !important; }
  .mb-xxl-5 { margin-bottom: 3rem !important; }
  .mb-xxl-auto { margin-bottom: auto !important; }

  .pt-xxl-0 { padding-top: 0 !important; }
  .pt-xxl-1 { padding-top: 0.25rem !important; }
  .pt-xxl-2 { padding-top: 0.5rem !important; }
  .pt-xxl-3 { padding-top: 1rem !important; }
  .pt-xxl-4 { padding-top: 1.5rem !important; }
  .pt-xxl-5 { padding-top: 3rem !important; }

  .pb-xxl-0 { padding-bottom: 0 !important; }
  .pb-xxl-1 { padding-bottom: 0.25rem !important; }
  .pb-xxl-2 { padding-bottom: 0.5rem !important; }
  .pb-xxl-3 { padding-bottom: 1rem !important; }
  .pb-xxl-4 { padding-bottom: 1.5rem !important; }
  .pb-xxl-5 { padding-bottom: 3rem !important; }
}

/* BS4 layout helpers removed in BS5 */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
}

.form-row > .col,
.form-row > [class*="col-"] {
  padding-right: 5px;
  padding-left: 5px;
}

.no-gutters {
  margin-right: 0;
  margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
  padding-right: 0;
  padding-left: 0;
}

/* Input group legacy append/prepend wrappers */
.input-group > .input-group-prepend,
.input-group > .input-group-append {
  display: flex;
}

.input-group > .input-group-prepend > .btn,
.input-group > .input-group-append > .btn,
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-append > .input-group-text {
  position: relative;
  z-index: 2;
}

.input-group > .input-group-prepend > .btn:focus,
.input-group > .input-group-append > .btn:focus,
.input-group > .input-group-prepend > .input-group-text:focus,
.input-group > .input-group-append > .input-group-text:focus {
  z-index: 5;
}

.input-group > .input-group-prepend {
  margin-right: -1px;
}

.input-group > .input-group-append {
  margin-left: -1px;
}

.badge-pill {
  border-radius: 10rem;
  padding-right: 0.6em;
  padding-left: 0.6em;
}
