/* Track your order page. Scoped to the .tk wrapper and .tk- classes. */

/* Sprite icon fallback in case .icon is not styled globally */
body[data-page="track"] .tk .icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.14em;
}

.tk {
  max-width: 1040px;
  margin: 0 auto;
}

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

/* Hero and form */
.tk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "title form" "lede form";
  gap: 0 clamp(24px, 4vw, 56px);
  align-items: end;
  margin: 0 0 clamp(28px, 4vw, 44px);
}
.tk-hero h1 {
  grid-area: title;
  align-self: end;
  font-size: clamp(34px, 5.4vw, 60px);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.tk-lede {
  grid-area: lede;
  align-self: start;
  margin: 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--brown-mid);
  max-width: 34ch;
}

.tk-form {
  grid-area: form;
  background: var(--cream-soft);
  border: 1px solid rgba(43, 26, 18, 0.1);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow);
}
.tk-form__label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brown);
  margin: 0 0 8px;
}
.tk-form__row {
  display: flex;
  gap: 10px;
}
.tk-form__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(43, 26, 18, 0.28);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--brown);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.tk-form__input::placeholder {
  color: #8C7660;
  letter-spacing: 0.08em;
}
.tk-form__input:focus {
  outline: 2px solid var(--caramel-deep);
  outline-offset: 2px;
  border-color: var(--caramel-deep);
}
.tk-form__input[aria-invalid="true"] { border-color: var(--err); }
.tk-form__btn {
  flex: none;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.tk-form__btn .icon { font-size: 17px; }
.tk-form__hint {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.tk-form__error {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--err-bg);
  color: var(--err);
  font-size: 14px;
  line-height: 1.45;
}

/* Result card */
.tk-result:empty { display: none; }
.tk-result { margin: 0 0 clamp(32px, 5vw, 56px); }

.tk-card {
  background: var(--cream-soft);
  border: 1px solid rgba(176, 123, 79, 0.32);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.4vw, 34px);
  box-shadow: var(--shadow);
}
.tk-card--plain {
  background: var(--sand);
  border-color: rgba(43, 26, 18, 0.08);
  box-shadow: none;
}
.tk-card__head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.tk-card__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brown);
  color: var(--gold);
  font-size: 22px;
}
.tk-card--plain .tk-card__mark {
  background: var(--cream-soft);
  color: var(--caramel-deep);
  border: 1px solid rgba(43, 26, 18, 0.1);
}
.tk-card__title {
  font-size: clamp(22px, 2.6vw, 28px);
  margin: 2px 0 6px;
}
.tk-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ok);
}
.tk-card__lede {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--brown-mid);
  max-width: 62ch;
}
.tk-mono {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.tk-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--cream);
  border: 1px solid rgba(43, 26, 18, 0.08);
}
.tk-ref__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.tk-ref__val {
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brown);
  font-variant-numeric: tabular-nums;
}
.tk-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  margin-left: auto;
  border: 1px solid rgba(43, 26, 18, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--brown);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.tk-copy:hover { background: var(--sand); border-color: rgba(43, 26, 18, 0.36); }
.tk-copy__msg {
  flex-basis: 100%;
  text-align: right;
  font-size: 13px;
  color: var(--ok);
}
.tk-copy__msg:empty { display: none; }

.tk-card__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 20px 0 0;
}
.tk-card__item dt {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}
.tk-card__item dd {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--brown);
  overflow-wrap: anywhere;
}
.tk-card__note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 22px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--brown-mid);
}
.tk-card__note .icon { margin-top: 2px; color: var(--caramel-deep); }

.tk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 0;
}
.tk-actions .btn { min-height: 48px; }
.tk-actions .btn .icon { font-size: 18px; }
.tk-actions .btn--primary { padding: 12px 24px; font-size: 15px; }
.tk-actions .btn--ghost { padding: 11px 22px; font-size: 15px; }
.tk-card--plain .tk-actions { margin-left: 64px; }

/* Journey stepper */
.tk-journey { margin: 0 0 clamp(36px, 5vw, 60px); }
.tk-journey__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 0 0 24px;
}
.tk-journey__head h2 { font-size: clamp(24px, 3vw, 32px); }
.tk-journey__note {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 52ch;
}

.tk-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.tk-step {
  position: relative;
  padding: 0 12px 0 0;
}
/* Connector between markers */
.tk-step::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 56px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: rgba(43, 26, 18, 0.14);
}
.tk-step:last-child::after { display: none; }
.tk-step--done::after { background: var(--caramel); }

.tk-step__mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid rgba(43, 26, 18, 0.22);
  color: var(--muted);
  font-size: 21px;
}
.tk-step--done .tk-step__mark {
  background: var(--caramel-deep);
  border-color: var(--caramel-deep);
  color: var(--cream);
}
.tk-step--next .tk-step__mark {
  background: var(--cream-soft);
  border: 2px solid var(--caramel);
  color: var(--caramel-deep);
}
.tk-step__body {
  display: block;
  margin: 14px 0 0;
}
.tk-step__title {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--brown);
}
.tk-step__tag {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--caramel-deep);
  color: var(--cream);
}
.tk-step--next .tk-step__tag {
  background: transparent;
  border: 1px solid var(--caramel);
  color: var(--caramel-deep);
}
.tk-step__text {
  display: block;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brown-mid);
}
.tk-step__sub {
  display: block;
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Help */
.tk-help {
  padding: clamp(22px, 3.4vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--sand);
}
.tk-help h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin: 0 0 18px;
}
.tk-help__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 32px;
  margin: 0;
}
.tk-help__list dt {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--brown);
}
.tk-help__list dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--brown-mid);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .tk-card { animation: tk-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .tk-step--next .tk-step__mark { animation: tk-pulse 2.4s ease-in-out 0.6s 2; }
}
@keyframes tk-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes tk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176, 123, 79, 0); }
  50% { box-shadow: 0 0 0 6px rgba(176, 123, 79, 0.2); }
}

/* Tablet */
@media (max-width: 900px) {
  .tk-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "lede" "form";
  }
  .tk-lede { margin: 0 0 22px; max-width: 46ch; }
  .tk-card__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-help__list { grid-template-columns: 1fr; }
}

/* Mobile: vertical stepper */
@media (max-width: 720px) {
  .tk-steps { grid-template-columns: 1fr; }
  .tk-step {
    display: flex;
    gap: 16px;
    padding: 0 0 22px;
  }
  .tk-step:last-child { padding-bottom: 0; }
  .tk-step::after {
    top: 52px;
    bottom: 4px;
    left: 23px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .tk-step__mark { flex: none; }
  .tk-step__body { margin: 4px 0 0; }
  .tk-card--plain .tk-actions { margin-left: 0; }
}

@media (max-width: 480px) {
  .tk-form__row { flex-direction: column; }
  .tk-form__btn { width: 100%; }
  .tk-card__head { gap: 12px; }
  .tk-card__mark { width: 42px; height: 42px; font-size: 19px; border-radius: 12px; }
  .tk-copy { margin-left: 0; }
  .tk-copy__msg { text-align: left; }
  .tk-actions .btn { width: 100%; }
}
