/* =====================================================================
   AVORCMS v2 — HOW IT WORKS
   4-step onboarding / revenue cycle process
   ===================================================================== */

.v2-how {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    background: var(--v2-bg);
    font-family: var(--v2-font);

    padding: clamp(85px, 8vw, 125px) 0;
}


/* ---------------------------------------------------------------------
   Background
   --------------------------------------------------------------------- */

.v2-how__background {
    position: absolute;
    inset: 0;
    z-index: -1;

    overflow: hidden;
    pointer-events: none;
}

.v2-how__orb {
    position: absolute;
    border-radius: 50%;
}

.v2-how__orb--one {
    width: 460px;
    height: 460px;

    top: -300px;
    left: -180px;

    background: rgba(92, 27, 179, 0.045);
}

.v2-how__orb--two {
    width: 380px;
    height: 380px;

    right: -180px;
    bottom: -260px;

    background: rgba(255, 87, 87, 0.035);
}


/* ---------------------------------------------------------------------
   Container
   --------------------------------------------------------------------- */

.v2-how__inner {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}


/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */

.v2-how__header {
    max-width: 700px;
    margin: 0 auto 65px;

    text-align: center;
}

.v2-how__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 20px;

    color: var(--v2-cta);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.25px;
    line-height: 1.3;
    text-transform: uppercase;
}

.v2-how__eyebrow-line {
    width: 28px;
    height: 2px;

    border-radius: 99px;

    background: var(--v2-highlight);
}


.v2-how__title {
    margin: 0;

    color: var(--v2-heading);

    font-size: clamp(38px, 4.5vw, 58px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -2.2px;
}

.v2-how__title span {
    color: var(--v2-cta);
}


/* ---------------------------------------------------------------------
   Process
   --------------------------------------------------------------------- */

.v2-how__process {
    position: relative;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/* ---------------------------------------------------------------------
   Connecting line
   --------------------------------------------------------------------- */

.v2-how__line {
    position: absolute;

    top: 34px;
    left: 12.5%;
    right: 12.5%;

    height: 2px;

    background: rgba(92, 27, 179, 0.11);

    z-index: 0;
}

.v2-how__line-progress {
    display: block;

    width: 100%;
    height: 100%;

    transform-origin: left center;
    transform: scaleX(0);

    background: linear-gradient(
        90deg,
        var(--v2-cta),
        var(--v2-highlight)
    );

    transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-how__line-progress.is-active {
    transform: scaleX(1);
}


/* ---------------------------------------------------------------------
   Step
   --------------------------------------------------------------------- */

.v2-how__step {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
}


/* ---------------------------------------------------------------------
   Number marker
   --------------------------------------------------------------------- */

.v2-how__step-marker {
    position: relative;
    z-index: 2;

    width: 68px;
    height: 68px;

    display: grid;
    place-items: center;

    border: 5px solid var(--v2-bg);
    border-radius: 50%;

    background: var(--v2-cta);

    color: var(--v2-white);

    box-shadow:
        0 0 0 1px rgba(98, 34, 213, 0.15),
        0 10px 24px rgba(98, 34, 213, 0.17);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background 0.35s ease;
}

.v2-how__step-marker span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.v2-how__step:hover .v2-how__step-marker {
    transform: scale(1.08);

    background: var(--v2-heading);

    box-shadow:
        0 0 0 1px rgba(57, 29, 119, 0.18),
        0 14px 30px rgba(57, 29, 119, 0.18);
}


/* ---------------------------------------------------------------------
   Step card
   --------------------------------------------------------------------- */

.v2-how__step-card {
    width: 100%;
    box-sizing: border-box;

    margin-top: 24px;
    padding: 25px 22px 27px;

    min-height: 255px;

    border: 1px solid rgba(92, 27, 179, 0.09);
    border-radius: var(--v2-radius-md);

    background: rgba(255, 255, 255, 0.84);

    box-shadow:
        0 12px 30px rgba(57, 29, 119, 0.045),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.v2-how__step-card::before {
    content: "";

    display: block;

    width: 26px;
    height: 3px;

    margin-bottom: 17px;

    border-radius: 99px;

    background: var(--v2-highlight);

    transition:
        width 0.35s ease,
        background 0.35s ease;
}

.v2-how__step:hover .v2-how__step-card {
    transform: translateY(-6px);

    border-color: rgba(92, 27, 179, 0.16);

    box-shadow:
        0 22px 45px rgba(57, 29, 119, 0.095),
        0 4px 12px rgba(92, 27, 179, 0.035);
}

.v2-how__step:hover .v2-how__step-card::before {
    width: 48px;
    background: var(--v2-cta);
}


/* ---------------------------------------------------------------------
   Step content
   --------------------------------------------------------------------- */

.v2-how__step-label {
    margin-bottom: 8px;

    color: var(--v2-highlight);

    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.3;
    text-transform: uppercase;
}

.v2-how__step-card h3 {
    margin: 0 0 11px;

    color: var(--v2-heading);

    font-size: 15px;
    font-weight: 800;
    line-height: 1.38;
    letter-spacing: -0.2px;
}

.v2-how__step-card p {
    margin: 0;

    color: var(--v2-subheading);

    font-size: 12px;
    font-weight: 500;
    line-height: 1.72;
}


/* ---------------------------------------------------------------------
   CTA
   --------------------------------------------------------------------- */

.v2-how__cta-wrap {
    display: flex;
    justify-content: center;

    margin-top: 48px;
}

.v2-how__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;

    padding: 13px 20px;

    border-radius: var(--v2-radius-pill);

    background: var(--v2-cta);
    color: var(--v2-white);

    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-decoration: none;

    box-shadow: 0 10px 25px rgba(98, 34, 213, 0.18);

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.v2-how__cta svg {
    transition: transform 0.3s ease;
}

.v2-how__cta:hover {
    background: var(--v2-cta-hover);

    transform: translateY(-2px);

    box-shadow: 0 15px 32px rgba(98, 34, 213, 0.23);
}

.v2-how__cta:hover svg {
    transform: translateX(4px);
}


/* ---------------------------------------------------------------------
   Scroll reveal
   --------------------------------------------------------------------- */

.v2-how [data-v2-reveal] {
    opacity: 0;
    transform: translateY(28px);

    transition:
        opacity 0.7s ease,
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-how [data-v2-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.v2-how__step:nth-child(2) {
    transition-delay: 80ms;
}

.v2-how__step:nth-child(3) {
    transition-delay: 160ms;
}

.v2-how__step:nth-child(4) {
    transition-delay: 240ms;
}

.v2-how__step:nth-child(5) {
    transition-delay: 320ms;
}

.v2-how__cta-wrap {
    transition-delay: 400ms;
}


/* ---------------------------------------------------------------------
   Tablet
   --------------------------------------------------------------------- */

@media (max-width: 1050px) {
    .v2-how__process {
        gap: 12px;
    }

    .v2-how__step-card {
        padding: 22px 18px 24px;
        min-height: 270px;
    }

    .v2-how__step-card h3 {
        font-size: 14px;
    }

    .v2-how__step-card p {
        font-size: 11.5px;
    }
}


/* ---------------------------------------------------------------------
   Tablet / stacked process
   --------------------------------------------------------------------- */

@media (max-width: 800px) {
    .v2-how {
        padding: 75px 0;
    }

    .v2-how__header {
        margin-bottom: 48px;
    }

    .v2-how__process {
        display: flex;
        flex-direction: column;

        gap: 20px;

        max-width: 680px;
        margin: 0 auto;
    }

    /*
     * Vertical connecting line.
     */
    .v2-how__line {
        top: 34px;
        bottom: 34px;
        left: 33px;
        right: auto;

        width: 2px;
        height: auto;
    }

    .v2-how__line-progress {
        width: 100%;
        height: 100%;

        transform-origin: top center;
        transform: scaleY(0);
    }

    .v2-how__line-progress.is-active {
        transform: scaleY(1);
    }

    .v2-how__step {
        display: grid;
        grid-template-columns: 68px minmax(0, 1fr);

        align-items: start;
        gap: 22px;
    }

    .v2-how__step-marker {
        grid-column: 1;
        grid-row: 1;

        flex-shrink: 0;
    }

    .v2-how__step-card {
        grid-column: 2;
        grid-row: 1;

        margin-top: 0;
        min-height: 0;
    }

    .v2-how__cta-wrap {
        margin-top: 42px;
    }
}


/* ---------------------------------------------------------------------
   Mobile
   --------------------------------------------------------------------- */

@media (max-width: 640px) {
    .v2-how {
        padding: 65px 0;
    }

    .v2-how__inner {
        width: min(100% - 32px, 560px);
    }

    .v2-how__header {
        margin-bottom: 40px;
    }

    .v2-how__title {
        font-size: clamp(34px, 9vw, 43px);
        letter-spacing: -1.5px;
    }

    .v2-how__process {
        gap: 14px;
    }

    .v2-how__line {
        left: 28px;
    }

    .v2-how__step {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 14px;
    }

    .v2-how__step-marker {
        width: 58px;
        height: 58px;

        border-width: 4px;
    }

    .v2-how__step-marker span {
        font-size: 10px;
    }

    .v2-how__step-card {
        padding: 19px 17px 21px;
    }

    .v2-how__step-card::before {
        margin-bottom: 14px;
    }

    .v2-how__step-card h3 {
        font-size: 13.5px;
    }

    .v2-how__step-card p {
        font-size: 11.5px;
        line-height: 1.68;
    }

    .v2-how__cta-wrap {
        margin-top: 34px;
    }

    .v2-how__cta {
        width: 100%;
        padding: 13px 16px;
    }
}


/* ---------------------------------------------------------------------
   Small mobile
   --------------------------------------------------------------------- */

@media (max-width: 400px) {
    .v2-how__inner {
        width: min(100% - 26px, 560px);
    }

    .v2-how__step {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 11px;
    }

    .v2-how__line {
        left: 24px;
    }

    .v2-how__step-marker {
        width: 50px;
        height: 50px;
    }

    .v2-how__step-card {
        padding: 17px 14px 19px;
    }

    .v2-how__step-card h3 {
        font-size: 12.8px;
    }

    .v2-how__step-card p {
        font-size: 11px;
    }
}


/* ---------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .v2-how *,
    .v2-how *::before,
    .v2-how *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .v2-how [data-v2-reveal] {
        opacity: 1;
        transform: none;
    }

    .v2-how__line-progress {
        transform: none !important;
    }
}