.accordion {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .accordion {
    gap: 0.75rem;
  }
}

.accordion__item {
  border: 1px solid #e4e4e4;
  background-color: rgba(255, 255, 255, 0.4);
  padding: 1.5rem;
  transition: all 300ms;
}

.accordion__item_show {
  background-color: white;
}

.accordion__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.accordion__toggle {
  border-radius: 100%;
  border: 1px solid #e4e4e4;
  background-color: white;
  color: black;
  padding: 0.5rem;
  rotate: 45deg;
  cursor: pointer;
  transition: all 300ms;
}

@media (hover: hover) {
  .accordion__toggle:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
  }
}

.accordion__toggle:active {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
}

.accordion__item_show .accordion__toggle {
  background-color: black;
  color: white;
  rotate: 0deg;
}

.accordion__content {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 300ms ease;
}

.accordion__content > * {
  min-height: 0;
  overflow: hidden;
}

.accordion__content p:first-child {
  margin-top: 1rem;
}

.accordion__item_show .accordion__content {
  grid-template-rows: 1fr;
}

.popup_overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  transition: all 300ms;
}

.popup_overlay_show {
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  pointer-events: all;
}

.popup__content {
  transition: all 300ms;
}

.popup_overlay:not(.popup_overlay_show) .popup__content {
  opacity: 0;
}

.stages-cards {
  display: flex;
  gap: 0.5rem;
  margin-top: 3rem;
  min-height: 320px;
}

.stages-cards__item {
  position: relative;
  flex: 1;
  min-width: 4.5rem;
  background-color: white;
  border-radius: 1em;
  padding: 0.75rem;
  overflow: hidden;
  transition: flex 400ms ease, background-color 300ms;
}

.stages-cards__item_active {
  flex: 4;
  background-color: rgba(0, 0, 0, 0.9);
}

.stages-cards__index {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 3em;
  line-height: 1;
  font-weight: 700;
  color: #e5e7eb;
  pointer-events: none;
}

.stages-cards__item_active .stages-cards__index {
  color: rgba(255, 255, 255, 0.2);
}

.stages-cards__inner {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1em;
  padding: 0.75rem;
  height: 100%;
  min-height: 17.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-right: 3rem;
}

.stages-cards__title {
  font-size: 1.5em;
  line-height: 1;
  font-weight: 600;
  color: black;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: white-space 300ms;
}

.stages-cards__item_active .stages-cards__title {
  color: white !important;
  white-space: normal;
  overflow: visible;
}

.stages-cards__body {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 300ms ease, max-height 400ms ease, margin-top 300ms ease;
}

.stages-cards__body p {
  margin: 0;
  font-size: 0.875em;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

.stages-cards__item_active .stages-cards__body p {
  color: white !important;
}

.stages-cards__item_active .stages-cards__body {
  opacity: 1;
  max-height: 20rem;
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .stages-cards {
    flex-direction: column;
    min-height: auto;
    margin-top: 2rem;
  }

  .stages-cards__item {
    flex: none;
    min-width: auto;
  }

  .stages-cards__item_active {
    flex: none;
  }

  .stages-cards__index {
    top: 1rem;
    right: 1rem;
    font-size: 2.5em;
  }

  .stages-cards__inner {
    min-height: auto;
    height: auto;
    justify-content: flex-start;
    padding-top: 3rem;
    padding-right: 3.5rem;
  }

  .stages-cards__title {
    white-space: normal;
  }

  .stages-cards__body {
    opacity: 1;
    max-height: none;
    margin-top: 0.75rem;
    overflow: visible;
  }
}
