/* ============================================================
   Onboarding Progress Bar
   Used on: Activate, Login, SecurityQuestions, SecurityCode,
            Profile, Acknowledgement
   Included via _OnboardingProgress.cshtml partial
   ============================================================ */

/* ---- Wrapper ---- */
.onboarding-progress {
    background: #fff;
    border-bottom: 3px solid #D72718;
    padding: 20px 24px 16px;
    margin-bottom: 24px;
    overflow-x: hidden; /* prevent horizontal scroll */
    width: 100%;
    box-sizing: border-box;
}

/* ---- Header: title, message, counter ---- */
.onboarding-header {
    margin-bottom: 16px;
}

.onboarding-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #04325c;
    margin-bottom: 4px;
}

.onboarding-message {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.5;
}

.onboarding-counter {
    display: inline-block;
    background: #D72718;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.03em;
}

/* ---- Step list ---- */
.onboarding-steps {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0 0 4px; /* bottom padding so the hidden scrollbar never clips the step labels */
    gap: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Individual step ---- */
.onboarding-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 1px;
    min-width: 48px;
    text-align: center;
}

/* Connector line between steps */
.onboarding-step::before {
    content: '';
    position: absolute;
    top: 14px; /* vertical centre of the 28px icon */
    left: calc(-50% + 14px);
    right: calc(50% + 14px);
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.onboarding-step:first-child::before {
    display: none;
}

/* ---- Step icon circle ---- */
.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    border: 2px solid #dee2e6;
    background: #fff;
    color: #999;
    flex-shrink: 0;
}

.step-label {
    margin-top: 4px;
    font-size: 0.65rem;
    color: #999;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ---- Completed step ---- */
.onboarding-step--completed .step-icon {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.onboarding-step--completed .step-label {
    color: #28a745;
}

.onboarding-step--completed::before {
    background: #28a745;
}

/* ---- Current (active) step ---- */
.onboarding-step--current .step-icon {
    background: #D72718;
    border-color: #D72718;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(215, 39, 24, 0.2);
}

.onboarding-step--current .step-label {
    color: #D72718;
    font-weight: 600;
}

/* ---- Future (inactive) step ---- */
.onboarding-step--future .step-icon {
    background: #f5f5f5;
    border-color: #dee2e6;
    color: #ccc;
}

.onboarding-step--future .step-label {
    color: #ccc;
}

/* ---- Tablet: compact horizontal bar (576px – 767px) ----
   7 steps × 68px default = 476px. A 576px viewport has only 100px to spare after
   section padding, so we scale icons to 28px and min-width to 58px so the full bar
   fits without needing horizontal scroll on most small tablets.               */
@media (max-width: 767.98px) {
    .onboarding-progress {
        padding: 14px 12px 10px;
    }

    .onboarding-title {
        font-size: 1.1rem;
    }

    .onboarding-step {
        min-width: 45px;
        padding: 0 1px;
    }

    /* Connector adjusted for 28px icon: top = icon-height/2 = 14px */
    .onboarding-step::before {
        top: 14px;
        left: calc(-50% + 14px);
        right: calc(50% + 14px);
    }

    .step-icon {
        width: 28px;
        height: 28px;
        font-size: 0.76rem;
    }

    .step-label {
        font-size: 0.65rem;
        margin-top: 4px;
    }
}

/* ---- Mobile: stack vertically below 576px ---- */
@media (max-width: 575.98px) {
    .onboarding-progress {
        padding: 14px;
    }

    .onboarding-title {
        font-size: 1.05rem;
    }

    .onboarding-steps {
        flex-direction: column;
        overflow-x: visible;
        gap: 8px;
        padding-bottom: 0;
    }

    .onboarding-step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        min-width: unset;
        padding: 0;
        gap: 10px;
    }

    /* Hide horizontal connector lines in vertical layout */
    .onboarding-step::before {
        display: none;
    }

    /* Vertical connector between stacked steps.
       left = (icon-width / 2) - (line-width / 2) = (32 / 2) - (2 / 2) = 15px */
    .onboarding-step + .onboarding-step::after {
        content: '';
        position: absolute;
        top: -8px;
        left: 15px;
        width: 2px;
        height: 8px;
        background: #dee2e6;
    }

    .onboarding-step--completed + .onboarding-step::after,
    .onboarding-step--completed + .onboarding-step--current::after {
        background: #28a745;
    }

    .step-label {
        margin-top: 0;
        white-space: normal;
        max-width: none;
        font-size: 0.8rem;
    }
}

