.flow-container {
    position: relative;
    width: 100%;
    padding: 0 5%;
    margin-top: 30px;
}

.background-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-image {
    position: absolute;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.process-flow > div {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--delay), transform 0.8s var(--delay);
}

.process-flow > div.visible {
    opacity: 1;
    transform: translateY(0);
}

.background-image1 {
    width: 350px;
    height: 300px;
    top: 25%;
    left: 5%;
}

.background-image2 {
    width: 400px;
    height: 350px;
    top: 41%;
    right: 3%;
}

.background-image3 {
    width: 300px;
    height: 400px;
    bottom: 21%;
    left: 2%;
}

.background-image4 {
    width: 350px;
    height: 300px;
    bottom: 8%;
    right: 3%;
}

.process-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    margin-bottom: 80px;
}

.process-flow > div:first-child {
    margin-top: 0; /* 最初のステップの上部余白をゼロに設定 */
}

.step-left, .step-right {
    position: relative;
    width: 100%;
    max-width: 80%;
    padding: 15px 20px;
    margin-top: 40px;
    text-align: start;
}

.step-left {
    align-self: center;
}

.step-right {
    align-self: center;
}

.step-left::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 10%;
    width: 2px;
    height: 40px;
    background-color: #ccc;
    transform: translateX(-50%);
}

.step-right::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 10%;
    width: 2px;
    height: 40px;
    background-color: #ccc;
    transform: translateX(-50%);
}

.first-step-left::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 10%;
    width: 2px;
    height: 40px;
    background-color: #ccc;
    transform: translateX(-50%);
}

.first-step-right::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 10%;
    width: 2px;
    height: 40px;
    background-color: #ccc;
    transform: translateX(-50%);
}

.step-title {
    letter-spacing: 0.2rem;
    font-size: calc(0.8rem + 0.5vw);
    margin-bottom: 5px;
    color: rgba(0, 0, 0, 0.7);
}

.step-detail {
    letter-spacing: 0.2rem;
    font-size: calc(0.5rem + 0.5vw);
    color: rgba(0, 0, 0, 0.7);
}

.step-left:first-child::before {
    display: none; /* 最初のステップの上の線を消す */
}
.step-left .n::before{
    display: none !important;
}

@media (max-width: 1200px) {
    .background-image {
        opacity: 0.6;
    }
}

@media (max-width: 768px) {
    .flow-container {
        margin-top: 20px;
    }

    .background-image {
        opacity: 0.4;
        scale: 0.8;
    }

    .background-image1 {
        top: 20%;
        left: -5%;
    }

    .background-image2 {
        top: 45%;
        right: -5%;
    }

    .background-image3 {
        top: 70%;
        left: -5%;
    }

    .background-image4 {
        top: 95%;
        right: -5%;
    }

    .page-flow {
        margin-bottom: 50px;
    }
}

@media (max-width: 576px) {
    .flow-container {
        margin-top: 10px;
    }

    .background-image {
        opacity: 0.3;
        scale: 0.9;
    }

    .step-left, .step-right {
        position: relative;
        width: 100%;
        max-width: 80%;
        padding: 15px 20px;
        margin-top: 40px;
        text-align: start;
    }
    .step-left, .step-right {
        max-width: 100%;
        padding: 10px 0px;
    }

    .background-image1 {
        left: -10px;
    }

    .background-image2 {
        right: -10px;
    }

    .background-image3 {
        left: -10px;
    }

    .background-image4 {
        right: -10px;   
    }

    .page-flow {
        margin-bottom: 30px;
    }
}
