:root {
  --navy-950: #07182b;
  --navy-900: #102b4e;
  --navy-800: #173d6c;
  --navy-700: #23558f;
  --blue-100: #e9f2fb;
  --yellow: #ffd200;
  --yellow-dark: #d8ad00;
  --ink: #172235;
  --muted: #68768a;
  --line: #dce4ed;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --success: #16845b;
  --danger: #bd3e3e;
  --shadow: 0 24px 60px rgba(16, 43, 78, 0.11);
  --radius-lg: 28px;
  --radius-md: 18px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 210, 0, 0.11), transparent 23rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 43, 78, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy-900);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 35px;
  height: 30px;
  display: inline-block;
}

.brand-mark span {
  position: absolute;
  left: 0;
  width: 30px;
  height: 10px;
  border-radius: 2px 8px 8px 2px;
  background: var(--yellow);
  transform: skewX(-28deg);
}

.brand-mark span:first-child {
  top: 3px;
}

.brand-mark span:last-child {
  right: 0;
  bottom: 3px;
  left: auto;
  background: var(--navy-700);
}

.brand-name {
  font-size: 1.13rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.header-label {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--muted);
}

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  min-height: 560px;
  padding: 72px 0 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: 72px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--yellow);
}

h1 {
  max-width: 680px;
  margin: 17px 0 17px;
  color: var(--navy-950);
  font-size: clamp(2.6rem, 5.1vw, 4.8rem);
  line-height: 0.99;
  letter-spacing: -0.052em;
}

.hero-text {
  max-width: 610px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.65;
}

.tracking-form {
  max-width: 720px;
  padding: 24px;
  border: 1px solid rgba(16, 43, 78, 0.09);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(16, 43, 78, 0.08);
  backdrop-filter: blur(14px);
}

.tracking-form > label {
  display: block;
  margin-bottom: 9px;
  color: var(--navy-900);
  font-size: 0.79rem;
  font-weight: 750;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 20px;
  fill: none;
  stroke: var(--navy-700);
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 48px;
  border: 1px solid #cbd7e4;
  border-radius: 12px;
  outline: none;
  color: var(--navy-950);
  background: #fbfdff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #9aa8b8;
  font-weight: 550;
}

input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 4px rgba(35, 85, 143, 0.12);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

#submit-button {
  height: 54px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--navy-900);
  border-radius: 12px;
  color: #fff;
  background: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#submit-button:hover {
  background: var(--navy-800);
  box-shadow: 0 10px 20px rgba(16, 43, 78, 0.18);
  transform: translateY(-1px);
}

#submit-button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

#submit-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.form-help,
.form-error {
  margin: 9px 0 0;
  font-size: 0.76rem;
}

.form-help {
  color: #7c8999;
}

.form-error {
  min-height: 1em;
  color: var(--danger);
  font-weight: 600;
}

.hero-visual {
  position: relative;
  min-height: 390px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 24px 4px 16px 28px;
  border-radius: 48% 52% 46% 54%;
  background: linear-gradient(145deg, #e9f1f8, #dbe8f3);
  transform: rotate(-5deg);
}

.parcel-card {
  position: absolute;
  top: 42px;
  left: 50%;
  width: 280px;
  min-height: 320px;
  padding: 21px;
  border: 1px solid rgba(16, 43, 78, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  transform: translateX(-50%) rotate(2.5deg);
}

.parcel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-brand {
  color: var(--navy-900);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.barcode {
  width: 56px;
  height: 18px;
  opacity: 0.7;
  background: repeating-linear-gradient(90deg, var(--navy-950) 0 1px, transparent 1px 3px);
}

.parcel-box {
  height: 180px;
  margin: 21px 0 14px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #fff7c9, #ffe66d);
}

.parcel-box svg {
  width: 105px;
  fill: #f6c923;
  stroke: var(--navy-900);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.parcel-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.parcel-status small,
.parcel-status strong {
  display: block;
}

.parcel-status small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.parcel-status strong {
  color: var(--navy-900);
  font-size: 0.84rem;
}

.pulse-dot {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--success);
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}

.route-line {
  position: absolute;
  z-index: 2;
  width: 85px;
  height: 54px;
  border-top: 2px dashed rgba(35, 85, 143, 0.45);
  border-radius: 50%;
}

.route-one {
  top: 64px;
  left: 4px;
  transform: rotate(25deg);
}

.route-two {
  right: -4px;
  bottom: 52px;
  transform: rotate(205deg);
}

.route-dot {
  position: absolute;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 3px solid var(--canvas);
  border-radius: 50%;
  background: var(--navy-700);
  box-shadow: 0 0 0 1px var(--navy-700);
}

.dot-one {
  top: 42px;
  left: 17px;
}

.dot-two {
  top: 105px;
  left: 94px;
  background: var(--yellow);
  box-shadow: 0 0 0 1px var(--yellow-dark);
}

.dot-three {
  right: 13px;
  bottom: 47px;
}

.state-section {
  padding: 8px 0 72px;
}

.loading-card,
.error-state {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(16, 43, 78, 0.07);
}

.loading-card strong {
  color: var(--navy-900);
}

.loading-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.loader {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 3px solid var(--blue-100);
  border-top-color: var(--navy-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-state {
  align-items: flex-start;
}

.message-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--danger);
  background: #fff0f0;
}

.message-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.error-state h2 {
  margin: 2px 0 7px;
  color: var(--navy-950);
  font-size: 1.25rem;
}

.error-state p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.error-state a,
.official-note a {
  color: var(--navy-700);
  font-weight: 700;
  text-underline-offset: 3px;
}

.result-state {
  display: grid;
  gap: 20px;
}

.result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.result-heading h2 {
  margin: 8px 0 0;
  color: var(--navy-950);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.new-search {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--navy-700);
  color: var(--navy-700);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 700;
}

.status-card,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 43, 78, 0.07);
}

.status-card {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: 32px;
}

.status-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--success);
}

.status-icon.in-transit {
  background: var(--navy-700);
}

.status-icon svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-main h3 {
  margin: 5px 0;
  color: var(--navy-950);
  font-size: clamp(1.2rem, 2.3vw, 1.65rem);
  letter-spacing: -0.02em;
}

.status-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.status-meta {
  margin: 0;
  padding-left: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  border-left: 1px solid var(--line);
}

.status-meta div {
  min-width: 0;
}

.status-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.status-meta dd {
  margin: 0;
  color: var(--navy-900);
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.status-meta dd:has(.copy-button) {
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-button {
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  color: var(--navy-700);
  background: transparent;
}

.copy-button:hover {
  background: var(--blue-100);
}

.copy-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.timeline-card {
  padding: 30px;
}

.timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.timeline-title h3 {
  margin: 7px 0 0;
  color: var(--navy-950);
  font-size: 1.35rem;
}

.event-count {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--navy-700);
  background: var(--blue-100);
  font-size: 0.72rem;
  font-weight: 750;
}

.timeline {
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}

.timeline li {
  position: relative;
  min-height: 104px;
  padding: 22px 0 14px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}

.timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 44px;
  bottom: -22px;
  left: 10px;
  width: 1px;
  background: #ccd8e5;
}

.timeline-dot {
  position: absolute;
  top: 27px;
  left: 3px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: #9cadbe;
  box-shadow: 0 0 0 1px #9cadbe;
}

.timeline li:first-child .timeline-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 210, 0, 0.35);
}

.event-copy strong {
  display: block;
  color: var(--navy-950);
  font-size: 0.97rem;
}

.event-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.event-date {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
}

.official-note {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d4e1ed;
  border-radius: 14px;
  color: var(--muted);
  background: #edf4fa;
  font-size: 0.78rem;
}

.official-note > span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--navy-700);
  font-family: Georgia, serif;
  font-weight: 700;
}

.official-note p {
  margin: 0;
}

footer {
  width: min(1180px, calc(100% - 48px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(16, 43, 78, 0.1);
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 0.8; transform: scale(0.75); }
  100% { opacity: 0; transform: scale(1.6); }
}

@media (max-width: 960px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-visual {
    display: none;
  }

  .status-card {
    grid-template-columns: 1fr;
  }

  .status-meta {
    padding: 24px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    height: 72px;
  }

  .header-label {
    display: none;
  }

  .hero {
    padding: 48px 0 38px;
  }

  h1 {
    font-size: clamp(2.55rem, 13vw, 3.5rem);
  }

  .hero-text {
    margin-bottom: 26px;
  }

  .tracking-form {
    padding: 17px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  #submit-button {
    width: 100%;
  }

  .state-section {
    padding-bottom: 48px;
  }

  .loading-card,
  .error-state {
    padding: 20px;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-card,
  .timeline-card {
    padding: 21px;
    border-radius: 20px;
  }

  .status-main {
    align-items: flex-start;
  }

  .status-meta {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .timeline-title {
    align-items: flex-start;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-right: 0;
  }

  .event-date {
    white-space: normal;
  }

  footer {
    padding: 23px 0;
    align-items: flex-start;
    flex-direction: column;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
