/* Reusable service-flow component. Add service-flow--snake for a 4-3 zig-zag layout. */

.service-flow {
    margin: 40px 0;
    padding: 55px 20px 70px;
    background: #f7f9fc;
}

.service-flow__container {
    max-width: 1180px;
    margin: 0 auto;
}

.service-flow__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 70px 55px;
}

.service-flow__card {
    position: relative;
    z-index: 2;
    min-height: 300px;
    padding: 32px 22px 27px;
    border: 1px solid #e5ebf0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(16, 24, 40, .06);
    opacity: 0;
    transform: translateY(25px);
    animation: serviceFlowAppear .6s ease forwards;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.service-flow__card:hover {
    border-color: rgba(0, 130, 202, .3);
    box-shadow: 0 15px 35px rgba(0, 130, 202, .13);
    transform: translateY(-7px);
}

@keyframes serviceFlowAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-flow__step--1 { animation-delay: .1s; }
.service-flow__step--2 { animation-delay: .2s; }
.service-flow__step--3 { animation-delay: .3s; }
.service-flow__step--4 { animation-delay: .4s; }
.service-flow__step--5 { animation-delay: .5s; }
.service-flow__step--6 { animation-delay: .6s; }
.service-flow__step--7 { animation-delay: .7s; }

.service-flow--snake .service-flow__step--5 { grid-column: 4; grid-row: 2; }
.service-flow--snake .service-flow__step--6 { grid-column: 3; grid-row: 2; }
.service-flow--snake .service-flow__step--7 { grid-column: 2; grid-row: 2; }

.service-flow__number {
    position: absolute;
    z-index: 5;
    top: -22px;
    left: 20px;
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0082ca;
    box-shadow: 0 0 0 7px #e5f3fa;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.service-flow__icon {
    display: flex;
    width: 67px;
    height: 67px;
    margin: 5px auto 18px;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: #eef8fd;
    color: #0082ca;
    font-size: 28px;
    transition: all .3s ease;
}

.service-flow__card:hover .service-flow__icon {
    background: #0082ca;
    color: #fff;
    transform: scale(1.07);
}

.service-flow__card h3 {
    margin: 0 0 11px;
    color: #1d2939;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.service-flow__card p {
    margin: 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.service-flow__duration {
    display: table;
    margin: 15px auto 0;
    padding: 6px 11px;
    border-radius: 20px;
    background: #fff7df;
    color: #9a6b00;
    font-size: 11px;
    font-weight: 700;
}

.service-flow__duration i { margin-right: 5px; }

.service-flow__arrow--right::after,
.service-flow__arrow--left::before {
    position: absolute;
    z-index: 1;
    top: 50%;
    color: #0082ca;
    font-size: 30px;
    font-weight: 700;
}

.service-flow__arrow--right::after {
    right: -48px;
    content: "→";
    animation: serviceFlowArrowRight 1.2s infinite alternate;
}

.service-flow__arrow--left::before {
    left: -48px;
    content: "←";
    animation: serviceFlowArrowLeft 1.2s infinite alternate;
}

@keyframes serviceFlowArrowRight {
    from { opacity: .4; transform: translate(-5px, -50%); }
    to { opacity: 1; transform: translate(5px, -50%); }
}

@keyframes serviceFlowArrowLeft {
    from { opacity: .4; transform: translate(5px, -50%); }
    to { opacity: 1; transform: translate(-5px, -50%); }
}

.service-flow__connector--down {
    position: absolute;
    z-index: 3;
    top: 330px;
    right: 18px;
    color: #0082ca;
    font-size: 30px;
    font-weight: 700;
    animation: serviceFlowArrowDown 1.2s infinite alternate;
}

.service-flow__connector--line {
    position: absolute;
    z-index: 1;
    top: 305px;
    right: 27px;
    height: 90px;
    border-left: 3px dashed #abd9ef;
}

@keyframes serviceFlowArrowDown {
    from { opacity: .4; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(5px); }
}

.service-flow__card--complete {
    border-top: 4px solid #198754;
}

.service-flow__card--complete .service-flow__number {
    background: #198754;
    box-shadow: 0 0 0 7px #e1f3e9;
}

.service-flow__card--complete .service-flow__icon {
    background: #eaf7ef;
    color: #198754;
}

.service-flow__card--complete:hover .service-flow__icon {
    background: #198754;
    color: #fff;
}

.service-flow__summary {
    max-width: 700px;
    margin: 45px auto 0;
    padding: 14px 20px;
    border: 1px solid #d6edf8;
    border-radius: 12px;
    background: #eef8fd;
    color: #006da9;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 991px) {
    .service-flow__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 55px 35px;
    }

    .service-flow--snake .service-flow__step--5,
    .service-flow--snake .service-flow__step--6,
    .service-flow--snake .service-flow__step--7 {
        grid-column: auto;
        grid-row: auto;
    }

    .service-flow__arrow--right::after,
    .service-flow__arrow--left::before,
    .service-flow__connector--down,
    .service-flow__connector--line {
        display: none;
    }
}

@media (max-width: 600px) {
    .service-flow { padding: 40px 15px 55px; }

    .service-flow__grid {
        display: flex;
        flex-direction: column;
        gap: 42px;
    }

    .service-flow__card {
        min-height: auto;
        padding: 32px 22px 27px;
    }
}
