
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

.how-it-works-section {
    --primary: #4bacef;
    --heading: #ffffff;
    --text: rgba(255, 255, 255, 0.78);
    --border: rgba(255, 255, 255, 0.18);

    width: 100%;
    padding: 45px 30px;
    background: transparent;

    font-family: "Roboto Condensed", sans-serif !important;
    box-sizing: border-box;
    overflow: hidden;
}

.how-it-works-section *,
.how-it-works-section *::before,
.how-it-works-section *::after {
    box-sizing: border-box;
}

.hiw-steps {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(190px, 1fr) 80px
        minmax(190px, 1fr) 80px
        minmax(190px, 1fr) 80px
        minmax(190px, 1fr);

    align-items: start;
}

.hiw-step {
    position: relative;
    min-width: 0;
    padding: 10px;
    text-align: center;
    transition: transform 0.35s ease;
}

.hiw-content {
    max-width: 270px;
    margin: 0 auto;
}

.hiw-icon {
    position: relative;

    width: 108px;
    height: 108px;
    margin: 0 auto 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    background: #ffffff;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(75, 172, 239, 0.08);

    transform: rotate(7deg);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.hiw-icon::before {
    content: "";
    position: absolute;
    inset: 9px;

    border-radius: 23px;

    background: linear-gradient(
        145deg,
        rgba(75, 172, 239, 0.22),
        rgba(75, 172, 239, 0.04)
    );
}

.hiw-icon svg {
    position: relative;
    z-index: 2;

    width: 42px;
    height: 42px;

    fill: none;
    stroke: #111111;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transform: rotate(-7deg);
}

.step-number {
    position: absolute;
    z-index: 3;
    top: -13px;
    right: -13px;

    width: 37px;
    height: 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ffffff;
    border-radius: 50%;

    background: var(--primary);
    color: #ffffff;

    font-family: "Rajdhani","Rajdhani Fallback", sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;

    box-shadow: 0 9px 22px rgba(75, 172, 239, 0.42);

    transform: rotate(-7deg);
}

.hiw-content h3 { 
    margin: 0 0 10px;

    color: var(--heading);

    font-family: "Racing Sans One","Racing Sans One Fallback", sans-serif !important;
    font-size: 21px;
    font-weight: 400 !important;

    line-height: 1.35;
    letter-spacing: 0px;

    transition: color 0.3s ease;
}

.hiw-content p {
    max-width: 255px;
    margin: 0 auto;

    color: var(--text);

    font-family: "Rajdhani","Rajdhani Fallback", sans-serif !important;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.65;
}

.hiw-step:hover {
    transform: translateY(-5px);
}

.hiw-step:hover .hiw-icon {
    transform: translateY(-7px) rotate(7deg);

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.25),
        0 0 28px rgba(75, 172, 239, 0.25);
}


.hiw-arrow {
    padding-top: 38px;
}

.hiw-arrow svg {
    display: block;
    width: 100%;
    height: 35px;
    overflow: visible;
}

.hiw-arrow path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 7 7;

    filter: drop-shadow(0 0 5px rgba(75, 172, 239, 0.45));

    animation: hiwArrowMove 1.4s linear infinite;
}

@keyframes hiwArrowMove {
    to {
        stroke-dashoffset: -28;
    }
}

/* Tablet */
@media (max-width: 1100px) and (min-width: 768px) {
    .how-it-works-section {
        padding: 40px 25px;
    }

    .hiw-steps {
        grid-template-columns: 1fr 55px 1fr;
        row-gap: 55px;
        column-gap: 15px;
    }

    .hiw-step:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .hiw-arrow:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .hiw-step:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
    }

    .hiw-arrow:nth-child(4) {
        display: none;
    }

    .hiw-step:nth-child(5) {
        grid-column: 1;
        grid-row: 2;
    }

    .hiw-arrow:nth-child(6) {
        grid-column: 2;
        grid-row: 2;
    }

    .hiw-step:nth-child(7) {
        grid-column: 3;
        grid-row: 2;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .how-it-works-section {
        padding: 25px 15px;
    }

    .hiw-steps {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .hiw-step {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        align-items: center;
        gap: 18px;

        padding: 22px 18px;

        text-align: left;

        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 20px;

        background: rgba(255, 255, 255, 0.05);

        box-shadow:
            0 14px 35px rgba(0, 0, 0, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);

        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .hiw-step:hover {
        transform: none;
    }

    .hiw-content {
        max-width: none;
        margin: 0;
    }

    .hiw-icon {
        width: 76px;
        height: 76px;
        margin: 0;

        border-radius: 22px;
        transform: rotate(5deg);
    }

    .hiw-icon::before {
        inset: 7px;
        border-radius: 17px;
    }

    .hiw-icon svg {
        width: 31px;
        height: 31px;
        transform: rotate(-5deg);
    }

    .step-number {
        top: -10px;
        right: -10px;

        width: 31px;
        height: 31px;

        border-width: 3px;

        font-size: 12px;
        transform: rotate(-5deg);
    }

    .hiw-content h3 {
        margin-bottom: 6px;
        font-size: 18px!important;
        line-height: 1.25;
    }

    .hiw-content p {
        max-width: none;
        margin: 0;

        font-size: 17px!important;
        line-height: 1.5;
    }

    .hiw-arrow {
        position: relative;

        width: 2px;
        height: 45px;

        margin-left: 56px;
        padding: 0;

        border-left: 2px dashed var(--primary);
    }

    .hiw-arrow::after {
        content: "";

        position: absolute;
        bottom: 3px;
        left: -6px;

        width: 9px;
        height: 9px;

        border-right: 2px solid var(--primary);
        border-bottom: 2px solid var(--primary);

        transform: rotate(45deg);
    }

    .hiw-arrow svg {
        display: none;
    }
}

/* Small Mobile */
@media (max-width: 420px) {
    .how-it-works-section {
        padding: 20px 10px;
    }

    .hiw-step {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 14px;
        padding: 19px 14px;
    }

    .hiw-icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .hiw-icon::before {
        border-radius: 14px;
    }

    .hiw-icon svg {
        width: 27px;
        height: 27px;
    }

    .hiw-content h3 {
        font-size: 16px;
    }

    .hiw-content p {
        font-size: 13px;
    }

    .hiw-arrow {
        margin-left: 45px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hiw-arrow path {
        animation: none;
    }

    .hiw-step,
    .hiw-icon,
    .hiw-content h3 {
        transition: none;
    }
}

/* White arrows */
.hiw-arrow path {
    stroke: #ffffff !important;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.45)) !important;
}

/* Mobile vertical arrow */
@media (max-width: 767px) {
    .hiw-arrow {
        border-left-color: #ffffff !important;
    }

    .hiw-arrow::after {
        border-right-color: #ffffff !important;
        border-bottom-color: #ffffff !important;
    }
}
