/* صفحه پیگیری سفارش — از متغیرهای style.css استفاده می‌کند */
.track-page { padding-block: clamp(3rem, 8vw, 5rem) 0; position: relative; isolation: isolate; min-height: 60vh; }
.track-page::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 0; transform: translateX(-50%);
  width: min(760px, 100%); aspect-ratio: 1; background: url("../assets/img/glow-2.webp") center / contain no-repeat; opacity: .8; pointer-events: none;
}

.track-form, .track-result, .payment-banner { max-width: 640px; margin-inline: auto; }
.track-form { padding: clamp(1.25rem, 3vw, 1.75rem); }
.track-row { display: flex; flex-direction: column; gap: .6rem; }
.track-row .input-wrap { flex: 1; min-width: 0; }
.track-row .input-wrap input { width: 100%; min-width: 0; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
.track-row .btn { min-height: 52px; padding-inline: 28px; }

.recent-codes { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 13px; color: var(--muted); }
.recent-codes > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.recent-codes button { min-height: 44px; font-family: var(--font-latin); font-size: 13px; padding: 3px 14px; border-radius: 22px; color: var(--text); background: rgba(10, 8, 16, .5); border: 1px solid var(--line-strong); direction: ltr; }
@media (hover: hover) { .recent-codes button:hover { border-color: var(--magenta); color: #fff; } }

.payment-banner { margin-bottom: 1rem; padding: .9rem 1.1rem; border-radius: 12px; font-size: 14.5px; text-align: center; }
.payment-banner.ok { color: #b9f5d3; background: rgba(47, 191, 113, .12); border: 1px solid rgba(47, 191, 113, .4); }
.payment-banner.bad { color: #ffc9d4; background: rgba(255, 107, 139, .1); border: 1px solid rgba(255, 107, 139, .4); }
.payment-banner.wait { color: #ffe0b0; background: rgba(240, 160, 32, .1); border: 1px solid rgba(240, 160, 32, .4); }

.track-result { margin-top: 1.25rem; padding: clamp(1.25rem, 3vw, 1.9rem); }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.result-code { font-size: 13px; color: var(--muted); }
.result-head h2 { font-size: 1.25rem; color: var(--text-strong); line-height: 1.6; }

.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: 4px 12px; border-radius: 30px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pending_payment { color: #ffd08a; background: rgba(240, 160, 32, .12); border-color: rgba(240, 160, 32, .35); }
.st-paid { color: #9cc8ff; background: rgba(76, 141, 255, .12); border-color: rgba(76, 141, 255, .35); }
.st-processing { color: #c9b3ff; background: rgba(121, 80, 255, .14); border-color: rgba(121, 80, 255, .4); }
.st-completed { color: #8ff0bb; background: rgba(47, 191, 113, .12); border-color: rgba(47, 191, 113, .4); }
.st-cancelled, .st-failed { color: #ffb3c2; background: rgba(255, 107, 139, .1); border-color: rgba(255, 107, 139, .35); }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.6rem 0 1.2rem; list-style: none; counter-reset: s; }
.stepper li { position: relative; text-align: center; font-size: 12px; color: var(--muted); padding-top: 34px; }
.stepper li::before {
  counter-increment: s; content: counter(s, persian);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); background: #15111f; border: 1.5px solid var(--line-strong);
}
.stepper li::after { content: ""; position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--text-strong); }
.stepper li.done::before { content: "✓"; color: #fff; border-color: transparent; background: var(--grad-brand); }
.stepper li.done::after, .stepper li.current::after { background: linear-gradient(90deg, var(--indigo), var(--pink)); }
.stepper li.current::before { color: #fff; border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(243, 60, 192, .18); }
.stepper li.current { color: #fff; font-weight: 600; }
.stepper.is-stopped li.current::before { content: "!"; border-color: var(--error); box-shadow: 0 0 0 4px rgba(255, 107, 139, .15); }

.result-meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem 1.5rem; }
.result-meta div { display: flex; justify-content: space-between; gap: 1rem; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.result-meta dt { color: var(--muted); }
.result-meta dd { color: var(--text-strong); font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.result-help { margin: 1.1rem 0; font-size: 14px; color: var(--text-soft); line-height: 1.9; }

.footer-home { font-size: 13.5px; color: var(--text-soft); }
@media (hover: hover) { .footer-home:hover { color: #fff; } }

@media (min-width: 480px) {
  .result-actions .btn { flex: 0 1 auto; }
  .track-row { flex-direction: row; }
  .stepper li { font-size: 12.5px; }
}
@media (min-width: 768px) {
  .result-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- پرداخت، رسید و تاریخچه ---- */
.st-receipt_submitted { color: #9cc8ff; background: rgba(76, 141, 255, .12); border-color: rgba(76, 141, 255, .35); }
.st-refunded { color: #ffd08a; background: rgba(240, 160, 32, .12); border-color: rgba(240, 160, 32, .35); }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.result-actions .btn { flex: 1 1 100%; }   /* موبایل: دکمه‌ها تمام‌عرض و هم‌اندازه؛ از ۴۸۰px کنار هم */
.r-manual { margin: 1rem 0 1.2rem; padding: 1rem; border-radius: 16px; background: rgba(10, 8, 16, .35); border: 1px solid var(--line); }
.result-history { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.result-history summary { cursor: pointer; font-size: 13.5px; color: var(--text-soft); }
.result-history ol { list-style: none; margin-top: .7rem; display: grid; gap: .4rem; }
.result-history li { display: flex; justify-content: space-between; gap: 1rem; font-size: 13px; color: var(--text-soft); padding: 6px 0; border-bottom: 1px dashed var(--line); }
.result-history time { color: var(--muted); }
.result-meta dt .latin { font-size: 12px; }
.track-page .btn { min-height: 44px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .2rem; font-size: 14px; color: var(--muted); }
@media (hover: hover) { .back-link:hover { color: #fff; } }
