/* =====================================================================
   Zeigarnik effect – progress + unfinished-task UI
   Used on: drug testing list, cart, thank-you page
   ===================================================================== */

/* ---------- 1. Step tracker (all pages) ---------- */
.zg-tracker {
    max-width: 760px;
    margin: 14px auto 18px;
    padding: 14px 18px 12px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.zg-steps {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.zg-step {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #98a2b3;
    white-space: nowrap;
}

.zg-step:last-child {
    flex: 0 0 auto;
}

/* connector line after each step */
.zg-step:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 2px;
    margin: 0 10px;
    background: #e4e7ec;
    border-radius: 2px;
}

.zg-step.is-done:not(:last-child)::after {
    background: #1e8e3e;
}

.zg-dot {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #d0d5dd;
    background: #fff;
    font-size: 13px;
    line-height: 1;
}

.zg-step.is-done {
    color: #1e8e3e;
}

.zg-step.is-done .zg-dot {
    background: #1e8e3e;
    border-color: #1e8e3e;
    color: #fff;
}

.zg-step.is-current {
    color: #0037b0;
}

.zg-step.is-current .zg-dot {
    border-color: #0037b0;
    color: #0037b0;
    box-shadow: 0 0 0 4px rgba(0, 55, 176, .12);
    animation: zgPulse 2s ease-in-out infinite;
}

@keyframes zgPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0, 55, 176, .10); }
    50%      { box-shadow: 0 0 0 7px rgba(0, 55, 176, .05); }
}

/* ---------- 2. Progress bar (shared) ---------- */
.zg-bar {
    width: 100%;
    height: 8px;
    margin-top: 12px;
    background: #eaecf0;
    border-radius: 999px;
    overflow: hidden;
}

.zg-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0037b0, #3b82f6);
    border-radius: 999px;
    transition: width .5s ease;
}

.is-complete .zg-bar-fill {
    background: linear-gradient(90deg, #1e8e3e, #34c759);
}

.zg-msg {
    margin: 10px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #344054;
    text-align: center;
}

/* ---------- 3. "Pick up where you left off" banner (drug testing list) ---------- */
.zg-resume {
    max-width: 760px;
    margin: 0 auto 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fff8e6;
    border: 1px solid #ffe6a1;
    border-radius: 12px;
}

.zg-resume-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: #475467;
}

.zg-resume-text strong {
    font-size: 15px;
    color: #b54708;
}

.zg-resume-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    background: #0037b0;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 8px;
    transition: background .2s ease, transform .2s ease;
}

.zg-resume-btn:hover {
    background: #002a8a;
    transform: translateX(2px);
}

/* ---------- 4. Cart: "tasks left" checklist ---------- */
.zg-tasks {
    max-width: 760px;
    margin: 0 auto 18px;
    padding: 16px 18px;
    background: #f5f8ff;
    border: 1px solid #cfe0ff;
    border-radius: 12px;
    transition: background .3s ease, border-color .3s ease;
}

.zg-tasks.is-complete {
    background: #ecfdf3;
    border-color: #a6f4c5;
}

.zg-tasks-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-weight: 700;
    color: #0037b0;
}

.zg-tasks.is-complete .zg-tasks-head {
    color: #1e8e3e;
}

.zg-tasks-count {
    font-size: 13px;
    font-weight: 600;
    color: #667085;
    white-space: nowrap;
}

.zg-task-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.zg-task {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #344054;
}

.zg-task small {
    margin-left: 4px;
    color: #98a2b3;
    font-weight: 500;
}

.zg-task-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #b2b9c6;
    background: #fff;
    font-size: 12px;
    color: #fff;
    transition: all .25s ease;
}

.zg-task.is-done {
    color: #667085;
}

.zg-task.is-done .zg-task-icon {
    background: #1e8e3e;
    border-color: #1e8e3e;
}

.zg-task.is-done .zg-task-icon::before {
    content: "\2713";
}

.zg-task.is-done .zg-task-label {
    text-decoration: line-through;
    text-decoration-color: #b2b9c6;
}

.zg-next-btn {
    margin-top: 14px;
    padding: 9px 16px;
    background: #fff;
    color: #0037b0;
    border: 1.5px solid #0037b0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.zg-next-btn:hover {
    background: #0037b0;
    color: #fff;
}

.zg-next-btn[hidden] {
    display: none;
}

/* ---------- 5. Thank-you page: "your test isn't finished yet" ---------- */
.zg-after {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    padding: 20px;
    background: #fff;
    border: 1px solid #cfe0ff;
    border-radius: 12px;
    text-align: left;
}

.zg-after.is-complete {
    border-color: #a6f4c5;
    background: #f6fef9;
}

.zg-after-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.zg-after-head h5 {
    margin: 0;
    font-weight: 700;
    color: #0037b0;
}

.zg-after.is-complete .zg-after-head h5 {
    color: #1e8e3e;
}

.zg-after-count {
    font-size: 13px;
    font-weight: 600;
    color: #667085;
}

.zg-after-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.zg-after-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fff;
    transition: background .25s ease, border-color .25s ease;
}

.zg-after-item label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    width: 100%;
    cursor: pointer;
}

.zg-after-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.zg-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    margin-top: 1px;
    border: 2px solid #b2b9c6;
    border-radius: 50%;
    background: #fff;
    color: #fff;
    font-size: 13px;
    transition: all .25s ease;
}

.zg-after-item input:checked + .zg-check,
.zg-after-item.is-done .zg-check {
    background: #1e8e3e;
    border-color: #1e8e3e;
}

.zg-after-item input:checked + .zg-check::before,
.zg-after-item.is-done .zg-check::before {
    content: "\2713";
}

.zg-after-item input:focus-visible + .zg-check {
    outline: 3px solid rgba(0, 55, 176, .35);
    outline-offset: 2px;
}

.zg-after-item.is-done,
.zg-after-item.is-checked {
    background: #f6fef9;
    border-color: #a6f4c5;
}

.zg-after-item.is-waiting .zg-check {
    border-style: dashed;
    border-color: #98a2b3;
}

.zg-after-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: #475467;
}

.zg-after-body strong {
    font-size: 15px;
    color: #1d2939;
}

.zg-after-cta {
    margin-top: 6px;
    align-self: flex-start;
    padding: 7px 14px;
    background: #0037b0;
    color: #fff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}

.zg-after-cta:hover {
    background: #002a8a;
}

/* ---------- 6. Small screens + reduced motion ---------- */
.zg-tracker, .zg-resume, .zg-tasks, .zg-after { box-sizing: border-box; }

@media (max-width: 640px) {
    /* Tracker: 3 equal columns, dot on top, label underneath (all labels stay visible) */
    .zg-tracker { width: 100%; margin: 12px 0 16px; padding: 12px 10px 10px; }
    .zg-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .zg-step,
    .zg-step:last-child {
        position: relative;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        font-size: 11.5px;
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }
    .zg-label { padding: 0 2px; }
    /* connector line drawn between the centres of neighbouring dots */
    .zg-step:not(:last-child)::after {
        position: absolute;
        top: 12px;
        left: calc(50% + 19px);
        width: calc(100% - 38px);
        flex: none;
        margin: 0;
    }
    .zg-msg { font-size: 13px; }
    .zg-bar { margin-top: 10px; }

    /* Other blocks */
    .zg-resume { flex-direction: column; align-items: stretch; text-align: center; padding: 12px; }
    .zg-resume-btn { text-align: center; }
    .zg-tasks, .zg-after { padding: 14px 12px; }
    .zg-tasks-head { flex-direction: column; gap: 2px; }
    .zg-next-btn { width: 100%; }
    .zg-after-item { padding: 10px; }
    .zg-after-cta { align-self: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .zg-step.is-current .zg-dot { animation: none; }
    .zg-bar-fill, .zg-task-icon, .zg-check { transition: none; }
}
