/* ==========================================================================
   Page: تتبع الطلب / Track Your Request
   Sits on top of submitted-en.css (cards, labels, summary grid). Logical
   properties only, so the same file serves the Arabic page.
   ========================================================================== */

.tr-main .sb-col { text-align: start; }

/* ---------- Lookup form ---------- */
.tr-lookup__title {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: var(--fs-lg, 1.125rem); font-weight: 700; color: var(--dc-navy);
}
.tr-lookup__icon { width: 2.75rem; height: 2.75rem; flex-shrink: 0; }

/* "REQ-" fixed beside the box: the patient types the five digits only. */
.tr-number { display: flex; align-items: stretch; }
.tr-number__prefix {
  display: inline-flex; align-items: center; padding: 0 0.85rem;
  border: 1px solid var(--dc-border); border-inline-end: 0;
  border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md);
  background: var(--dc-navy-50); color: var(--dc-navy);
  font-weight: 800; letter-spacing: 0.02em;
}
.tr-number .tr-number__input {
  flex: 1; min-width: 0; border-start-start-radius: 0; border-end-start-radius: 0;
  font-weight: 700; letter-spacing: 0.12em; font-size: 1rem;
}
.tr-lookup__lede { margin: 0 0 var(--sp-4); font-size: var(--fs-sm); color: var(--dc-text-3); }

.tr-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }
.tr-form .form-group { margin: 0; }
.tr-form__submit { margin-block-start: var(--sp-4); width: 100%; justify-content: center; }
.tr-error:empty, .tr-error.validation-summary-valid { display: none; }
.tr-error ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Result ---------- */
.tr-result__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.tr-result__number { display: block; font-size: 1.5rem; font-weight: 800; color: var(--dc-navy); direction: ltr; text-align: start; }
.tr-result__meaning { margin: var(--sp-3) 0 var(--sp-4); font-weight: 600; color: var(--dc-text-2); }

.tr-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700;
  background: var(--dc-navy-50); color: var(--dc-navy);
}
.tr-pill::before { content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.tr-pill--approval { background: var(--dc-status-approval-bg, #f5f3ff); color: var(--dc-status-approval, #6d28d9); }
.tr-pill--processing { background: #fff4e0; color: #9a5b00; }
.tr-pill--ready { background: #e3f6ec; color: #11733f; }
.tr-pill--completed { background: #eef0f3; color: #4a5568; }
.tr-pill--cancelled { background: var(--dc-red-100, #fde6e7); color: var(--dc-red-600, #c4262b); }

/* Progress: four pictures on one line, a bar joining their centres (client's design, 2026-11-05).
   Passed stages carry a green check, the current one pulses, the ones ahead are greyed. */
.tr-current { margin: 0 0 var(--sp-4); text-align: center; font-size: var(--fs-sm); color: var(--dc-text-3); }
.tr-current strong { color: var(--dc-navy); }

.tr-steps {
  --pic: clamp(3.6rem, 15vw, 6.5rem);
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 0 var(--sp-5); padding: 0; list-style: none;
}
.tr-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; }
.tr-step::before {
  content: ''; position: absolute; inset-block-start: calc(var(--pic) / 2 - 1.5px);
  inset-inline-end: calc(50% + var(--pic) / 2); width: calc(100% - var(--pic)); height: 3px;
  background: var(--dc-border); border-radius: 3px; z-index: 0;
}
.tr-step:first-child::before { display: none; }
.tr-step.is-done::before, .tr-step.is-current::before { background: var(--dc-navy); }

.tr-step__pic {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: var(--pic); height: var(--pic); border-radius: 50%;
  border: 2.5px solid var(--dc-navy); background: var(--dc-surface, #fff);
}
.tr-step__pic img { width: 72%; height: 72%; }
.tr-step.is-ahead .tr-step__pic { border-color: var(--dc-border); }
.tr-step.is-ahead .tr-step__pic img { filter: grayscale(1); opacity: 0.4; }

.tr-step__check {
  position: absolute; inset-block-end: 2%; inset-inline-end: 2%;
  display: grid; place-items: center; width: 34%; height: 34%; min-width: 1.35rem; min-height: 1.35rem;
  border-radius: 50%; background: #16a34a; color: #fff; border: 2px solid #fff;
  font-size: clamp(0.7rem, 2.6vw, 1rem); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* The stage the request is at: a ring that keeps swelling and fading out. */
.tr-step.is-current .tr-step__pic { border-width: 3px; box-shadow: 0 0 0 0 rgba(39, 36, 104, 0.45); animation: trPulse 1.8s ease-out infinite; }
.tr-step.is-current .tr-step__pic::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 3px solid var(--dc-navy); animation: trRing 1.8s ease-out infinite; pointer-events: none;
}
@keyframes trPulse {
  0%   { box-shadow: 0 0 0 0 rgba(39, 36, 104, 0.45); }
  70%  { box-shadow: 0 0 0 14px rgba(39, 36, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 36, 104, 0); }
}
@keyframes trRing {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-step.is-current .tr-step__pic { animation: none; box-shadow: 0 0 0 5px var(--dc-navy-50); }
  .tr-step.is-current .tr-step__pic::after { animation: none; display: none; }
}

.tr-step__label { font-size: var(--fs-xs); font-weight: 700; color: var(--dc-text-3); line-height: 1.35; }
.tr-step.is-done .tr-step__label, .tr-step.is-current .tr-step__label { color: var(--dc-navy); }
.tr-step__time { font-size: 0.7rem; color: var(--dc-text-3); }

.tr-cancelled { margin-block-end: var(--sp-4); }
.tr-summary { margin-block-start: 0; }

.tr-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block-start: var(--sp-5); }
.tr-actions .btn { display: inline-flex; align-items: center; gap: 0.4rem; }

@media (max-width: 480px) {
  .tr-form__row { grid-template-columns: 1fr; }
  .tr-step__time { font-size: 0.62rem; }
  .tr-actions .btn { flex: 1 1 100%; justify-content: center; }
}
