/* Stepper offcanvas (core-ui/surfaces/stepper-offcanvas.ejs), modelled on the prototype's
   "Neue Idee" drawer: header, step bar, scrolling step content and a sticky footer. */

.ui-stepper {
  gap: 0;
}

.ui-stepper [hidden] {
  display: none !important;
}

.ui-stepper > .ui-surface__header {
  margin-bottom: 0;
}

.ui-stepper__form {
  display: flex;
  min-height: 0;
  flex: 1 0 auto;
  flex-direction: column;
}

.ui-stepper__nav {
  position: sticky;
  top: calc(-1 * var(--surface-pad-y));
  z-index: 1;
  margin: 0 calc(-1 * var(--surface-pad-x)) 1.5rem;
  padding: 0 var(--surface-pad-x);
  overflow-x: auto;
  background: var(--color-surface);
  border-bottom: 1px solid var(--surface-border);
  scrollbar-width: none;
}

.ui-stepper__nav-list {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 0.75rem;
  list-style: none;
}

.ui-stepper__nav-item {
  display: inline-flex;
  padding: 0.875rem 0.5rem;
  align-items: center;
  gap: 0.5rem;
  color: light-dark(#85958b, #94a5ad);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

.ui-stepper__nav-item:hover {
  color: var(--color-ink-soft);
}

.ui-stepper__nav-item:focus-visible {
  outline: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}

.ui-stepper__nav-item[aria-current="step"] {
  color: var(--color-brand-text);
  border-bottom-color: var(--color-brand);
}

.ui-stepper__nav-number {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid light-dark(#dce7df, #34474f);
  border-radius: 50%;
  font-size: 0.65rem;
  place-items: center;
}

.ui-stepper__nav-item[aria-current="step"] .ui-stepper__nav-number {
  color: var(--color-on-brand);
  background: var(--color-brand);
  border-color: var(--color-brand);
}

.ui-stepper__nav-item.is-complete .ui-stepper__nav-number {
  color: var(--color-brand-text);
  background: var(--color-brand-soft);
  border-color: var(--bs-primary-border);
}

.ui-stepper__steps {
  display: grid;
  flex: 1 0 auto;
  align-content: start;
  gap: 2rem;
  padding-bottom: 1.5rem;
}

.ui-stepper__step h3:focus {
  outline: 0;
}

.ui-stepper__footer {
  position: sticky;
  bottom: calc(-1 * var(--surface-pad-y));
  z-index: 1;
  display: grid;
  margin: auto calc(-1 * var(--surface-pad-x)) calc(-1 * var(--surface-pad-y));
  padding: 1.125rem var(--surface-pad-x);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  background: light-dark(#fcfdfb, #152128);
  border-top: 1px solid var(--surface-border);
}

.ui-stepper__footer [data-ui-stepper-prev] {
  justify-self: start;
}

.ui-stepper__footer :is([data-ui-stepper-next], [data-ui-stepper-submit]) {
  grid-column: 3;
  justify-self: end;
}

.ui-stepper__progress {
  grid-column: 2;
  color: light-dark(#8a9c8f, #94a5ad);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Without JavaScript all steps stay visible and only the submit action is offered. */

.ui-stepper__form:not(.is-enhanced) :is(.ui-stepper__nav, .ui-stepper__progress),
.ui-stepper__form:not(.is-enhanced) :is([data-ui-stepper-prev], [data-ui-stepper-next]) {
  display: none !important;
}
