:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --body-start: #f9fbfe;
  --body-end: #e9f0f8;
  --body-glow: rgba(12, 107, 93, 0.12);
  --panel: #ffffff;
  --panel-soft: #f9fbfe;
  --panel-muted: #eef5fb;
  --panel-tint: #e5f4f1;
  --panel-danger: #fff3ef;
  --panel-glass: rgba(255, 255, 255, 0.86);
  --panel-glass-strong: rgba(255, 255, 255, 0.78);
  --ink: #102034;
  --muted: #607086;
  --line: #d9e2ee;
  --line-strong: rgba(217, 226, 238, 0.9);
  --header-bg: rgba(249, 251, 254, 0.86);
  --header-border: rgba(217, 226, 238, 0.8);
  --primary: #0c6b5d;
  --primary-dark: #074d43;
  --accent: #ffb545;
  --danger: #d95040;
  --navy: #102034;
  --map-bg: #eef5fb;
  --map-grid: rgba(217, 226, 238, 0.42);
  --dark-muted: #9fb0c6;
  --inverted-text: #ffffff;
  --shadow: 0 24px 70px rgba(16, 32, 52, 0.12);
  --soft-shadow: 0 14px 36px rgba(16, 32, 52, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1420;
  --body-start: #101c2b;
  --body-end: #070d14;
  --body-glow: rgba(31, 191, 163, 0.18);
  --panel: #101c2b;
  --panel-soft: #132235;
  --panel-muted: #17283d;
  --panel-tint: rgba(31, 191, 163, 0.16);
  --panel-danger: rgba(217, 80, 64, 0.16);
  --panel-glass: rgba(16, 28, 43, 0.88);
  --panel-glass-strong: rgba(16, 28, 43, 0.82);
  --ink: #edf6ff;
  --muted: #a8b6c9;
  --line: #26384d;
  --line-strong: rgba(77, 101, 132, 0.72);
  --header-bg: rgba(9, 17, 28, 0.88);
  --header-border: rgba(77, 101, 132, 0.5);
  --primary: #20c9aa;
  --primary-dark: #74f0da;
  --accent: #ffc766;
  --danger: #ff7c69;
  --navy: #07101b;
  --map-bg: #122237;
  --map-grid: rgba(130, 157, 190, 0.14);
  --dark-muted: #a8b6c9;
  --inverted-text: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, var(--body-glow), transparent 32rem),
    linear-gradient(180deg, var(--body-start) 0%, var(--bg) 55%, var(--body-end) 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition:
    background 180ms ease,
    color 180ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(16px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--primary);
  color: var(--inverted-text);
  font-size: 0.85rem;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 28%, transparent);
}

.nav-toggle {
  display: none;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--panel-muted);
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 34%, transparent);
  transition: transform 180ms ease;
}

:root[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
}

.nav-links {
  gap: 24px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
  list-style: none;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--primary);
}

.hero,
.section,
.site-footer,
.logo-strip {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 52px;
  align-items: center;
  padding: 88px 0 56px;
}

.hero-content h1,
.section-heading h2,
.api-section h2,
.split h2,
.compliance-section h2,
.integrations-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero-copy {
  max-width: 670px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
}

.button.primary {
  background: var(--primary);
  color: var(--inverted-text);
  box-shadow: 0 18px 40px rgba(12, 107, 93, 0.26);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--panel-glass-strong);
  color: var(--ink);
}

.dashboard-card,
.feature-card,
.fleet-card,
.alert-card,
.finance-grid article {
  border: 1px solid var(--line-strong);
  background: var(--panel-glass);
  box-shadow: var(--shadow);
}

.dashboard-card {
  overflow: hidden;
  border-radius: 32px;
}

.dashboard-header,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}

.dashboard-header {
  align-items: center;
  padding: 22px;
  background: var(--navy);
  color: var(--inverted-text);
}

.dashboard-header span,
.metric-grid span {
  color: var(--dark-muted);
  font-size: 0.82rem;
}

.dashboard-header strong {
  justify-self: end;
  color: var(--accent);
  font-size: 2.4rem;
  line-height: 1;
}

.map-panel {
  position: relative;
  min-height: 285px;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    var(--map-bg);
  background-size: 42px 42px;
}

.route {
  position: absolute;
  display: block;
  width: 250px;
  height: 140px;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 46px;
  opacity: 0.88;
}

.route-a {
  top: 72px;
  left: 48px;
  transform: rotate(-12deg);
}

.route-b {
  right: 36px;
  bottom: 30px;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  transform: rotate(162deg);
}

.pin {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 4px solid var(--panel);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(16, 32, 52, 0.2);
}

.pin-one {
  top: 75px;
  left: 85px;
}

.pin-two {
  top: 165px;
  left: 230px;
  background: var(--accent);
}

.pin-three {
  right: 78px;
  bottom: 74px;
}

.metric-grid > div {
  padding: 18px 20px;
  background: var(--panel);
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
  line-height: 1;
}

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-glass-strong);
  color: var(--muted);
}

.logo-strip strong {
  color: var(--ink);
}

.section {
  padding: 92px 0;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 34px;
}

.section-heading h2,
.api-section h2,
.split h2,
.compliance-section h2,
.integrations-section h2 {
  font-size: clamp(2rem, 4vw, 3.55rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.api-section {
  margin-top: 28px;
  padding: 54px;
  border-radius: 36px;
  background:
    radial-gradient(circle at top right, rgba(255, 181, 69, 0.2), transparent 18rem),
    var(--panel);
  box-shadow: var(--shadow);
}

.api-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.api-heading p:not(.eyebrow) {
  max-width: 740px;
  margin: 18px 0 0;
  color: var(--muted);
}

.api-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.api-status::before {
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.api-status[data-state="online"] {
  background: var(--panel-tint);
  color: var(--primary-dark);
}

.api-status[data-state="online"]::before {
  background: var(--primary);
}

.api-status[data-state="offline"] {
  background: var(--panel-danger);
  color: var(--danger);
}

.api-status[data-state="offline"]::before {
  background: var(--danger);
}

.api-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.api-metrics article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-soft);
}

.api-metrics span,
.api-feed-grid li span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.api-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.api-feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.api-feed-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.api-feed-grid h3 {
  margin: 0 0 14px;
}

.api-feed-grid ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-feed-grid li {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.api-feed-grid li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.feature-card {
  min-height: 250px;
  padding: 24px;
  border-radius: 28px;
}

.icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  background: var(--panel-tint);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.feature-card h3,
.finance-grid h3,
.fleet-card h3 {
  margin: 28px 0 10px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.feature-card p,
.split p,
.finance-grid p,
.fleet-card p,
.site-footer p {
  margin: 0;
  color: var(--muted);
}

.split,
.compliance-section,
.integrations-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.split {
  padding: 54px;
  border-radius: 36px;
  background: var(--navy);
  color: var(--inverted-text);
}

.split h2,
.split .eyebrow,
.split p {
  color: var(--inverted-text);
}

.split p {
  margin-top: 20px;
  color: var(--dark-muted);
}

.checklist {
  display: grid;
  gap: 12px;
}

.checklist span {
  position: relative;
  padding: 15px 18px 15px 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.checklist span::before {
  position: absolute;
  top: 15px;
  left: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.finance-band {
  padding-top: 108px;
}

.finance-grid,
.safety-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.finance-grid article {
  padding: 28px;
  border-radius: 28px;
}

.finance-grid h3 {
  margin-top: 0;
}

.safety-layout {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  overflow-x: auto;
  padding-bottom: 6px;
}

.alert-card {
  min-height: 190px;
  padding: 22px;
  border-radius: 28px;
}

.alert-card.high {
  background: var(--panel-danger);
  border-color: rgba(217, 80, 64, 0.22);
}

.alert-card span {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-card strong {
  display: block;
  margin-top: 48px;
  font-size: 1.35rem;
  line-height: 1.16;
}

.compliance-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 22px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.timeline span {
  display: block;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timeline strong {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.fleet-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.filter-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--inverted-text);
}

.fleet-card {
  padding: 32px;
  border-radius: 28px;
}

.fleet-card h3 {
  margin-top: 0;
}

.integration-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.integration-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  font-weight: 800;
}

.site-footer {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
}

.site-footer div {
  max-width: 560px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero,
  .api-heading,
  .split,
  .compliance-section,
  .integrations-section {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    max-width: 560px;
  }

  .feature-grid,
  .finance-grid,
  .api-metrics,
  .api-feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    right: 16px;
    display: none;
    width: min(260px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
    gap: 8px;
  }

  .nav-links a {
    display: block;
    padding: 10px 12px;
  }

  .hero {
    padding-top: 54px;
  }

  .logo-strip {
    justify-content: flex-start;
    border-radius: 24px;
  }

  .section {
    padding: 64px 0;
  }

  .split {
    padding: 32px 22px;
    border-radius: 28px;
  }

  .api-section {
    padding: 32px 22px;
    border-radius: 28px;
  }

  .feature-grid,
  .finance-grid,
  .api-metrics,
  .api-feed-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .hero,
  .section,
  .site-footer,
  .logo-strip {
    width: min(100% - 24px, 1160px);
  }

  .hero-content h1 {
    font-size: 2.45rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   AUTH PAGE
   ============================================= */

.auth-page body,
body.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 480px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field-group input {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.field-group input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 107, 93, 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 440px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.auth-alert {
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  display: none;
}

.auth-alert:not(:empty) {
  display: block;
}

.auth-alert[data-type="error"],
.auth-alert:not([data-type]) {
  background: var(--panel-danger);
  color: var(--danger);
  border: 1px solid rgba(217, 80, 64, 0.25);
}

.auth-alert[data-type="success"] {
  background: var(--panel-tint);
  color: var(--primary-dark);
  border: 1px solid rgba(12, 107, 93, 0.25);
}

.button.full-width {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:hover {
  color: var(--primary-dark);
}

.auth-panel.hidden {
  display: none;
}

/* =============================================
   NAV AUTH CONTROLS
   ============================================= */

.nav-auth-btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
}

.nav-user-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-user-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.4rem 0.75rem;
  background: var(--panel-muted);
  border-radius: 2rem;
  border: 1px solid var(--line);
}

.live-api-signin {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  white-space: nowrap;
}
