/* AStrack — AutoScanner Logistics public tracking site */
:root {
  --brand: #5d6be0;
  --brand2: #6c64d6;
  --brand-light: #7ca5f5;
  --brand-dark: #4a55c4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e9f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { height: 48px; width: auto; display: block; transition: transform .25s; }
.brand:hover .brand-logo { transform: scale(1.04); }
.brand img.mark { width: 38px; height: 38px; }
.brand b { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: -3px; }
.footer-logo { background: #fff; padding: 10px 16px; border-radius: 12px; display: inline-block; margin-bottom: 16px; }
.footer-logo img { height: 40px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 14.5px; font-weight: 600; color: #475569; transition: color .15s; }
.nav-links a:hover { color: var(--brand); }
.nav-cta {
  background: linear-gradient(120deg, var(--brand), var(--brand2));
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700 !important;
  box-shadow: 0 8px 18px rgba(93, 107, 224, .32);
}
.nav-cta:hover { color: #fff !important; filter: brightness(1.05); }
.nav-burger { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4a55c4 0%, #5d6be0 45%, #7ca5f5 100%);
  background-size: 180% 180%;
  animation: heroShift 16s ease infinite;
  color: #fff;
  padding: 60px 0 84px;
}
@keyframes heroShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .25;
}
.hero::before { width: 420px; height: 420px; background: #9db8f8; top: -160px; right: -120px; animation: floatA 11s ease-in-out infinite; }
.hero::after { width: 320px; height: 320px; background: #8b86e8; bottom: -140px; left: -100px; animation: floatB 13s ease-in-out infinite; }
@keyframes floatA { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-26px, 30px); } }
@keyframes floatB { 0%,100% { transform: translate(0,0); } 50% { transform: translate(24px, -28px); } }
.hero-watermark {
  position: absolute; right: -30px; bottom: -50px; width: 360px; max-width: 45%;
  opacity: .07; z-index: 1; pointer-events: none;
  animation: floatA 14s ease-in-out infinite;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 14px; font-weight: 800; letter-spacing: -1px; }
.hero p.sub { font-size: 17px; opacity: .92; margin: 0 auto 32px; max-width: 560px; }

/* Search box */
.track-form {
  display: flex; gap: 10px;
  background: #fff;
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  max-width: 620px; margin: 0 auto;
}
.track-form input {
  flex: 1; border: 0; outline: 0;
  font-size: 16px; padding: 0 16px;
  color: var(--ink);
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: .5px;
  background: transparent;
}
.track-form input::placeholder { font-family: Inter, sans-serif; letter-spacing: 0; color: #94a3b8; }
.track-form button {
  border: 0; cursor: pointer;
  background: linear-gradient(120deg, var(--brand), var(--brand2));
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 14px 26px; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s, filter .15s;
}
.track-form button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.track-form button:disabled { opacity: .65; cursor: progress; }
.hero .hint { margin-top: 14px; font-size: 12.5px; opacity: .8; }

/* ---------- Result card ---------- */
.result-wrap { max-width: 720px; margin: -56px auto 0; position: relative; z-index: 5; padding: 0 20px; }
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  animation: rise .5s ease both;
}
.result-card + .result-card { margin-top: 18px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.rc-carrier { font-weight: 700; font-size: 13.5px; color: var(--brand); display: flex; align-items: center; gap: 7px; }
.rc-carrier img { width: 20px; height: 20px; }
.rc-number { margin-top: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 19px; letter-spacing: .5px; }
.rc-status {
  font-size: 12px; font-weight: 800; padding: 6px 14px; border-radius: 999px;
  background: #eef2ff; color: var(--brand); white-space: nowrap;
}
.rc-status.s-delivered { background: #dcfce7; color: var(--ok); }
.rc-status.s-out_for_delivery { background: #fef3c7; color: var(--warn); }
.rc-status.s-exception { background: #fee2e2; color: var(--err); }

.rc-hero { margin: 22px 0 26px; }
.rc-hero-status { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.rc-eta { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.rc-eta strong { color: var(--ink); }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; }
.steps li {
  flex: 1; text-align: center; font-size: 11.5px; color: var(--muted);
  position: relative; padding-top: 30px; font-weight: 600;
}
.steps li::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; z-index: 2; transition: .3s;
}
.steps li::after {
  content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: #cbd5e1; z-index: 1;
}
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.steps li.done::after { background: var(--ok); }
.steps li.current::before { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 100% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } }

.rc-note { margin: 18px 0 0; font-size: 13.5px; color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; padding: 12px 14px; border-radius: 12px; }
.rc-empty { text-align: center; padding: 14px 0; }
.rc-empty h2 { margin: 0 0 8px; font-size: 19px; }
.rc-empty p { margin: 0 0 12px; color: var(--muted); }
.rc-empty .rc-number { display: inline-block; background: #f1f5f9; padding: 8px 16px; border-radius: 10px; }

/* timeline */
.tl-title { margin: 0 0 16px; font-size: 16px; }
.tl-row { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.tl-row::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: #e2e8f0; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: #cbd5e1; margin-top: 3px; flex: none; z-index: 1; }
.tl-row.latest .tl-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(93, 107, 224, .18); }
.tl-body strong { font-size: 14px; display: block; }
.tl-body span { font-size: 12px; color: var(--muted); }

.spinner { width: 26px; height: 26px; border: 3px solid #e2e8f0; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.rc-loading { text-align: center; color: var(--muted); padding: 10px 0; }

/* ---------- Sections ---------- */
section.block { padding: 64px 0; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 42px; }
.section-head .tag { color: var(--brand); font-weight: 800; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.section-head h2 { font-size: clamp(24px, 4vw, 34px); margin: 8px 0 12px; letter-spacing: -.6px; }
.section-head p { color: var(--muted); margin: 0; font-size: 16px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .18s, box-shadow .18s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #eaf1ff, #efeefb); margin-bottom: 16px; font-size: 24px;
}
.feature h3 { margin: 0 0 8px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* steps how */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.how .step { position: relative; padding: 28px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.how .step::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: -18px; left: 24px;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(120deg, var(--brand), var(--brand2)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  box-shadow: 0 8px 18px rgba(93, 107, 224, .35);
}
.how .step h3 { margin: 14px 0 8px; font-size: 17px; }
.how .step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* carriers strip */
.carriers { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.carriers .wrap { padding-top: 40px; padding-bottom: 40px; }
.carriers .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; }
.carrier-chip {
  font-weight: 700; color: #475569; font-size: 15px;
  background: #f1f5f9; padding: 10px 20px; border-radius: 12px;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 20px; margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; font-size: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--brand); font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, #4a55c4, #6c64d6); color: #fff; border-radius: 24px; padding: 54px 40px; text-align: center; }
.cta-band h2 { font-size: clamp(24px, 4vw, 32px); margin: 0 0 10px; }
.cta-band p { opacity: .9; margin: 0 0 24px; font-size: 16px; }
.cta-band a {
  display: inline-block; background: #fff; color: var(--brand) !important;
  padding: 13px 30px; border-radius: 999px; font-weight: 800; font-size: 15px;
}

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 56px 0 28px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; }
.footer-grid .brand b { color: #fff; }
.footer-grid p { font-size: 14px; color: #94a3b8; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 14px; letter-spacing: .3px; }
.footer-col a { display: block; font-size: 14px; color: #94a3b8; margin-bottom: 10px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 36px; padding-top: 22px; font-size: 13px; color: #64748b; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Legal pages ---------- */
.legal-hero { background: linear-gradient(135deg, #4a55c4, #5d6be0, #7ca5f5); color: #fff; padding: 48px 0 56px; text-align: center; }
.legal-hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 36px); }
.legal-hero p { margin: 0; opacity: .85; font-size: 14px; }
.legal { max-width: 820px; margin: 0 auto; padding: 48px 20px 0; }
.legal h2 { font-size: 20px; margin: 32px 0 10px; letter-spacing: -.3px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: #475569; font-size: 15px; line-height: 1.75; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--brand); font-weight: 600; }

/* ---------- Standalone track page ---------- */
.track-page-hero { background: linear-gradient(135deg, #4a55c4, #5d6be0, #7ca5f5); color: #fff; padding: 48px 0 80px; }
.track-page-hero h1 { text-align: center; font-size: clamp(26px, 4vw, 36px); margin: 0 0 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .feature-grid, .how, .footer-grid { grid-template-columns: 1fr; }
  .nav { height: 62px; }
  .brand-logo { height: 40px; }
  .nav-links { position: fixed; inset: 62px 0 auto 0; background: #fff; flex-direction: column; gap: 0; padding: 8px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links .nav-cta { text-align: center; margin-top: 12px; border: 0; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-burger { display: block; }
  .hero { padding: 48px 0 64px; }
  section.block { padding: 48px 0; }
  .track-form { flex-direction: column; padding: 12px; }
  .track-form input { padding: 10px 14px; text-align: center; }
  .track-form button { justify-content: center; width: 100%; padding: 14px; }
  .result-wrap { margin-top: -40px; padding: 0 16px; }
  .result-card { padding: 20px; }
  .rc-number { font-size: 16px; word-break: break-all; }
  .steps li { font-size: 10px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .cta-band { padding: 40px 22px; }
  .hero-watermark { max-width: 60%; opacity: .05; }
}

@media (max-width: 480px) {
  .brand-logo { height: 36px; }
  .hero h1 { font-size: 27px; }
  .hero p.sub { font-size: 15px; }
  .steps li span { font-size: 9.5px; }
}

/* ---------- Premium animations ---------- */
/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.16,.84,.44,1), transform .7s cubic-bezier(.16,.84,.44,1); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; }
.reveal.d4 { transition-delay: .28s; }
.reveal.d5 { transition-delay: .35s; }

/* Hero text intro */
.hero .eyebrow { animation: fadeDown .7s .05s ease both; }
.hero h1 { animation: fadeUp .7s .12s ease both; }
.hero p.sub { animation: fadeUp .7s .22s ease both; }
.hero .track-form { animation: fadeUp .7s .32s ease both; }
.hero .hint { animation: fadeUp .7s .42s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* Button shine sweep */
.track-form button, .nav-cta, .cta-band a { position: relative; overflow: hidden; }
.track-form button::after, .nav-cta::after, .cta-band a::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); transition: left .65s ease;
}
.track-form button:hover::after, .nav-cta:hover::after, .cta-band a:hover::after { left: 150%; }

/* Feature icon pop on hover */
.feature .ic { transition: transform .25s, box-shadow .25s; }
.feature:hover .ic { transform: translateY(-3px) rotate(-4deg); box-shadow: 0 10px 22px rgba(124,165,245,.32); }

/* Search input focus glow */
.track-form { transition: box-shadow .3s, transform .3s; }
.track-form:focus-within { box-shadow: 0 26px 70px rgba(108,100,214,.42); transform: translateY(-2px); }

/* Carrier chips subtle hover */
.carrier-chip { transition: transform .18s, background .18s, color .18s; }
.carrier-chip:hover { transform: translateY(-3px); background: #eef2ff; color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
