/* =============================================================================
 *  pipeline.css — نوار «درخواست شما»
 * -----------------------------------------------------------------------------
 *  فقط وقتی دیده می‌شود که همین نشست یک درخواست دارد (مهمان نواری نمی‌بیند).
 *  سه لایه‌ی اطلاعات، به ترتیب اهمیت:
 *    ۱) یک جمله: «الان چه خبر است» + کد رهگیری
 *    ۲) یک دکمه: قدمِ بعدی (اگر همین صفحه قدمِ بعدی نباشد)
 *    ۳) نوار پیشرفتِ چهارتکه — آرام، زیرِ جمله
 *  رنگِ لبه و آیکون از «لحن» می‌آید: primary (کار با شماست)، info (منتظر
 *  بررسی)، ok (تایید شد)، err (نیاز به اصلاح). همه از توکن‌های styles.css.
 * ========================================================================== */

.bz-case {
    --tone:     var(--primary-text);
    --tone-rgb: var(--primary-rgb);
    max-width: 1080px;
    margin: 14px auto 0;
    padding: 0 16px;
}
.bz-case.tone-info { --tone: var(--info-text); --tone-rgb: var(--info-rgb); }
.bz-case.tone-ok   { --tone: var(--ok-text);   --tone-rgb: var(--ok-rgb); }
.bz-case.tone-err  { --tone: var(--err-text);  --tone-rgb: var(--err-rgb); }

.bz-case-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid rgb(var(--tone-rgb) / .32);
    border-inline-start: 4px solid var(--tone);
    background:
        linear-gradient(90deg, rgb(var(--tone-rgb) / .07), transparent 70%),
        var(--surface);
    box-shadow: 0 8px 24px -18px rgb(var(--shade-rgb) / calc(.6 * var(--shade-k)));
}

.bz-case-ico {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgb(var(--tone-rgb) / .14);
    color: var(--tone);
    font-size: 17px;
}

.bz-case-body { flex: 1 1 auto; min-width: 0; }

.bz-case-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.7;
}
.bz-case-code {
    padding: 1px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-sunken);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;          /* کد لاتین است؛ فاصله‌ی حروف برای فارسی صفر می‌ماند */
    font-variant-numeric: tabular-nums;
}

.bz-case-sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12.8px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* نوار پیشرفت: چهار تکه، برچسبِ کوچک زیرِ هر تکه */
.bz-case-steps {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.bz-case-steps li { min-width: 0; }
.bz-case-seg {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
}
.bz-case-lbl {
    display: block;
    margin-top: 5px;
    color: var(--faint);
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bz-case-steps .st-done     .bz-case-seg { background: var(--ok); }
.bz-case-steps .st-done     .bz-case-lbl { color: var(--muted); }
.bz-case-steps .st-current  .bz-case-seg { background: linear-gradient(90deg, var(--tone) 45%, var(--line) 45%); }
.bz-case-steps .st-current  .bz-case-lbl { color: var(--tone); font-weight: 700; }
.bz-case-steps .st-rejected .bz-case-seg { background: var(--err); }
.bz-case-steps .st-rejected .bz-case-lbl { color: var(--err-text); font-weight: 700; }

.bz-case-act {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--primary-hi), var(--primary));
    color: var(--on-primary);
    font-size: 13.5px;
    font-weight: 800;
    white-space: nowrap;
    transition: filter .18s ease, transform .12s ease;
}
.bz-case-act:hover  { filter: brightness(1.08); color: var(--on-primary); }
.bz-case-act:active { transform: translateY(1px); }
.bz-case-act:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.bz-case.tone-err .bz-case-act { background: var(--err); }
.bz-case.tone-ok  .bz-case-act,
.bz-case.tone-info .bz-case-act {
    background: transparent;
    color: var(--tone);
    border: 1px solid rgb(var(--tone-rgb) / .45);
}
.bz-case.tone-ok  .bz-case-act:hover,
.bz-case.tone-info .bz-case-act:hover { background: rgb(var(--tone-rgb) / .1); color: var(--tone); filter: none; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* موبایل: دکمه زیرِ متن و تمام‌عرض؛ برچسبِ مرحله‌ها پنهان (جمله‌ی بالا کافی است) */
@media (max-width: 640px) {
    .bz-case-inner { flex-wrap: wrap; align-items: flex-start; padding: 13px 13px 14px; }
    .bz-case-ico   { width: 38px; height: 38px; font-size: 15px; }
    .bz-case-body  { flex-basis: calc(100% - 52px); }
    .bz-case-lbl   { display: none; }
    .bz-case-act   { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .bz-case-act { transition: none; }
}
