/* Та же светлая тема и шкала Geist, что у ofbyapp.app (driverapp/legal/site.css). */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e5e5;
  --text: #0a0a0a;
  --muted: #737373;
  --soft: #f4f4f4;
  --contrast: #0a0a0a;
  --on-contrast: #ffffff;
  --radius: 16px;
  --radius-btn: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hero {
  font-size: 32px;
  font-weight: 600;
  line-height: 36px;
  letter-spacing: -0.8px;
}

.heading {
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: -0.4px;
}

.title {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: -0.2px;
}

.body {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.caption {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--muted);
}

.small {
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  color: var(--muted);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  min-width: 200px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  background: var(--contrast);
  color: var(--on-contrast);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
  text-decoration: none;
}

.cta-row {
  display: flex;
  justify-content: center;
}

.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.landing main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
  text-align: center;
}

/* Лого — белая плашка со скруглением, как иконка в шапке dash. */
.logo {
  width: 96px;
  height: 96px;
  display: block;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.landing h1 {
  margin: 32px 0 0;
  max-width: 440px;
}

.landing .tag {
  margin: 10px 0 0;
  max-width: 400px;
}

.landing .sub {
  margin: 12px 0 0;
  max-width: 420px;
}

.landing .cta {
  margin-top: 36px;
}

.mail {
  margin-top: 14px;
  text-decoration: none;
}

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

/* Поле номера на freightrace.net, кнопка под ним на всю ширину. Моторика короткая:
   ease-out, 150–200 мс, нажатие — лёгкое сжатие. */
.track-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 32px;
}

.track-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--card);
  color: var(--text);
  font: 500 20px/1 "Geist", sans-serif;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.track-input::placeholder {
  color: #a3a3a3;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.2px;
}

.track-input:hover { border-color: #d4d4d4; }

.track-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.06);
}

.is-error .track-input {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.track-input.is-shake { animation: track-shake 0.32s ease-out; }

@keyframes track-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.track-btn {
  position: relative;
  width: 100%;
  height: 56px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s ease-out, transform 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.track-btn:hover:not(:disabled) { opacity: 0.88; }
.track-btn:active:not(:disabled) { transform: scale(0.98); }
.track-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.track-btn:disabled { opacity: 0.25; cursor: default; }

/* Во время поиска кнопка не бледнеет — вместо подписи крутится спиннер. */
.is-busy .track-btn:disabled { opacity: 1; }
.is-busy .track-btn-label { opacity: 0; }

.track-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--on-contrast);
  border-radius: 50%;
  opacity: 0;
  animation: track-spin 0.7s linear infinite;
}

.is-busy .track-spinner { opacity: 1; }

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

.track-msg {
  min-height: 18px;
  margin: 2px 0 0;
}

.is-error .track-msg { color: #dc2626; }

@media (prefers-reduced-motion: reduce) {
  .track-input.is-shake { animation: none; }
  .track-btn:active:not(:disabled) { transform: none; }
}

.landing footer {
  padding: 8px 24px 28px;
  text-align: center;
}

/* ── tracking ── */
.tracking {
  height: 100dvh;
  overflow: hidden;
}

.trk-map {
  position: fixed;
  inset: 0;
}

.trk-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 360px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
}

.trk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.trk-brand img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.trk-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.trk-live[hidden] { display: none; }

.trk-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: trk-pulse 2s ease-out infinite;
}

@keyframes trk-pulse {
  to { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

.trk-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
}

.trk-title { margin: 8px 0 4px; }
.trk-titlebar .trk-title { margin: 0; }

.trk-msg { margin: 0; }

.trk-status {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 500;
}

.trk-eta {
  padding: 16px;
  border-radius: 14px;
  background: var(--contrast);
  color: var(--on-contrast);
  margin-bottom: 20px;
}

.trk-eta .caption { color: rgba(255, 255, 255, 0.6); }

.trk-eta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trk-eta-main {
  font-size: 32px;
  font-weight: 600;
  line-height: 38px;
  letter-spacing: -0.8px;
}

.trk-eta-main.trk-muted {
  font-size: 20px;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.7);
}

.trk-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 500;
}

.trk-tag-late { background: #dc2626; }

.trk-lane {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.trk-lane-row {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.trk-lane-row:last-child { padding-bottom: 0; }

.trk-lane-row:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 2px;
  width: 2px;
  background: var(--border);
}

.trk-lane-dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: var(--card);
}

.trk-lane-row.is-done .trk-lane-dot { background: var(--text); }

.trk-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 14px;
}

.trk-card:empty { display: none; }

.trk-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.trk-row + .trk-row { border-top: 1px solid var(--border); }

.trk-row .body { text-align: right; }

.trk-chip {
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--contrast);
  color: var(--on-contrast);
  font: 600 11px/14px "Geist", sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.trk-stop {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid #737373;
  cursor: pointer;
}

.trk-truck {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--contrast);
  border: 3px solid var(--card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.trk-truck svg {
  width: 16px;
  height: 16px;
  fill: var(--on-contrast);
}

.trk-truck.is-live { animation: trk-truck-pulse 2s ease-out infinite; }

@keyframes trk-truck-pulse {
  0% { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(10, 10, 10, 0.25); }
  100% { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 16px rgba(10, 10, 10, 0); }
}

.maplibregl-popup-content {
  font: 13px/18px "Geist", sans-serif;
  border-radius: 10px;
  padding: 10px 12px;
}

@media (max-width: 760px) {
  .tracking { height: auto; overflow: auto; }
  .trk-map { position: relative; height: 52dvh; }
  .trk-panel {
    position: relative;
    inset: auto;
    width: auto;
    margin-top: -16px;
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
  }
  #content { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .trk-live-dot, .trk-truck.is-live { animation: none; }
}
