

/* ==========================================
   SMARTYOU — PROBLÈME > SOLUTION
   ========================================== */

.sy-transform {
    width: 100%;
    margin-top: 18px;

    display: flex;
    flex-direction: column;

    /* PLUS D'AIR ENTRE LES LIGNES */
    gap: 28px;
}


/* ==========================================
   RANGÉES
   ========================================== */

.sy-transform-row {
    width: 100%;

    display: grid;

    /*
       Rééquilibrage :
       48% problème
       13% connexion
       39% solution
    */
    grid-template-columns:
        minmax(0, 48fr)
        minmax(90px, 13fr)
        minmax(0, 39fr);

    align-items: center;

    /* Respiration autour du trait */
    column-gap: 12px;

    padding: 0 !important;
    margin: 0 !important;

    border: none !important;

    opacity: 0;
    transform: translateY(7px);

    transition:
        opacity .5s ease,
        transform .5s ease;
}


.sy-transform-row::before,
.sy-transform-row::after {
    content: none !important;
    display: none !important;
}


/* ==========================================
   PILULES
   ========================================== */

.sy-transform-problem,
.sy-transform-result {
    width: 100%;
    height: 48px;

    box-sizing: border-box;

    display: flex;
    align-items: center;

    padding: 0 16px !important;

    border: 1px solid #1d1d1b !important;
    border-radius: 999px;

    background: #fff;

    white-space: nowrap;
}


/* ==========================================
   TYPOGRAPHIE
   ========================================== */

.sy-transform .sy-label {
    display: block;

    font-family: inherit !important;

    font-size: 16px !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    margin: 0 !important;
    padding: 0 !important;

    letter-spacing: 0 !important;

    color: #1d1d1b !important;
}


/* ==========================================
   PROBLÈMES
   ========================================== */

.sy-transform-problem {
    gap: 10px;
    font-weight: 500;
}


.sy-transform-problem .sy-label {
    font-weight: 500 !important;
}


.sy-problem-dot {
    display: block;

    width: 6px;
    height: 6px;

    min-width: 6px;
    flex: 0 0 6px;

    border-radius: 50%;

    background: #E0206F;
}


/* ==========================================
   SOLUTIONS
   ========================================== */

.sy-transform-result {
    gap: 10px;

    opacity: .25;
}


.sy-transform-result .sy-label {
    font-weight: 600 !important;
}


.sy-result-icon {
    width: 21px;
    height: 21px;

    min-width: 21px;
    flex: 0 0 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #00BD9C;

    transform: scale(.65);
}


.sy-result-icon svg {
    width: 12px;
    height: 12px;

    fill: none;

    stroke: #fff;
    stroke-width: 3;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================
   CONNEXION
   ========================================== */

.sy-transform-path {
    position: relative;

    width: 100%;
    height: 20px;

    margin: 0 !important;
    padding: 0 !important;
}


/* Ligne neutre */

.sy-transform-path::before {
    content: "";

    position: absolute;

    /* Petit retrait des deux côtés */
    left: 4px;
    right: 4px;

    top: 50%;

    height: 1px;

    transform: translateY(-50%);

    background: rgba(29,29,27,.15);
}


/* Ligne colorée */

.sy-path-line {
    position: absolute;

    left: 4px;
    top: 50%;

    width: calc(100% - 8px);
    height: 2px;

    border-radius: 50px;

    background: linear-gradient(
        90deg,
        #E0206F 0%,
        #783AF4 32%,
        #05A6DD 68%,
        #00BD9C 100%
    );

    transform:
        translateY(-50%)
        scaleX(0);

    transform-origin: left center;
}


/* Point animé */

.sy-moving-dot {
    position: absolute;

    left: 4px;
    top: 50%;

    width: 8px;
    height: 8px;

    margin-top: -4px;

    border-radius: 50%;

    background: #E0206F;

    box-shadow:
        0 0 0 4px rgba(5,166,221,.08),
        0 0 10px rgba(5,166,221,.18);

    opacity: 0;

    transform: translateX(-4px);
}


/* ==========================================
   APPARITION
   ========================================== */

.sy-transform.is-visible .sy-transform-row {
    opacity: 1;
    transform: translateY(0);
}


.sy-transform.is-visible .sy-transform-row:nth-child(1) {
    transition-delay: 0s;
}

.sy-transform.is-visible .sy-transform-row:nth-child(2) {
    transition-delay: .22s;
}

.sy-transform.is-visible .sy-transform-row:nth-child(3) {
    transition-delay: .44s;
}

.sy-transform.is-visible .sy-transform-row:nth-child(4) {
    transition-delay: .66s;
}


/* ==========================================
   ANIMATIONS
   ========================================== */

.sy-transform.is-visible
.sy-transform-row:nth-child(1)
.sy-path-line {
    animation: syLineTravel .65s .20s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(1)
.sy-moving-dot {
    animation: syDotTravel .65s .20s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(1)
.sy-transform-result {
    animation: syResultReveal .35s .81s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(1)
.sy-result-icon {
    animation: syResultPop .35s .81s forwards;
}


/* 02 */

.sy-transform.is-visible
.sy-transform-row:nth-child(2)
.sy-path-line {
    animation: syLineTravel .65s .42s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(2)
.sy-moving-dot {
    animation: syDotTravel .65s .42s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(2)
.sy-transform-result {
    animation: syResultReveal .35s 1.03s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(2)
.sy-result-icon {
    animation: syResultPop .35s 1.03s forwards;
}


/* 03 */

.sy-transform.is-visible
.sy-transform-row:nth-child(3)
.sy-path-line {
    animation: syLineTravel .65s .64s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(3)
.sy-moving-dot {
    animation: syDotTravel .65s .64s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(3)
.sy-transform-result {
    animation: syResultReveal .35s 1.25s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(3)
.sy-result-icon {
    animation: syResultPop .35s 1.25s forwards;
}


/* 04 */

.sy-transform.is-visible
.sy-transform-row:nth-child(4)
.sy-path-line {
    animation: syLineTravel .65s .86s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(4)
.sy-moving-dot {
    animation: syDotTravel .65s .86s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(4)
.sy-transform-result {
    animation: syResultReveal .35s 1.47s forwards;
}

.sy-transform.is-visible
.sy-transform-row:nth-child(4)
.sy-result-icon {
    animation: syResultPop .35s 1.47s forwards;
}


/* ==========================================
   KEYFRAMES
   ========================================== */

@keyframes syLineTravel {

    from {
        transform:
            translateY(-50%)
            scaleX(0);
    }

    to {
        transform:
            translateY(-50%)
            scaleX(1);
    }
}


@keyframes syDotTravel {

    0% {
        left: 4px;

        opacity: 0;

        background: #E0206F;

        transform:
            translateX(-4px)
            scale(.7);
    }

    10% {
        opacity: 1;
    }

    35% {
        background: #783AF4;
    }

    65% {
        background: #05A6DD;
    }

    100% {
        /*
           Le point s'arrête AVANT la pilule
           au lieu de venir s'y coller.
        */
        left: calc(100% - 4px);

        opacity: 1;

        background: #00BD9C;

        transform:
            translateX(-4px)
            scale(1);
    }
}


@keyframes syResultReveal {

    from {
        opacity: .25;
    }

    to {
        opacity: 1;
    }
}


@keyframes syResultPop {

    0% {
        transform: scale(.65);
    }

    65% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


/* ==========================================
   TABLETTE
   ========================================== */

@media (max-width: 1024px) {

    .sy-transform {
        gap: 22px;
    }


    .sy-transform-row {
        grid-template-columns:
            minmax(0, 49fr)
            minmax(65px, 11fr)
            minmax(0, 40fr);

        column-gap: 8px;
    }


    .sy-transform .sy-label {
        font-size: 12px !important;
    }


    .sy-transform-problem,
    .sy-transform-result {
        height: 45px;

        padding-left: 12px !important;
        padding-right: 12px !important;

        gap: 7px;
    }

}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 767px) {

    .sy-transform {
        gap: 18px;
    }


    .sy-transform-row {
        display: flex;
        flex-direction: column;

        align-items: stretch;

        gap: 0;
    }


    .sy-transform-problem,
    .sy-transform-result {
        width: 100%;

        height: auto;
        min-height: 48px;

        padding: 11px 16px !important;
    }


    .sy-transform .sy-label {
        font-size: 13px !important;
        line-height: 1.25 !important;

        white-space: normal !important;
    }


    /* Connexion verticale */

    .sy-transform-path {
        width: 20px;
        height: 30px;

        align-self: flex-start;

        margin-left: 18px !important;
    }


    .sy-transform-path::before {
        left: 4px;
        right: auto;
        top: 0;

        width: 1px;
        height: 100%;

        transform: none;
    }


    .sy-path-line {
        left: 4px;
        top: 0;

        width: 2px;
        height: 100%;

        transform: scaleY(0);

        transform-origin: top center;
    }


    .sy-moving-dot {
        left: 0;
        top: 0;

        margin-top: 0;
    }


    .sy-transform.is-visible .sy-path-line {
        animation-name: syLineTravelMobile !important;
    }


    .sy-transform.is-visible .sy-moving-dot {
        animation-name: syDotTravelMobile !important;
    }


    @keyframes syLineTravelMobile {

        from {
            transform: scaleY(0);
        }

        to {
            transform: scaleY(1);
        }
    }


    @keyframes syDotTravelMobile {

        0% {
            top: 0;

            opacity: 0;

            background: #E0206F;

            transform: scale(.7);
        }

        10% {
            opacity: 1;
        }

        35% {
            background: #783AF4;
        }

        65% {
            background: #05A6DD;
        }

        100% {
            top: calc(100% - 8px);

            opacity: 1;

            background: #00BD9C;

            transform: scale(1);
        }
    }

}


/* ==========================================
   ACCESSIBILITÉ
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .sy-transform-row,
    .sy-transform-result,
    .sy-result-icon,
    .sy-moving-dot,
    .sy-path-line {
        animation: none !important;
        transition: none !important;
    }


    .sy-transform-row,
    .sy-transform-result {
        opacity: 1;
        transform: none;
    }


    .sy-path-line {
        transform:
            translateY(-50%)
            scaleX(1);
    }


    .sy-result-icon {
        transform: scale(1);
    }


    .sy-moving-dot {
        display: none;
    }

}

