.stage {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

/* Line from this circle's center to the next one; the circle covers the part inside it. */
.stage::after {
    content: "";
    position: absolute;
    top: 36px;
    left: 50%;
    width: calc(100% + 20px);
    height: 1px;
    background-color: rgba(var(--terra-green), 0.2);
}

.stage:last-child::after {
    display: none;
}

.stage .stage-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto;
    color: rgba(var(--warm-gray), 1);
    background-color: rgba(var(--cream), 1);
    border: 1px solid rgba(var(--terra-green), 1);
    border-radius: 50%;
    transition: filter 0.2s ease;
}

/* A filter, not a transparent background: the circle has to stay fully opaque to cover the
   connecting line behind it, so a translucent hover tint would let the line show through. */
.stage .stage-icon:hover {
    filter: brightness(1.1);
}

.stage .stage-icon svg {
    width: 32px;
    height: 32px;
}

.stage .stage-name {
    margin: 20px 0 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(var(--terra-green), 1);
}

.stage .stage-description {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Plain :last-child, not a manually-set class: the last stage in the actual list is always the
   final one, so this can never go stale if stages are reordered or a new one is added after it
   (the earlier isFinal toggle could). */
.stage:last-child .stage-icon {
    color: rgba(var(--cream), 1);
    background-color: rgba(var(--terra-green), 1);
}

/* md: icon on the left, name/description stacked beside it, instead of icon-on-top centered. Grid
   rather than a markup change, since .stage has no wrapper around the name/description pair. */
@media (max-width: 767.98px) {
    .stage {
        display: grid;
        grid-template-columns: 72px 1fr;
        column-gap: 16px;
        text-align: left;
    }

    .stage::after {
        content: none;
    }

    .stage .stage-icon {
        grid-row: 1 / 3;
        grid-column: 1;
        margin: 0;
    }

    .stage .stage-name {
        grid-column: 2;
        margin: 0;
        align-self: end;
    }

    .stage .stage-description {
        grid-column: 2;
        margin: 2px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage .stage-icon {
        transition: none;
    }
}
