/* steps */

.steps {
    position: relative;
    background: linear-gradient(160deg, #2a2a2a 0%, #1a1a1a 55%, #0a0a0a 100%);
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 72px 20px 110px;
    overflow: hidden;
    --steps-line: rgba(255, 255, 255, 0.8);
    --steps-mark: rgba(255, 255, 255, 0.85);
    --steps-bg: #181818;
}

.steps.light {
    background-image: url(../imgs/background.jpg) !important;
    background-position: top center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #0e0b0b !important;
    --steps-line: #101010;
    --steps-mark: #0e0b0b;
    --steps-bg: #f6f6f6;
}

section.steps .h5 {
    margin-bottom: 50px;
}

section.steps .h5::after {
    background: #FFF;
}

section.steps.light .h5::after {
    background: #0e0b0b;
}

.steps-heading {}

.steps-sub {}

.steps.light .steps-sub {
    color: rgba(14, 11, 11, .75) !important;
}

/* Desktop (>= 640px): horizontal track centered under each icon */
.steps-row {
    position: relative;
    display: flex;
    list-style: none;
    margin: 56px 0 0;
    padding: 0;
    gap: 0;
}

.steps-item {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
}

/* 1px horizontal line across steps */
.steps-item::before,
.steps-item::after {
    content: "";
    position: absolute;
    top: 144px;
    /* centers 1px line inside the 34px marker slot (127px + 17px) */
    height: 1px;
    background: var(--steps-line);
    pointer-events: none;
    z-index: 0;
}

.steps-item::before {
    left: 0;
    right: 50%;
}

.steps-item::after {
    left: 50%;
    right: 0;
}

.steps-item:first-of-type::after {
    left: calc(50% + 11px);
}

/* Extend line to edges on first and last step */
/* Desktop (>= 640px): smooth S-curve entering step 01 from the left edge */
.steps-item:first-of-type::before {
    content: "";
    position: absolute;
    left: -100vw;
    right: calc(50% + 11px);
    /* Sits from ~38px below the main line up to the 1px line center */
    top: 144px;
    height: 40px;
    background-color: transparent;
    background-repeat: no-repeat;
    /* Stretches horizontally across the left span while keeping a crisp 1px stroke */
    background-size: auto 100%;
    background-image: url("../imgs/ligne-seule.svg");
    pointer-events: none;
    transform: rotate(180deg);
    background-position: left top;
    z-index: 0;
}

.steps.light .steps-item:first-of-type::before {
    background-image: url("../imgs/ligne-seule-dark.svg");
}

.steps-item:last-of-type::after {
    right: -100vw;
}

.steps-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 85px;
    color: #fff;
    position: relative;
    z-index: 2;
}

.steps-item-icon svg,
.steps-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Marker + number container */
.steps-item-marker {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    height: 34px;
    margin: 42px 0 20px;
}

.steps-item-mark {
    position: relative;
    display: block;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* 01: empty circle 22x22px, 1.5px border */
.steps-item-1 .steps-item-mark {
    width: 22px;
    height: 22px;
    margin-top: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--steps-mark);
    background: transparent;
}

/* 02 & 03: vertical bar 1.5x18px crossed by horizontal line */
.steps-item-2 .steps-item-mark,
.steps-item-3 .steps-item-mark {
    width: 1.5px;
    height: 18px;
    margin-top: 8px;
    background: var(--steps-mark);
    border-left: 1.5px solid var(--steps-mark);
    background: transparent;
}

/* 04: target circle 34x34px, 1.5px border, 12px center dot */
.steps-item-4 .steps-item-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--steps-mark);
    background: transparent;
}

.steps-item:last-of-type:before {
    right: calc(50% + 16px);
}
.steps-item:last-of-type:after {
    left: calc(50% + 16px);
}
.steps-item-4 .steps-item-mark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--steps-mark);
    transform: translate(-50%, -50%);
}

/* Numbers 01..04: ~20px below line, 12px / 16px, 80% opacity */
.steps-item-number {
    position: absolute;
    top: 37px;
    /* ~20px below the 17px line center */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    line-height: 16px;
    opacity: 0.8;
    white-space: nowrap;
}

.steps-item-title {
    margin: 20px 0 15px;
    max-width: 190px;
}

.steps-item-desc {
    max-width: 250px;
    margin: 0;
}

.steps-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 90px;
    padding: 37px 41px;
    border-radius: 8px;
    background: #fff;
    font-weight: 600;
}

.steps-cta svg {
    width: 17px;
    height: 17px;
    transition: transform .2s ease;
}

.steps-cta:hover svg {
    transform: translateX(3px);
}

/* Mobile (< 640px): 48px left rail, 20px from left edge, 16px gap to content */
@media screen and (max-width: 639px) {
    .steps {
        padding: 72px 20px 90px 84px;
        /* 20px + 48px rail + 16px gap = 84px left padding */
        text-align: left;
    }

    .steps .section-header.section-header-center {
        text-align: left;
        margin-bottom: 0;
    }

    .steps .eyebrow.eyebrow-center {
        align-items: flex-start;
    }

    .steps .section-header h3 {
        font-size: 14px;
        line-height: 22px;
        margin: 0;
    }

    .steps-row {
        margin-top: 48px;
        flex-direction: column;
    }

    .steps-item {
        padding: 0 0 40px 0;
        align-items: flex-start;
    }

    .steps-item:last-of-type {
        padding-bottom: 0;
    }

    /* Disable horizontal desktop connectors on mobile */
    .steps-item::before,
    .steps-item::after {
        display: none;
    }

    .steps-item-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 14px;
    }

    .steps-item-title {
        max-width: 100%;
        margin: 0 0 8px;
        font-size: 16px;
        line-height: 22px;
        font-weight: 600;
    }

    .steps-item-desc {
        max-width: 100%;
    }

    /* Left rail marker centered on first line of title (11px half line-height) */
    .steps-item-marker {
        position: absolute;
        left: -64px;
        /* -16px gap - 24px (half of 48px rail) - 24px = -64px */
        width: 48px;
        height: auto;
        margin: 0;
        top: 11px;
        transform: translateY(-17px);
        /* aligns 34px target center to title line 1 */
        z-index: 2;
    }

    .steps-item-1 .steps-item-mark {
        margin-top: 6px;
    }

    /* Mobile 02 & 03: horizontal bar 18x1.5px crossed by vertical line */
    .steps-item-2 .steps-item-mark,
    .steps-item-3 .steps-item-mark {
        width: 18px;
        height: 1.5px;
        margin-top: 16.25px;
        background: var(--steps-mark);
    }

    .steps-item-4 .steps-item-mark {
        margin-top: 0;
    }

    /* 6px below mark on mobile */
    .steps-item-number {
        position: static;
        transform: none;
        margin-top: 6px;
        font-size: 12px;
        line-height: 16px;
        opacity: 0.8;
    }

    /* 1px vertical line: starts 6px below 01, breaks 6px around 02/03 numbers, stops at 04 top */
    .steps-item:not(:last-of-type) .steps-item-marker::after {
        content: "";
        position: absolute;
        left: 50%;
        top: calc(100% + 10px);
        width: 1px;
        height: calc(100% + 112px);
        background: var(--steps-line);
        transform: translateX(-50%);
        pointer-events: none;
    }

    .steps.light .steps-item:first-of-type .steps-item-marker::after {
        height: calc(100% + 90px);
    }

    .steps-item:nth-of-type(2) .steps-item-marker::after {
        height: calc(100% + 110px);
    }
    
    .steps-item:nth-of-type(3) .steps-item-marker::after {
        height: calc(100% + 116px);
    }
}