/* ==========================================================================
   KR Worldwide Express — Track pages (search + result)
   Shares the home9 design language.
   ========================================================================== */

:root {
  --ink: #12232e;
  --ink-2: #0d1b23;
  --ink-soft: #4a6272;
  --teal: #1ea3c9;
  --teal-dark: #16829f;
  --teal-soft: #e3f4f9;
  --yellow: #f7b91d;
  --yellow-soft: #fdf3d7;
  --bg: #f5f8fa;
  --card: #ffffff;
  --line: #e3ecf1;
  --muted: #5d7482;
  --ok: #1d9a6c;
  --danger: #d64545;
  --radius: 20px;
  --shadow-sm: 0 2px 8px rgba(18, 35, 46, .06);
  --shadow-md: 0 14px 34px -14px rgba(18, 35, 46, .18);
  --shadow-lg: 0 30px 60px -24px rgba(18, 35, 46, .28);
  --font-head: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.015em; }
.container { width: min(1080px, 92%); margin-inline: auto; }
main { flex: 1; }
::selection { background: var(--yellow); color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
}
.brand img { height: 44px; width: auto; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-right a { font-weight: 600; font-size: 14.5px; color: var(--ink-soft); padding: 9px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.nav-right a:hover { background: var(--teal-soft); color: var(--ink); }
.nav-right a.active { background: var(--teal-soft); color: var(--teal-dark); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap;
}
.button svg { width: 18px; height: 18px; }
.button-ink { background: var(--ink); color: #fff; box-shadow: var(--shadow-md); }
.button-ink:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.button-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 12px 26px -10px rgba(247, 185, 29, .55); }
.button-yellow:hover { transform: translateY(-2px); }

/* ---------- track hero ---------- */
.track-hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.track-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 300px at 85% 0%, rgba(30, 163, 201, .15), transparent 65%),
    radial-gradient(480px 280px at 6% 100%, rgba(247, 185, 29, .12), transparent 60%),
    radial-gradient(#d8e5ec 1.1px, transparent 1.1px);
  background-size: auto, auto, 26px 26px;
  opacity: .8;
  pointer-events: none;
}
.track-hero-inner { position: relative; max-width: 720px; margin-inline: auto; text-align: center; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 14px;
}
.kicker::before, .kicker::after { content: ""; width: 22px; height: 2px; background: var(--yellow); border-radius: 2px; }
.track-hero h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; }
.track-hero .sub { margin: 14px auto 0; color: var(--muted); font-size: 16.5px; max-width: 56ch; }

/* ---------- search card ---------- */
.search-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: 26px;
  margin: 36px auto 0;
  max-width: 760px;
}
.track-form { display: flex; gap: 12px; align-items: stretch; }
.track-form textarea {
  flex: 1;
  min-height: 58px;
  max-height: 130px;
  resize: none;
  padding: 15px 20px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  outline: none;
  font-size: 15.5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.track-form textarea:focus {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(30, 163, 201, .14);
}
.track-form textarea::placeholder { color: #93a9b5; }
.track-hint { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 7px; }
.track-hint svg { width: 14px; height: 14px; color: var(--yellow); flex: none; }

/* ---------- alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 760px;
  margin: 22px auto 0;
  padding: 15px 20px;
  border-radius: 16px;
  font-size: 14.5px;
  border: 1px solid;
}
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }
.alert-danger { background: #fdf0f0; border-color: #f3cfcf; color: #9c3535; }
.alert-danger a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.alert-info { background: var(--teal-soft); border-color: #c9e7f1; color: #136c84; }

/* ---------- results ---------- */
.results { padding: 44px 0 84px; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto 20px;
}
.results-head h2 { font-size: 21px; }
.results-head span { font-size: 13.5px; color: var(--muted); font-weight: 600; }

.shipment-card {
  max-width: 860px;
  margin: 0 auto 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 28px;
  background: linear-gradient(120deg, var(--ink) 0%, #1b3a4b 100%);
  color: #fff;
}
.sc-head .label { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; font-weight: 600; }
.sc-head .number { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 13.5px;
  font-weight: 600;
}
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.7s ease infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 185, 29, .5); }
  60% { box-shadow: 0 0 0 6px rgba(247, 185, 29, 0); }
}

.sc-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.sc-meta > div { padding: 16px 24px; border-right: 1px solid var(--line); }
.sc-meta > div:nth-child(3n) { border-right: none; }
.sc-meta small {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.sc-meta small svg { width: 13px; height: 13px; color: var(--teal-dark); }
.sc-meta strong { font-size: 14.8px; font-weight: 600; color: var(--ink); word-break: break-word; }

.sc-section { padding: 20px 28px; }
.sc-section + .sc-section { border-top: 1px solid var(--line); }
.sc-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.sc-section h3 svg { width: 16px; height: 16px; color: var(--teal-dark); }

/* forwarding links */
.forward-links { display: flex; flex-wrap: wrap; gap: 10px; }
.forward-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--teal-soft);
  border: 1px solid #c9e7f1;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--teal-dark);
  transition: transform .2s, box-shadow .2s;
}
.forward-links a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.forward-links a svg { width: 15px; height: 15px; }

/* timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item { position: relative; padding: 0 0 18px 14px; }
.timeline-item:last-child { padding-bottom: 2px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px; top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3.5px solid var(--teal);
}
.timeline-item.latest::before { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 0 4px rgba(29,154,108,.16); }
.timeline-item .tl-when { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.timeline-item .tl-when time + time { margin-left: 6px; }
.timeline-item .tl-status { font-size: 15px; font-weight: 600; color: var(--ink); }
.timeline-item.latest .tl-status { color: var(--ok); }

/* ---------- footer ---------- */
.footer { background: var(--ink-2); color: #c2d2dc; padding: 34px 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.footer-inner a { color: #fff; font-weight: 600; }
.footer-inner a:hover { color: var(--yellow); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .track-hero { padding: 48px 0 28px; }
  .track-form { flex-direction: column; }
  .track-form .button { width: 100%; }
  .sc-meta { grid-template-columns: 1fr 1fr; }
  .sc-meta > div { border-right: none; border-bottom: 1px solid var(--line); }
  .sc-meta > div:nth-last-child(-n+2) { border-bottom: none; }
  .sc-head, .sc-section { padding-inline: 20px; }
  .search-card { padding: 18px; }
  .nav-right a:not(.button) { display: none; }
}
