/* ==========================================================================
   Track your order (/order-status)
   Lookup form, order cards with a 4-step tracker, subscription card,
   "what happens next" steps and a short help list. Brand tokens only.
   Cards set themselves apart with full borders and tints, never a single
   coloured edge.
   ========================================================================== */

.os-page { background: var(--cream); color: var(--charcoal); }
.os-wrap { max-width: 800px; }

/* ---- Hero + form ---- */
.os-hero { padding: var(--space-2xl) 0 var(--space-xl); }
.os-eyebrow {
  margin: 0 0 var(--space-sm);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--sage);
}
.os-title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 500; letter-spacing: -0.025em; line-height: 1.05;
}
.os-lede { margin: 0 0 var(--space-lg); font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 600px; }

.os-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 1px 2px rgba(18, 33, 26, 0.04), 0 12px 32px -20px rgba(18, 33, 26, 0.25);
}
.os-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: start;
}
.os-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.os-field label { font-size: 14px; line-height: 22px; font-weight: 600; color: var(--charcoal); }
.os-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming in on focus */
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid #CFC8BA;
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out, background var(--t-fast) ease-out;
}
.os-field input:hover { border-color: var(--stone); }
.os-field input:focus { outline: none; background: #fff; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(43, 90, 67, 0.16); }
.os-field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180, 73, 63, 0.12); }
.os-field-postcode input { text-transform: uppercase; }
.os-field-postcode input::placeholder { text-transform: none; }

.os-submit {
  position: relative;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 16px; font-weight: 600;
  white-space: nowrap;
  /* Lines up with the inputs (label 22px + 6px gap), whether or not an error shows under them. */
  margin-top: 28px;
  transition: background var(--t-fast) ease-out, transform var(--t-fast) ease-out;
}
.os-submit:hover { background: var(--green-deep); }
.os-submit:active { transform: translateY(1px); }
.os-submit[disabled] { cursor: progress; background: var(--green-deep); }
.os-submit .os-spinner {
  display: none;
  position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: os-spin 0.8s linear infinite;
}
.os-submit.is-loading .os-submit-label { visibility: hidden; }
.os-submit.is-loading .os-spinner { display: block; }
@keyframes os-spin { to { transform: rotate(360deg); } }

.os-field-error { margin: 0; min-height: 0; font-size: 13.5px; color: var(--error); }
.os-field-error:empty { display: none; }
.os-form-note { margin: var(--space-md) 0 0; font-size: 13.5px; color: var(--stone); }

@media (max-width: 720px) {
  .os-hero { padding: var(--space-xl) 0 var(--space-lg); }
  .os-lede { font-size: 16.5px; }
  .os-form { padding: var(--space-md); border-radius: var(--radius-md); }
  .os-fields { grid-template-columns: 1fr; gap: 14px; }
  .os-submit { width: 100%; margin-top: 4px; }
}

/* ---- Results ---- */
.os-results-section { padding: 0 0 var(--space-xl); }
.os-results { scroll-margin-top: 96px; }
.os-results:empty { display: none; }
html.os-auto .os-results:empty { display: block; min-height: 420px; }
.os-results-head { margin: 0 0 var(--space-md); }
.os-results-title { margin: 0 0 4px; font-size: 28px; line-height: 1.2; }
.os-results-title:focus { outline: none; }
.os-results-sub { margin: 0; color: var(--muted); font-size: 15px; }
.os-list { display: flex; flex-direction: column; gap: var(--space-md); }

.os-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
@media (max-width: 720px) { .os-card { padding: 18px var(--space-md); border-radius: var(--radius-md); } }

.os-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); }
.os-order-number { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.os-order-meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.os-pill {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  background: var(--paper-2); color: var(--charcoal);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.os-pill--posted { background: rgba(43, 90, 67, 0.09); border-color: rgba(43, 90, 67, 0.25); color: var(--green); }
.os-pill--delivered { background: var(--green); border-color: var(--green); color: #fff; }
.os-pill--problem { background: rgba(168, 123, 69, 0.12); border-color: rgba(168, 123, 69, 0.4); color: #7A5528; }

/* 4-step tracker: dots joined by a bar that fills as the parcel moves. */
.os-track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--space-lg) 0 var(--space-md);
  padding: 0;
}
.os-track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.os-track li::before {
  content: "";
  position: absolute; top: 9px; right: 50%; left: -50%;
  height: 3px; border-radius: 3px;
  background: var(--line);
}
.os-track li:first-child::before { display: none; }
.os-track li.is-done::before, .os-track li.is-current::before { background: var(--sage); }
.os-dot {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #CFC8BA;
}
.os-track .is-done .os-dot { background: var(--sage); border-color: var(--sage); }
.os-track .is-done .os-dot::after {
  content: ""; width: 5px; height: 9px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.os-track .is-current:not(.is-done) .os-dot { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(43, 90, 67, 0.15); }
.os-track .is-current:not(.is-done) .os-dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sage); }
.os-track-label { font-size: 13px; line-height: 1.3; color: var(--stone); max-width: 110px; }
.os-track .is-done .os-track-label, .os-track .is-current .os-track-label { color: var(--charcoal); font-weight: 600; }
.os-card--problem .os-track .is-current:not(.is-done) .os-dot { border-color: var(--champagne); box-shadow: 0 0 0 4px rgba(168, 123, 69, 0.18); }
.os-card--problem .os-track .is-current:not(.is-done) .os-dot::after { background: var(--champagne); }
@media (max-width: 420px) { .os-track-label { font-size: 12px; } }

.os-status-line { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 500; }
.os-live { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
.os-live strong { color: var(--charcoal); font-weight: 600; }
.os-todo {
  margin: var(--space-md) 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(43, 90, 67, 0.06);
  border: 1px solid rgba(43, 90, 67, 0.14);
}
.os-card--problem .os-todo { background: rgba(168, 123, 69, 0.09); border-color: rgba(168, 123, 69, 0.3); }
.os-todo-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage); margin-bottom: 2px; }
.os-card--problem .os-todo-label { color: #7A5528; }
.os-todo p { margin: 0; font-size: 15px; line-height: 1.5; }
.os-todo a, .os-card a:not(.os-btn) { color: var(--charcoal); text-decoration: underline; text-decoration-color: var(--champagne); text-underline-offset: 3px; }

.os-tracking {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px var(--space-md);
  margin: var(--space-md) 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--cream);
  border: 1px solid var(--line);
}
.os-k { display: block; font-size: 12.5px; color: var(--stone); font-weight: 500; }
.os-mono { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 600; letter-spacing: 0.04em; word-break: break-all; }
.os-tracking-none { margin: var(--space-md) 0 0; font-size: 14px; color: var(--muted); }

.os-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--green); color: #fff;
  border: 1.5px solid var(--green);
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-align: center;
  transition: background var(--t-fast) ease-out, border-color var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.os-btn:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.os-btn svg { width: 16px; height: 16px; flex: none; }
.os-btn--ghost { background: transparent; color: var(--charcoal); border-color: #CFC8BA; }
.os-btn--ghost:hover { background: #fff; color: var(--charcoal); border-color: var(--green); }
@media (max-width: 520px) {
  .os-tracking { flex-direction: column; align-items: stretch; }
  .os-tracking .os-btn { width: 100%; }
}

.os-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px var(--space-lg);
  margin: var(--space-md) 0 0;
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--neutral-light);
}
.os-facts div { min-width: 0; }
.os-facts dt { font-size: 12.5px; color: var(--stone); font-weight: 500; }
.os-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.45; }
.os-facts .os-wide { grid-column: 1 / -1; }
.os-facts small { display: block; color: var(--muted); font-size: 13.5px; }
@media (max-width: 420px) { .os-facts { grid-template-columns: 1fr; } }

/* Subscription card */
.os-sub { background: var(--paper-2); }
.os-sub h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.os-sub-next { margin: var(--space-md) 0 0; }
.os-sub-date { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.os-sub p { margin: var(--space-sm) 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.os-sub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-md); }
@media (max-width: 520px) { .os-sub-actions .os-btn { width: 100%; } }

/* Messages (not found, busy, offline) */
.os-message h2 { margin: 0 0 var(--space-sm); font-size: 22px; line-height: 1.3; }
.os-message p { margin: 0 0 var(--space-sm); line-height: 1.55; }
.os-message ul { margin: 0 0 var(--space-sm); padding-left: 20px; line-height: 1.55; }
.os-message li + li { margin-top: 4px; }
.os-message p:last-child { margin-bottom: 0; }

/* Loading placeholder */
.os-skeleton { display: grid; gap: 14px; }
.os-skeleton span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--neutral-light), var(--paper-2), var(--neutral-light)); background-size: 200% 100%; animation: os-shimmer 1.4s ease-in-out infinite; }
.os-skeleton span:nth-child(1) { width: 40%; height: 20px; }
.os-skeleton span:nth-child(2) { width: 100%; height: 44px; border-radius: 12px; }
.os-skeleton span:nth-child(3) { width: 75%; }
.os-skeleton span:nth-child(4) { width: 55%; }
@keyframes os-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .os-skeleton span, .os-submit .os-spinner { animation-duration: 3s; }
}

/* ---- What happens after you order ---- */
.os-section { padding: var(--space-2xl) 0; }
.os-section h2 { margin: 0 0 var(--space-lg); font-size: 32px; line-height: 1.15; }
.os-after { background: var(--neutral-light); }
.os-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md);
  counter-reset: os-step;
}
.os-steps li {
  counter-increment: os-step;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.os-steps li::before {
  content: counter(os-step);
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-bottom: 10px;
  border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 600;
}
.os-steps h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
.os-steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
@media (max-width: 640px) {
  .os-section { padding: var(--space-xl) 0; }
  .os-section h2 { font-size: 26px; }
  .os-steps { grid-template-columns: 1fr; }
}

/* ---- Help ---- */
.os-faq { border-top: 1px solid var(--line); }
.os-faq details { border-bottom: 1px solid var(--line); }
.os-faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md);
  padding: 18px 0;
  font-size: 17px; font-weight: 500;
  cursor: pointer; list-style: none;
}
.os-faq summary::-webkit-details-marker { display: none; }
.os-faq summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 300; line-height: 1; color: var(--champagne); transition: transform var(--t-med) ease-out; }
.os-faq details[open] summary::after { transform: rotate(45deg); }
.os-faq summary:hover { color: var(--sage); }
.os-faq [data-faq-answer] { padding: 0 0 18px; }
.os-faq [data-faq-answer] p { margin: 0; max-width: 680px; color: #4a5160; line-height: 1.6; }
.os-faq [data-faq-answer] p + p { margin-top: 10px; }
.os-faq a, .os-help-note a { color: var(--charcoal); text-decoration: underline; text-decoration-color: var(--champagne); text-underline-offset: 3px; }
.os-help-note { margin: var(--space-lg) 0 0; color: var(--muted); }
