/* Vertical process stepper with animated progress. Plain CSS, no build step. */
/* ---------- Vertical stepper (public/css/stepper.css) ----------
 * Shared by the home page (8 steps) and the login page (7 steps, .app-proc--7).
 * 1.2 s per step, 9.6 s loop. A colour-graded path runs down the left;
 * a progress fill grows along it and each step lights up as it is reached.
 */
.app-proc {
    --rail-x: 22px;            /* centre of the nodes */
    --rail-gap: 18px;          /* top / bottom inset of the path */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 2px 0;
    list-style: none;
}

/* Path (faint) */
.app-proc::before,
.app-proc::after {
    content: '';
    position: absolute;
    left: calc(var(--rail-x) - 1.5px);
    top: var(--rail-gap);
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg,
        #f59e0b 0%, #f59e0b 30%,
        #7c5cf0 40%, #7c5cf0 58%,
        #3b82f6 68%, #3b82f6 82%,
        #22c55e 92%, #22c55e 100%);
}

.app-proc::before {
    bottom: var(--rail-gap);
    opacity: 0.22;
}

/* Progress fill growing down the path */
.app-proc::after {
    height: 0;
    background-size: 100% calc(100% * 1);
    animation: app-proc-progress 9.6s linear infinite;
}

@keyframes app-proc-progress {
    0% { height: 0; opacity: 1; }
    87.5% { height: calc(100% - 2 * var(--rail-gap)); opacity: 1; }
    96% { height: calc(100% - 2 * var(--rail-gap)); opacity: 0; }
    100% { height: 0; opacity: 0; }
}

.app-proc-step {
    --c: #d97706;
    --c-soft: rgb(251 191 36 / 0.16);
    --c-grad: linear-gradient(135deg, #fbbf24, #f59e0b);
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: calc(var(--rail-x) * 2) minmax(0, 1fr) auto;
    align-items: center;
    padding: 6px 12px 6px 0;
    border-radius: 12px;
    transition: background-color 0.2s ease;
    animation: app-proc-row 9.6s ease-in-out infinite;
    animation-delay: calc(var(--n, 0) * 1.2s);
}

.app-proc-step.is-docs { --c: #6d4ef0; --c-soft: rgb(124 92 240 / 0.13); --c-grad: linear-gradient(135deg, #a78bfa, #6d4ef0); }
.app-proc-step.is-apply { --c: #2563eb; --c-soft: rgb(59 130 246 / 0.13); --c-grad: linear-gradient(135deg, #60a5fa, #2563eb); }
.app-proc-step.is-done { --c: #16a34a; --c-soft: rgb(34 197 94 / 0.14); --c-grad: linear-gradient(135deg, #4ade80, #16a34a); }

.app-proc-step:hover {
    background: linear-gradient(90deg, var(--c-soft), transparent 85%);
}

/* Node on the path */
.app-proc-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--c);
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--c);
    transition: transform 0.2s ease;
    animation: app-proc-node 9.6s ease-in-out infinite;
    animation-delay: inherit;
}

.app-proc-node .ux4g-icon-outlined {
    font-size: 16px;
    color: inherit;
}

.app-proc-step:hover .app-proc-node {
    transform: scale(1.1);
}

.app-proc-label {
    padding-left: 6px;
    color: var(--ux4g-text-neutral-primary);
    font-size: 14px;
    font-weight: var(--ux4g-fw-semibold);
    line-height: 1.3;
}

/* Large faint step number */
.app-proc-num {
    color: var(--c);
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    opacity: 0.22;
    animation: app-proc-num 9.6s ease-in-out infinite;
    animation-delay: inherit;
}

/* The step being "reached" */
@keyframes app-proc-row {
    0%, 12.5%, 100% { background-color: transparent; }
    3%, 10% { background-color: var(--c-soft); }
}

@keyframes app-proc-node {
    0%, 12.5%, 100% {
        transform: none;
        background: #ffffff;
        color: var(--c);
        box-shadow: none;
    }

    3%, 10% {
        transform: scale(1.12);
        background: var(--c-grad);
        color: #ffffff;
        box-shadow: 0 0 0 4px var(--c-soft), 0 4px 12px rgb(0 0 0 / 0.15);
    }
}

@keyframes app-proc-num {
    0%, 12.5%, 100% { opacity: 0.22; }
    3%, 10% { opacity: 1; }
}

/* Short laptop screens: a little tighter */
@media (min-width: 992px) and (min-height: 600px) and (max-height: 820px) {
    .app-proc { --rail-gap: 15px; }

    .app-proc-step {
        padding-block: 3px;
    }

    .app-proc-node {
        width: 26px;
        height: 26px;
    }

    .app-proc-node .ux4g-icon-outlined {
        font-size: 14px;
    }

    .app-proc-label {
        font-size: 13px;
    }

    .app-proc-num {
        font-size: 15px;
    }
}

/* 7-step variant (login page): the progress reaches the last node at 7.2 s (75 % of the loop) */
.app-proc--7::after {
    animation-name: app-proc-progress-7;
}

@keyframes app-proc-progress-7 {
    0% { height: 0; opacity: 1; }
    75% { height: calc(100% - 2 * var(--rail-gap)); opacity: 1; }
    90% { height: calc(100% - 2 * var(--rail-gap)); opacity: 0; }
    100% { height: 0; opacity: 0; }
}

/* Compact variant for narrow side panels (login page) */
.app-proc--compact { --rail-x: 18px; --rail-gap: 14px; gap: 1px; }
.app-proc--compact .app-proc-step { padding: 3px 10px 3px 0; }
.app-proc--compact .app-proc-node { width: 26px; height: 26px; }
.app-proc--compact .app-proc-node .ux4g-icon-outlined { font-size: 14px; }
.app-proc--compact .app-proc-label { font-size: 13px; }
.app-proc--compact .app-proc-num { font-size: 15px; }

@media (min-width: 992px) and (max-height: 860px) {
    .app-proc--compact { --rail-gap: 12px; }
    .app-proc--compact .app-proc-step { padding-block: 2px; }
    .app-proc--compact .app-proc-node { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-proc::after,
    .app-proc-step,
    .app-proc-node,
    .app-proc-num {
        animation: none !important;
    }

    .app-proc::after {
        display: none;
    }
}

/* ---------- Grid variant: 4 steps per row (login page) ----------
 * 1  2  3  4
 * 5  6  7
 * Node on top with a small number badge, label centred below,
 * short connectors between nodes in the same row.
 */
.app-proc--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 4px;
    padding: 4px 0 2px;
}

/* no vertical path in the grid layout */
.app-proc--grid::before,
.app-proc--grid::after {
    display: none;
}

.app-proc--grid .app-proc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    text-align: center;
}

.app-proc--grid .app-proc-step:hover {
    background: var(--c-soft);
}

.app-proc--grid .app-proc-node {
    position: relative;
    width: 34px;
    height: 34px;
}

.app-proc--grid .app-proc-node .ux4g-icon-outlined {
    font-size: 17px;
}

.app-proc--grid .app-proc-label {
    padding: 0;
    font-size: 12px;
    line-height: 1.25;
}

/* number as a small badge on the node's corner */
.app-proc--grid .app-proc-num {
    position: absolute;
    top: 2px;
    left: calc(50% + 10px);
    z-index: 2;
    min-width: 18px;
    padding: 1px 4px;
    border: 1.5px solid #ffffff;
    border-radius: 999px;
    background-color: var(--c);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
    opacity: 0.55;
}

/* connector to the next step in the same row */
.app-proc--grid .app-proc-step::after {
    content: '';
    position: absolute;
    top: 23px;
    left: calc(50% + 21px);
    width: calc(100% - 38px);
    height: 2px;
    border-radius: 2px;
    background: var(--c);
    opacity: 0.25;
    animation: app-proc-connector 9.6s ease-in-out infinite;
    animation-delay: inherit;
}

.app-proc--grid .app-proc-step:nth-child(4n)::after,
.app-proc--grid .app-proc-step:last-child::after {
    display: none;
}

@keyframes app-proc-connector {
    0%, 12.5%, 100% { opacity: 0.25; }
    5%, 11% { opacity: 1; }
}

@media (min-width: 992px) and (max-height: 860px) {
    .app-proc--grid {
        gap: 6px 4px;
    }

    .app-proc--grid .app-proc-step {
        gap: 4px;
        padding: 4px 3px;
    }

    .app-proc--grid .app-proc-node {
        width: 30px;
        height: 30px;
    }

    .app-proc--grid .app-proc-step::after {
        top: 19px;
        left: calc(50% + 19px);
        width: calc(100% - 34px);
    }

    .app-proc--grid .app-proc-label {
        font-size: 11.5px;
    }
}

@media (max-width: 420px) {
    .app-proc--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-proc--grid .app-proc-step:nth-child(4n)::after {
        display: block;
    }

    .app-proc--grid .app-proc-step:nth-child(2n)::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-proc--grid .app-proc-step::after {
        animation: none !important;
    }
}

/* Grid badges: crisp white-with-outline, solid when the step is active */
.app-proc--grid .app-proc-num {
    border: 1.5px solid var(--c);
    background-color: #ffffff;
    color: var(--c);
    opacity: 1;
    animation-name: app-proc-badge;
}

@keyframes app-proc-badge {
    0%, 12.5%, 100% {
        background-color: #ffffff;
        color: var(--c);
    }

    3%, 10% {
        background-color: var(--c);
        color: #ffffff;
    }
}

/* Grid variant: centre a shorter last row (e.g. 4 + 3) instead of leaving an empty slot */
.app-proc--grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 0;
}

.app-proc--grid .app-proc-step {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 0;
}

/* labels wrap inside their cell instead of spilling out */
.app-proc--grid .app-proc-label {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 420px) {
    .app-proc--grid .app-proc-step {
        flex-basis: 50%;
        max-width: 50%;
    }
}

.app-proc--grid {
    flex-direction: row;
    align-items: flex-start;
    row-gap: 8px;
}

/* ---------- Badge variant (vertical): number as a badge on the node's corner ----------
 * Same look as the login grid, stacked in one column (home page).
 */
.app-proc--badges .app-proc-step {
    grid-template-columns: calc(var(--rail-x) * 2) minmax(0, 1fr);
}

.app-proc--badges .app-proc-node {
    width: 34px;
    height: 34px;
}

.app-proc--badges .app-proc-node .ux4g-icon-outlined {
    font-size: 17px;
}

.app-proc--badges .app-proc-num {
    position: absolute;
    top: 50%;
    left: calc(var(--rail-x) + 8px);
    z-index: 2;
    min-width: 18px;
    margin-top: -22px;
    padding: 1px 4px;
    border: 1.5px solid var(--c);
    border-radius: 999px;
    background-color: #ffffff;
    color: var(--c);
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
    opacity: 1;
    animation-name: app-proc-badge;
}

.app-proc--badges .app-proc-label {
    padding-left: 10px;
}

@media (min-width: 992px) and (min-height: 600px) and (max-height: 820px) {
    .app-proc--badges .app-proc-node {
        width: 28px;
        height: 28px;
    }

    .app-proc--badges .app-proc-node .ux4g-icon-outlined {
        font-size: 15px;
    }

    .app-proc--badges .app-proc-num {
        left: calc(var(--rail-x) + 6px);
        margin-top: -19px;
        font-size: 9px;
    }
}
