/* Modal layout */
.modal__overlay { position: absolute; inset: 0; }
.modal__container { position: relative; background: #fff; border-radius: 16px; padding: 1.5rem; max-width: 32rem; width: 90%; max-height: 90vh; overflow-y: auto; z-index: 1; }
.modal__close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; cursor: pointer; padding: .25rem; }
.modal__body { margin-top: .5rem; }

/* Form fields */
.form__group { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.form__group .input,
.form__group .select { width: 100%; box-sizing: border-box; }
.form__label { font-size: 1rem; line-height: 1.5; color: #1a1918; }
.form__error { font-size: .875rem; color: #d63a3a; }
.form__actions { display: flex; gap: .75rem; margin-top: .5rem; }


/* Reusable confirm dialog — must sit above other popups (training-popup z:200) */
.confirm-modal { z-index: 300; }
.confirm-modal__actions { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.25rem; }
.confirm-modal__actions .btn { width: 100%; }

/* §1.5 Add Course modal — sits above training-popup (z:200) */
.add-course-modal { z-index: 300; visibility: hidden; opacity: 0; }
.add-course-modal.is-visible { visibility: visible; opacity: 1; }
.add-course-modal .form__actions { justify-content: flex-end; }
.add-course-modal .form__actions .btn { min-width: 8rem; padding-left: 1.25rem; padding-right: 1.25rem; }

/* OTP inputs */
.input--otp { width: 3rem; height: 3rem; text-align: center; font-size: 1.25rem; padding: .5rem; }

/* Password field width */
.password-form__input { width: 100%; }


/* Checkbox group (multi-select checkboxes) */
.checkbox-group { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }

/* Flash messages & alerts */
.flash-messages { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; max-width: 28rem; width: 100%; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; line-height: 1.4; }
.alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert__close { background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0; color: inherit; opacity: .6; }
.alert__close:hover { opacity: 1; }

/* Quiz — widen the question card beyond the frontend's default max-width */
.health-check__body--quiz .health-check__content { max-width: 48rem; }

/* Activate Training popup — extra space under the description */
.activate-popup__desc { margin-bottom: 1.5rem; }

/* ── Edit Schedule popup (dots menu + drag feedback) ── */
.training-popup__sidebar .separator { margin: 1.25rem 0; }
.training-popup__dots-menu { background: #fff; border: 1px solid #e8e1ce; border-radius: .5rem; box-shadow: 0 4px 12px rgba(0,0,0,.1); min-width: 12rem; overflow: hidden; }
.training-popup__dots-menu-item { display: block; width: 100%; padding: .5rem .75rem; font-size: .8125rem; background: none; border: none; cursor: pointer; text-align: left; color: #1a1918; }
.training-popup__dots-menu-item:hover { background-color: #f5f4f2; }
.training-popup__dots-menu-item--back { color: rgba(26,25,24,.5); font-size: .75rem; }
.training-popup__stage-item[draggable="true"] { cursor: grab; }
.training-popup__stage-item[draggable="true"]:active { cursor: grabbing; }

/* Badge locked state — small lock in top-right corner */
.badges-card__lock--corner { top: -0.25rem; right: -0.25rem; left: auto; transform: none; width: 1.25rem; height: 1.25rem; background: #fff; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.badges-card__lock--corner svg { width: 0.875rem; height: 0.875rem; }

/* Certificates page — modal + card interaction */
.bs-certificates__item { cursor: default; }
.bs-certificates__item[data-badge-modal-trigger] { cursor: pointer; }
.bs-certificates__card-link { display: contents; color: inherit; text-decoration: none; }
.bs-certificates__share { cursor: pointer; background: none; border: none; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: .25rem; }

.bs-achievement { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 1rem .5rem; }
.bs-achievement__eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: #6b7280; margin: 0; }
.bs-achievement__image { width: 10rem; height: 10rem; display: flex; align-items: center; justify-content: center; }
.bs-achievement__image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bs-achievement__title { margin: 0; }
.bs-achievement__subtitle { margin: 0; color: #6b7280; }
.bs-achievement__congrats { margin: .5rem 0 1rem; color: #1a1918; }
.bs-achievement__share { margin-top: .5rem; }

/* Certificate/badge share dropdown — page-local wrap used inside cards */
.bs-certificates__share-wrap { position: relative; display: inline-flex; }
.bs-certificates__share-wrap .bs-certificates__share-links { position: absolute; bottom: 100%; right: 0; display: none; gap: .5rem; background: #fff; border: 1px solid #e8e1ce; border-radius: .5rem; padding: .5rem; box-shadow: 0 4px 12px rgba(0,0,0,.1); margin-bottom: .25rem; z-index: 10; }
.bs-certificates__share-wrap.is-open .bs-certificates__share-links { display: flex; }
.bs-certificates__share-wrap .bs-certificates__share-links a { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; color: #1a1918; }

/* Sticky side-menu on leaderboard pages (§1.7 & §2.4). Height shrinks to
   content — a fixed 100vh aside would get released near the bottom of its
   containing block and jump above the sticky line. */
@media (min-width: 48.0625em) {
  .leaderboard__aside,
  .bs-leaderboard__aside {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    width: 100%;
  }
}
.leaderboard__aside .aside__link,
.bs-leaderboard__aside .aside__link { cursor: pointer; }

/* Section anchors: leave room so the sticky header doesn't cover the heading. */
.leaderboard__card[id] { scroll-margin-top: 1.5rem; }


/* Give the last card enough room so scrollspy can reliably activate it. */
.leaderboard__main::after,
.bs-leaderboard__main::after {
  content: "";
  display: block;
  min-height: 40vh;
}


.dashboard__company-item picture img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
}

.benchmark-card__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
}

.benchmark-card__info-btn:hover {
  opacity: 0.8;
}

.benchmark-modal p {
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.benchmark-modal h3 {
  margin: 1.25rem 0 0.5rem;
}

.benchmark-modal__pillars {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal__container--wide {
  max-width: 40rem;
}
