:root {
  --bg: #f2efe8;
  --bg-2: #e4f0e8;
  --card: rgba(255, 255, 255, 0.78);
  --ink: #1f2630;
  --muted: #5c6b6e;
  --accent: #c54f20;
  --accent-2: #1a7a69;
  --line: rgba(31, 38, 48, 0.12);
  --shadow: 0 18px 40px rgba(22, 31, 38, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #ffd2a8 0%, transparent 35%),
    radial-gradient(circle at 88% 10%, #b7eedf 0%, transparent 28%),
    linear-gradient(170deg, var(--bg), var(--bg-2));
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
}

.layout {
  width: min(1120px, 94vw);
  margin: 30px auto 42px;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.tracking-layout {
  width: min(980px, 94vw);
  margin: 32px auto 48px;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.hero {
  padding: 18px 4px 6px;
  animation: fade-in 420ms ease-out;
}

.tracking-hero {
  padding: 18px 4px 6px;
  animation: fade-in 420ms ease-out;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
}

h1 {
  margin: 0.3rem 0 0.5rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
}

.hero p:last-child {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  animation: slide-up 360ms ease both;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.ghost-link {
  color: var(--accent-2);
  text-decoration: none;
  border: 1px solid rgba(26, 122, 105, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full-row {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
  color: #28353c;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd6d8;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.87rem;
}

.inline {
  align-content: end;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 10px;
}

.inline input {
  width: auto;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  color: white;
  background: linear-gradient(90deg, var(--accent), #e0762f);
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.ghost-btn {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid rgba(26, 122, 105, 0.35);
}

.status-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 10px;
  border: 1px solid #d0dadc;
  background: rgba(246, 251, 250, 0.92);
  padding: 12px;
  min-height: 92px;
  font-size: 0.85rem;
  line-height: 1.45;
  font-family: "IBM Plex Mono", monospace;
}

.tracking-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.tracking-summary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.tracking-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
}

.tracking-summary-card h2 {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.tracking-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

.tracking-status-idle,
.status-shipment-created {
  background: #fef3c7;
  color: #92400e;
}

.status-picked-up,
.status-in-transit {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-out-for-delivery {
  background: #e0f2fe;
  color: #0369a1;
}

.status-delivered {
  background: #dcfce7;
  color: #166534;
}

.tracking-status-error,
.status-delivery-issue {
  background: #fee2e2;
  color: #991b1b;
}

.tracking-meta {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tracking-meta div {
  border: 1px solid rgba(31, 38, 48, 0.08);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.tracking-meta span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.tracking-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.tracking-event {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.tracking-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  margin-top: 7px;
  box-shadow: 0 0 0 6px rgba(26, 122, 105, 0.1);
}

.tracking-event p,
.tracking-empty {
  margin: 4px 0;
  color: var(--muted);
}

.tracking-event time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: #4b5563;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tracking-search-form,
  .tracking-meta {
    grid-template-columns: 1fr;
  }

  .tracking-summary-head {
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    width: 100%;
  }
}
