/* =============================================================================
   STEPPER DE NAVIGATION - Design moderne et responsive
   ============================================================================= */

.stp-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 30px;
    background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
    border-bottom: 1px solid var(--stp-border);
    gap: 0;
    position: relative;
}

/* Étape individuelle */
.stp-stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    cursor: default;
}

/* Étape complétée = cliquable */
.stp-stepper-step.stp-completed {
    cursor: pointer;
}

.stp-stepper-step.stp-completed:hover .stp-stepper-circle {
    transform: scale(1.1);
}

/* Cercle de l'étape */
.stp-stepper-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    font-size: 24px;
}

/* Icône dans le cercle */
.stp-stepper-icon {
    display: block;
    transition: opacity 0.3s;
}

/* Checkmark (masqué par défaut) */
.stp-stepper-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Label de l'étape */
.stp-stepper-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--stp-text-light);
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s;
}

/* Ligne de connexion entre les étapes */
.stp-stepper-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 -15px;
    position: relative;
    z-index: 1;
    max-width: 120px;
    transition: background 0.3s ease;
    align-self: flex-start;
    transform: translateY(28px); /* 56px / 2 = 28px */
}

/* ============================================================================
   ÉTATS DU STEPPER
   ============================================================================ */

/* Étape active */
.stp-stepper-step.stp-active .stp-stepper-circle {
    background: var(--stp-primary);
    border-color: var(--stp-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.stp-stepper-step.stp-active .stp-stepper-label {
    color: var(--stp-primary);
    font-weight: 600;
}

/* Étape complétée */
.stp-stepper-step.stp-completed .stp-stepper-circle {
    background: var(--stp-success);
    border-color: var(--stp-success);
}

.stp-stepper-step.stp-completed .stp-stepper-icon {
    opacity: 0;
}

.stp-stepper-step.stp-completed .stp-stepper-check {
    opacity: 1;
}

.stp-stepper-step.stp-completed .stp-stepper-label {
    color: var(--stp-success);
}

/* Ligne complétée */
.stp-stepper-line.stp-completed {
    background: var(--stp-success);
}

/* Animation pour les transitions */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.stp-stepper-step.stp-active .stp-stepper-circle {
    animation: pulse 2s infinite;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* Tablette */
@media (max-width: 768px) {
    .stp-stepper {
        padding: 30px 15px 25px;
        gap: 0;
    }
    
    .stp-stepper-circle {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stp-stepper-check {
        font-size: 24px;
    }
    
    .stp-stepper-label {
        font-size: 12px;
    }
    
    .stp-stepper-line {
        max-width: 60px;
        margin: 0 -10px; /* Ajusté pour tablette */
        transform: translateY(24px); /* 48px / 2 = 24px */
    }
}

/* Mobile */
@media (max-width: 480px) {
    .stp-stepper {
        padding: 25px 10px 20px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .stp-stepper-circle {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-width: 2px;
    }
    
    .stp-stepper-check {
        font-size: 20px;
    }
    
    .stp-stepper-label {
        font-size: 11px;
        max-width: 60px;
        white-space: normal;
        line-height: 1.2;
    }
    
    .stp-stepper-line {
        max-width: 40px;
        height: 2px;
        margin: 0 -8px; /* Ajusté pour mobile */
        transform: translateY(22px); /* 44px / 2 = 22px */
    }
    
    .stp-stepper-step {
        gap: 8px;
        min-width: 60px;
    }
}

/* Très petit mobile - Version compacte */
@media (max-width: 360px) {
    .stp-stepper-label {
        display: none;
    }
    
    .stp-stepper-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .stp-stepper-line {
        max-width: 30px;
        margin: 0 -6px; /* Ajusté pour très petit mobile */
        transform: translateY(20px); /* 40px / 2 = 20px */
    }
}

/* ============================================================================
   ACCESSIBILITÉ
   ============================================================================ */

.stp-stepper-step.stp-completed:focus {
    outline: 2px solid var(--stp-primary);
    outline-offset: 4px;
    border-radius: 8px;
}

.stp-stepper-step.stp-completed:active .stp-stepper-circle {
    transform: scale(0.95);
}