/* Conteneur principal de la timeline */
.timeline {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Chaque étape de la timeline */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    flex-wrap: wrap;
    min-height: 120px;
}

/* Bouton et input stylisés */
.step button,
.step input[type="button"],
.step input[type="submit"] {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #888;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Effet au survol */
.step button:hover,
.step input[type="button"]:hover,
.step input[type="submit"]:hover {
    background-color: #83b825;
}

/* Label de chaque étape */
.step .label {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    width: 110px;
    word-break: break-word;
    white-space: collapse;
    text-align: center;
}

/* Ligne de connexion entre les étapes */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 75px;
    width: calc(100% - 50px);
    height: 2px;
    background-color: #888;
    z-index: -1;
}


/* Responsive design pour les petits écrans */
@media (max-width: 768px) {
    .timeline {
        max-width: 100%;
        display: flex;
        flex-direction: row;
        /* Garde les étapes alignées horizontalement */
        flex-wrap: wrap;
        /* Empêche le retour à la ligne */
        overflow-x: auto;
        /* Ajoute un défilement horizontal si nécessaire */
        white-space: nowrap;

        margin: 0 auto;

        gap: 5px;

        /* Espacement entre les steps */
    }

    .step {
        flex-direction: column;
        /* Pour garder les boutons et labels empilés */
        align-items: center;
        width: 70px;
        height: 70px;
        /* Taille minimale pour éviter l'écrasement */
    }

    .step:not(:last-child)::after {
        top: 50%;
        left: 100%;
        width: 20px;
        height: 2px;
        background-color: #888;
        transform: translateY(-50%);
    }

    /* Meilleure expérience tactile */
    .step button,
    .step input[type="button"],
    .step input[type="submit"] {
        width: 35px;
        height: 35px;
    }

    .step .label {
        width: 93px;
        font-size: 12px;
    }

}


/* Étape active */
.step.active button,
.step.active input[type="button"],
.step.active input[type="submit"] {
    background-color: #83b825;
}

/* Étape active : bouton avec texte brillant */
.step.active button,
.step.active input[type="button"],
.step.active input[type="submit"] {
    background-color: #83b825;
    color: #fff;
    font-weight: bold;
}