/* Self-service order tracking (DOMAIN §15.1). Tokens mirror status.css; inputs mirror
   checkout.css; the CTA mirrors the landing .btn-primary. Timeline is horizontal on
   desktop/tablet, vertical on mobile. Flex only, no CSS grid. */

:root {
  --ink: #0b0c0e;
  --surface: #f5f6f8;
  --line: #e7e9ee;
  --text: #15171c;
  --muted: #6b7280;
  --blue: #2563eb;
  --blue-700: #1d4ed8;
  --blue-glow: rgba(37, 99, 235, 0.45);
  --input-line: #dedede;
  --placeholder: #757680;
  --ok: #15803d;
  --straw-bg: #fdf3c4;
  --orange: #d97706;
  --r: 16px;
  --maxw: 720px;
  --display: 'Sora', sans-serif;
  --body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img {
  max-width: 100%;
  display: block;
}
.is-hidden {
  display: none !important;
}
/* honeypot: never shown to a human; display:none also blocks browser autofill */
.hp {
  display: none;
}

/* ── page chrome ────────────────────────────────────────────────────────── */
.st-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.st-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}
.st-logo img {
  height: 26px;
  width: auto;
}

/* subnav above the card: breadcrumb (left) + back-to-funnel button (right) */
.to-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 0;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
}
.crumb-link {
  color: var(--blue);
  text-decoration: underline;
}
.crumb-sep {
  color: var(--muted);
}
.crumb-cur {
  color: var(--muted);
}
/* back-to-funnel button: blue, evident */
.btn-back-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 10px;
  border-bottom: 3px solid #15307a;
  background: var(--blue);
  color: #fff;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.btn-back-top:hover {
  background: var(--blue-700);
}

.page-head {
  padding: 18px 0 20px;
}
.page-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--ink);
  margin: 0;
  line-height: 1.1;
}
.page-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.st-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
}
.section-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 24px;
}

/* ── lookup form ────────────────────────────────────────────────────────── */
.to-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.req {
  color: #dc2626;
  font-weight: 700;
}
/* inputs: exactly the checkout style (white bg, hairline border) */
.field input {
  width: 100%;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input::placeholder {
  color: var(--placeholder);
}
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.field input.invalid {
  border-color: #dc2626;
}
/* email + CAP inline, equal width; wrap to a column when narrow */
.field.two {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.field.two .col-email,
.field.two .col-cap {
  flex: 1 1 200px;
  min-width: 0;
}
.to-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
/* CTA: exactly the landing .btn / .btn-primary (border-bottom 6px) */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--blue);
  padding: 13px 22px;
  border: none;
  border-radius: 12px;
  border-bottom: 6px solid #15307a;
  box-shadow: 0 8px 24px -8px var(--blue-glow);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.2s ease,
    box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--blue-700);
  box-shadow: 0 12px 30px -8px var(--blue-glow);
}
.btn-primary:active {
  transform: translateY(1px) scale(0.99);
}
.form-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-error svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ── reduced order card ─────────────────────────────────────────────────── */
.to-order {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.to-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.to-order-no {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.to-order-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 2px;
}
.to-order-status.done {
  color: var(--ok);
}
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: var(--ok);
}
.to-collect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 16px 18px;
  border: 1px solid #f5d987;
  background: var(--straw-bg);
  border-radius: 14px;
  margin-bottom: 20px;
}
.to-collect-label {
  flex: 1 1 200px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #92620a;
  line-height: 1.35;
}
.to-collect-amount {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  white-space: nowrap;
}
.to-paid {
  font-size: 0.86rem;
  color: var(--muted);
  margin: -4px 0 18px;
}
.to-paid b {
  color: var(--ink);
}

/* ── timeline: horizontal (desktop/tablet), vertical (mobile) ───────────── */
.st-hsteps {
  display: flex;
  align-items: flex-start;
}
.st-hstep {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 0 2px;
}
.st-hstep::before {
  content: '';
  position: absolute;
  top: 11px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.st-hstep:first-child::before {
  display: none;
}
.st-hstep.done::before,
.st-hstep.active::before {
  background: var(--ok);
}
.st-hstep-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: #fff;
}
.st-hstep.done .st-hstep-dot {
  background: var(--ok);
  border-color: var(--ok);
}
.st-hstep.active .st-hstep-dot {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.st-hstep.done.active .st-hstep-dot {
  background: var(--blue);
  border-color: var(--blue);
}
.st-hstep-body {
  margin-top: 8px;
}
.st-hstep-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.st-hstep:not(.done):not(.active) .st-hstep-label {
  color: var(--muted);
  font-weight: 500;
}
.st-hstep-date {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.st-tracking-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 20px;
  margin-right: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

/* ── concluded (collapsed) ──────────────────────────────────────────────── */
.to-final {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.to-final + .to-final {
  margin-top: 10px;
}
.to-final > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 16px 18px;
}
.to-final > summary::-webkit-details-marker {
  display: none;
}
.to-final-no {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
}
.to-final-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.to-final-status.ok {
  color: var(--ok);
}
.to-final-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}
.to-final .chev {
  color: var(--muted);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}
.to-final[open] .chev {
  transform: rotate(180deg);
}
.to-final-body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.group-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 2px 2px;
}

/* ── results footer (help + search again) ───────────────────────────────── */
.to-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 64px;
}
.to-help {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.to-help-text {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.to-help-text a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.wa-line {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  font-size: 0.88rem;
  color: var(--muted);
}
.wa-line span {
  line-height: 1.2;
}
.wa-line strong {
  color: var(--ink);
}
.wa-ico {
  display: inline-flex;
  vertical-align: middle;
}
.wa-ico img {
  display: block;
}

/* very small phones: drop the breadcrumb label so logo + button fit */
@media (max-width: 460px) {
  .crumb-sep,
  .crumb-cur {
    display: none;
  }
}

/* ── tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .page-head {
    padding: 32px 0 18px;
  }
}

/* ── mobile: timeline goes VERTICAL ─────────────────────────────────────── */
@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }
  .page-head {
    padding: 26px 0 16px;
  }
  .st-card,
  .to-order {
    padding: 18px;
  }
  .st-hsteps {
    flex-direction: column;
  }
  .st-hstep {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    padding: 0 0 22px 0;
  }
  .st-hstep:last-child {
    padding-bottom: 0;
  }
  .st-hstep::before {
    top: 24px;
    left: 11px;
    right: auto;
    bottom: 0;
    width: 2px;
    height: auto;
    background: var(--line);
  }
  .st-hstep:first-child::before {
    display: block;
  }
  .st-hstep:last-child::before {
    display: none;
  }
  .st-hstep.done::before,
  .st-hstep.active::before {
    background: var(--line);
  }
  .st-hstep-body {
    margin-top: 0;
    padding-top: 2px;
  }
  .st-hstep-label {
    font-size: 0.92rem;
  }
  .st-hstep-date {
    font-size: 0.78rem;
  }
}
