
.stepper {
    flex: 1;
    width: 100%;
    min-width: 100%;
    position: relative;
}

.stepper::before {
    content: "";
    position: absolute;
    top: calc(1.25rem + 0.25rem);
    left: 6%;
    right: 6%;
    height: 0.1875rem; /* 3px */
    background-color: rgba(0,0,0,0.1);
    z-index: 1;
}

.stepper-step {
    flex: 1;
    position: relative;
}

.step-icon-container {
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.125rem; /* 18px */
    transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
    border: 0.125rem solid transparent; /* 2px */
    cursor: pointer;
    z-index: 2;
}

.view-only .step-icon-container {
    cursor: default;
}

.step-name {
    color: #6c757d;
    white-space: normal;
    max-width: 6.25rem; /* 100px */
    font-size: 0.875rem; /* 14px */
    margin-top: 0.5rem; /* 8px */
}

/* Media query for larger screens */
@media (min-width: 768px) {
    .step-name {
        max-width: 9.375rem; /* 150px*/
        font-size: 1rem; /* 16px */
    }
}

.stepper-step.active .step-icon-container {
    background-color: #ffc107;
    color: #ffffff;
}

.stepper-step.active .step-name {
    color: #ffc107;
    font-weight: bold;
}

.stepper-step.completed .step-icon-container, .stepper-step.active:last-child .step-icon-container {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.stepper-step.completed .step-name, .stepper-step.active:last-child .step-name {
    color: #28a745 !important;
}

.stepper-step .line-fill {
    position: absolute;
    top: calc(1.25rem + 0.25rem);
    left: -50%;
    width: 100%;
    height: 0.1875rem; /* 3px */
    background-color: #28a745;
    z-index: 1;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stepper-step:first-child .line-fill {
    display: none;
}

.stepper-step.completed .line-fill,
.stepper-step.active .line-fill {
    transform: scaleX(1);
}

.stepper-step.active ~ .stepper-step .line-fill {
    background-color: #e9ecef;
    transform: scaleX(0);
}

/* Improve accessibility */
.stepper-step .step-icon-container:focus {
    outline: 0.1875rem solid #007bff; /* 3px */
    outline-offset: 0.125rem; /* 2px */
}
