:root {
  --bg: #07090d;
  --bg-raise: #0d1118;
  --surface: rgba(255, 255, 255, 0.034);
  --border: rgba(255, 255, 255, 0.085);
  --border-bright: rgba(255, 255, 255, 0.16);
  --text: #eef2f7;
  --muted: #8b97a8;
  --dim: #5d6775;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.13);
  --green: #34d399;
  --radius: 16px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; letter-spacing: -0.028em; font-weight: 700; }

/* ---------- ambient background ---------- */

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
}

.glow--one {
  top: -22vh;
  left: 42%;
  width: 52vw;
  height: 52vw;
  background: rgba(245, 158, 11, 0.14);
}

.glow--two {
  bottom: -28vh;
  left: -14vw;
  width: 46vw;
  height: 46vw;
  background: rgba(56, 108, 189, 0.13);
}

/* ---------- nav ---------- */

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 28px;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand__mark {
  width: 11px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(170deg, var(--accent), #b45309);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55);
}

.brand__text {
  font-weight: 800;
  font-size: 1.04rem;
  letter-spacing: 0.17em;
}

.brand__text span { color: var(--muted); font-weight: 500; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav__links a:hover { color: var(--text); }

/* ---------- layout ---------- */

.shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 96px;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 28px 34px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--dim);
}

.footer__note { color: rgba(245, 158, 11, 0.6); }

/* ---------- shared bits ---------- */

.pill {
  display: inline-block;
  padding: 6px 13px;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn svg { width: 17px; height: 17px; }

.btn--primary {
  background: linear-gradient(165deg, #fbbf24, #e08c05);
  color: #1a1203;
  box-shadow: 0 12px 34px -12px rgba(245, 158, 11, 0.75);
}

.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(245, 158, 11, 0.85); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border-bright);
  color: var(--text);
}

.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }

.btn--sm { padding: 8px 15px; font-size: 0.84rem; }

.btn--full { width: 100%; }

.card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.card h3 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- hero ---------- */

.hero { padding: 54px 0 62px; max-width: 720px; }

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(2.9rem, 7.4vw, 5.1rem);
  font-weight: 800;
  line-height: 1.02;
}

.grad {
  background: linear-gradient(100deg, #fbbf24 10%, #f97316 55%, #a16207 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin: 0 0 34px;
  max-width: 560px;
  font-size: 1.07rem;
  color: var(--muted);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 13px; }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stat {
  padding: 34px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: background 0.2s ease;
}

.stat:hover { background: linear-gradient(180deg, rgba(245, 158, 11, 0.09), rgba(255, 255, 255, 0.015)); }

.stat__value {
  font-size: clamp(2.3rem, 4.6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  background: linear-gradient(170deg, #ffffff, #93a1b4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat__label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.stat__note { margin-top: 5px; font-size: 0.86rem; color: var(--dim); }

/* ---------- features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.features .card h3 {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  margin-bottom: 9px;
}

/* ---------- track form ---------- */

.track-panel { max-width: 620px; padding: 48px 0 40px; }

.track-panel h1 { margin: 20px 0 14px; font-size: clamp(2.2rem, 5.4vw, 3.3rem); }

.track-panel__sub { margin: 0 0 30px; color: var(--muted); }

.track-form { display: flex; gap: 11px; flex-wrap: wrap; }

.track-form__input {
  flex: 1;
  min-width: 240px;
  padding: 14px 18px;
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.track-form__input::placeholder { color: var(--dim); letter-spacing: 0.02em; }

.track-form__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-error { margin: 16px 0 0; color: #fca5a5; font-size: 0.9rem; }

.track-panel__hint { margin: 20px 0 0; font-size: 0.87rem; color: var(--dim); }

.track-panel__hint a { color: var(--accent); border-bottom: 1px dashed rgba(245, 158, 11, 0.45); }

/* ---------- quote form ---------- */

.quote-panel { max-width: 640px; padding: 48px 0 40px; }

.quote-panel h1 { margin: 20px 0 14px; font-size: clamp(2.2rem, 5.4vw, 3.3rem); }

.quote-panel__sub { margin: 0 0 32px; color: var(--muted); }

.quote-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.field { display: flex; flex-direction: column; gap: 7px; grid-column: 1 / -1; }

.field--half { grid-column: span 1; }

.field label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  padding: 12px 15px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder { color: var(--dim); }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Native dropdowns render light on dark backgrounds without this. Suppressing
   the native arrow means supplying our own, or the select reads as a text box. */
.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b97a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 13px;
}

.field select option { background: var(--bg-raise); color: var(--text); }

.quote-form .btn { grid-column: 1 / -1; margin-top: 4px; }

.quote-panel__hint { margin: 20px 0 0; font-size: 0.87rem; color: var(--dim); }

/* ---------- quote result ---------- */

.quote-total {
  margin-top: 12px;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(170deg, #ffffff, #93a1b4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result__grid--quote { grid-template-columns: 1.4fr 1fr; }

.breakdown dl { margin: 0; display: flex; flex-direction: column; }

.breakdown dl > div {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.breakdown dt { font-size: 0.93rem; color: var(--text); }

.breakdown dt span {
  display: block;
  margin-top: 2px;
  font-size: 0.79rem;
  color: var(--dim);
}

.breakdown dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.breakdown__total { border-bottom: none !important; padding-bottom: 0 !important; }

.breakdown__total dt { font-weight: 700; letter-spacing: 0.02em; }

.breakdown__total dd { font-size: 1.3rem; font-weight: 800; color: var(--accent); }

/* ---------- result ---------- */

.result { padding: 34px 0 20px; }

.result__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.result__id {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4.4vw, 2.5rem);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: -0.015em;
}

.result__detail { margin: 16px 0 26px; max-width: 620px; color: var(--muted); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 600;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.1s ease-in-out infinite;
}

.status--delivery .status__dot { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16); }
.status--terminal .status__dot, .status--loading .status__dot { animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b45309, #fbbf24);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

.progress__legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  font-size: 0.82rem;
  color: var(--dim);
}

.progress__pct { color: var(--accent); font-weight: 600; }

.result__grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-top: 30px;
}

.map-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.map-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 22px 14px;
}

.map-card__head h3 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.map-card__head span { font-size: 0.97rem; font-weight: 600; color: var(--text); }

/* Grows to fill whatever height the sidebar column sets, so the card never
   ends up with dead space under the map. */
#map {
  flex: 1;
  min-height: 330px;
  background: #0b0f14;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.map--offline {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.9rem;
}

.map-card__foot { padding: 13px 22px; font-size: 0.8rem; color: var(--dim); }

.side { display: flex; flex-direction: column; gap: 16px; }

.driver__row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

.driver__avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.26), rgba(245, 158, 11, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.32);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

.driver__name { font-weight: 600; font-size: 1.04rem; }

.driver__truck { font-size: 0.85rem; color: var(--dim); }

.facts dl { margin: 0; display: flex; flex-direction: column; }

.facts dl > div {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.facts dl > div:last-child { border-bottom: none; padding-bottom: 0; }

.facts dt { font-size: 0.86rem; color: var(--dim); }

.facts dd { margin: 0; font-size: 0.89rem; font-weight: 600; text-align: right; }

.back {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.89rem;
  color: var(--muted);
}

.back:hover { color: var(--accent); }

/* ---------- leaflet overrides ---------- */

.leaflet-container { background: #0b0f14; font-family: inherit; }

.leaflet-control-attribution {
  background: rgba(7, 9, 13, 0.72) !important;
  color: var(--dim) !important;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-top-left-radius: 6px;
}

.leaflet-control-attribution a { color: var(--dim) !important; }

.leaflet-attribution-flag { display: none !important; }

.map-tip {
  background: rgba(13, 17, 24, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
  padding: 4px 9px;
}

.map-tip::before { display: none; }

.leaflet-control-zoom a {
  background: #11161e;
  border-color: var(--border);
  color: var(--text);
}

.leaflet-control-zoom a:hover { background: #1a212c; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .stats, .features { grid-template-columns: 1fr; }
  .result__grid, .result__grid--quote { grid-template-columns: 1fr; }
  .stats { border-radius: var(--radius); }
}

@media (max-width: 620px) {
  .quote-form { grid-template-columns: 1fr; }
  .field--half { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .nav { padding: 20px 18px; }
  .shell { padding: 24px 18px 72px; }
  .footer { padding: 22px 18px 28px; }
  .nav__links { gap: 16px; }
  .hero { padding: 32px 0 44px; }
}
