#step_indicator {
  container: form/inline-size;
  margin: auto;
  width: 100%;
}

#step_indicator .steps {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 0.25em 0.25rem 0 0;
  display: flex;
  padding: 1.5em;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}
#step_indicator .steps__connector, #step_indicator .steps__step {
  position: relative;
}

#step_indicator .steps__connector {
  background-color: var(--color-progress-todo);
  margin-inline-start: 0.75em;
  width: 0.125em;
  height: 1.25em;
}

#step_indicator .steps__step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1;
}

#step_indicator .steps__step-name {
  font-size: 0.75em;
  line-height: 2;
}

#step_indicator .steps__step-number {
  background-color: var(--color-progress-todo);
  border-radius: 50%;
  margin-inline-end: 0.5em;
  text-align: center;
  width: 2.5em;
  height: 2.5em;
  align-content: center;
}

#step_indicator .steps__step--done .steps__step-number, #step_indicator .steps__step--done.steps__connector {
  background-color: var(--color-progress-done);
}

#step_indicator .steps__step--current .steps__step-number, #step_indicator .steps__step--current .steps__step-name {
  font-weight: bold;
  font-size: 1rem;
}

/* Change layout depending on form width */
@container form (min-width: 30em) {
  #step_indicator .steps {
    flex-direction: row;
    align-items: center;
    padding: 0.5% 25% 1.5% 25%;
  }
  #step_indicator .steps__connector {
    margin-inline-start: 0;
    width: 100%;
    height: 0.5em;
    margin-top: 0.5rem;
    transform: translateY(-50%);
  }
  #step_indicator .steps__connector:before {
    transform: scale(0, 1);
    transform-origin: 0 50%;
  }
  [dir=rtl] .steps__connector:before {
    transform-origin: 100% 50%;
  }
  #step_indicator .steps__step-name {
    position: absolute;
    top: 100%;
    left: 50%;
    text-align: center;
    width: 20em;
    transform: translateX(-50%);
  }
  #step_indicator .steps__step-number {
    margin-inline-end: 0;
  }
}