:root {
    --hiw-row: 110px;
    --hiw-row-gap: 100px;
    --hiw-step3-offset: 125px;
}

.customer-how-it-works {
    padding: 50px 0;
    position: relative;
    overflow: visible;
}

.customer-how-it-works .container{
    max-width: 100%;
}

.customer-how-it-works .hiw-title-wrapper {
    width: 207px;
    height: 47px;
    border-radius: 25px;
    border: 1px solid #2FBED280;
    background: #2FBED21A;
    box-shadow: 0px 2px 4px 0px #00000040, 0px 2px 15px 0px #00000040 inset;

    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;

    font-weight: 600;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text-primary);
    white-space: nowrap;

    z-index: 1;
    justify-self: center;
}

.customer-how-it-works .badge-bg-img {
    position: absolute;
    top: 0;
    left: 29%;
    width: 100%;
    height: 100%;

    object-fit: fill;

    z-index: 0;
    pointer-events: none;

}

.hiw-grid {
    position: relative;
    margin: 0 auto;
    z-index: 1;
}

.hiw-step {
    width: 350px;
    min-height: 110px;
    border-radius: 20px;
    padding: 20px 25px;
    box-shadow: 0px 2px 5px 0px #00000040;

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;

    font-family: 'Allerta', sans-serif;
    font-weight: 400;
    font-size: var(--font-size-xs);
    line-height: 1.2;
    color: var(--text-primary);
}

.step-label {
    position: absolute;
    top: -35px;
    left: 0;
    font-family: 'Allerta', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    color: #22418C;
    white-space: nowrap;
}

.step-label-right .step-label {
    left: auto;
    right: 0;
    text-align: right;
}

#step-1 { background-color: var(--bg-septuagintennary); }
#step-2 { background-color: var(--bg-octogintennary); }
#step-3 { background-color: var(--bg-nonagintennary); }
#step-4 { background-color: var(--bg-centennary); }
#step-5 { background-color: var(--bg-vicennary); }

@media (min-width: 1025px) {
    .hiw-grid {
        position: relative;
        margin: 0 auto;
        height: calc(var(--hiw-row) + var(--hiw-row-gap) + var(--hiw-row));
    }

    #step-1,
    #step-2,
    #step-3,
    #step-4,
    #step-5 {
        position: absolute;
        width: 350px;
    }

    #step-1 {
        left: 10%;
    }

    #step-2 {
        left: 50%;
        transform: translateX(-50%);
    }

    #step-3 {
        top: var(--hiw-step3-offset);
        right: 5%;
    }

    #step-5 {
        top: calc(var(--hiw-row) + var(--hiw-row-gap));
        left: 15%;
    }

    #step-4 {
        top: calc(var(--hiw-row) + var(--hiw-row-gap));
        left: 45%;
    }
}

@media (max-width: 1500px) {
    .hiw-step{
        width: 300px !important;
    }
}
@media (max-width: 1250px) {
    .hiw-step{
        width: 260px !important;
    }

    #step-4 {
        left: 43% !important;
    }
    #step-5 {
        left: 13% !important;
    }
}

@media (max-width: 1150px) {
    #step-4 {
        left: 39% !important;
    }
    #step-5 {
        left: 8% !important;
    }
}

@media (max-width: 1024px) {
    .customer-how-it-works{
        margin-bottom: 20px;
    }
    .hiw-grid {
        display: grid;
        justify-content: space-between;
        grid-template-columns: 50% 50%;
        gap: 20% 0;
        align-items: start;
    }

    .hiw-grid > *:nth-child(even) {
        transform: translateY(50%) !important;
    }

    .hiw-grid > * {
        will-change: transform;
    }

    .hiw-step{
        border-radius: 10px;
    }

    #step-1,
    #step-2,
    #step-3,
    #step-4,
    #step-5 {
        position: static;
        transform: none;
        width: 100% !important;
        max-width: 400px !important;
        justify-self: center;
    }

    .hiw-arrows-layer {
        display: block;
    }

    .step-label {
        left: 0 !important;
        right: auto !important;
        text-align: left !important;
    }

    .hiw-grid > *:nth-child(even) .step-label{
        right: 0 !important;
        left: auto !important;
        text-align: right !important;
    }

}

@media (max-width: 920px) {
    .hiw-grid {
        grid-template-columns: 45% 45%;
    }

    #step-1,
    #step-2,
    #step-3,
    #step-4,
    #step-5 {
        max-width: 360px !important;
    }
}

@media (max-width: 520px) {
    .hiw-step{
        font-size: 10px;
        padding: var(--space-lg) 10px;
        max-height: 110px;
        min-height: auto;
    }
    .step-label{
        left: 17px !important;
        font-size: 10px;
        top: -15px;
    }
}

.hiw-arrows-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

#arrow-1-2,
#arrow-2-3,
#arrow-3-4,
#arrow-4-5 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hiw-debug-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 999;
    pointer-events: none;
}