:root {
  --navy: #1f3a7a;
  --red: #c8183d;
  --ink: #1b2236;
  --mist: #eef0f3;
  --grey: #7a7f8a;
}
body {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Nav */
.navbar {
  background: #fff;
  border-bottom: 1px solid #e3e6ee;
  padding: 0.5rem 0;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff !important;
}
.navbar-brand b {
  color: #ff5a7a;
}
.navbar .nav-link {
  color: var(--navy) !important;
  font-weight: 600;
}
.navbar .nav-link:hover {
  color: var(--red) !important;
}
.logo {
  height: 38px;
  width: auto;
}
.side .logo {
  height: 30px;
}

/* Buttons */
.btn-danger {
  background: var(--red);
  border-color: var(--red);
}
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}
button .spinner-border {
  vertical-align: -2px;
}

/* Hero (tracking page) */
.hero {
  background: var(--mist);
  padding: 4rem 0;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--navy);
}
.track-box {
  background: #fff;
  border-left: 6px solid var(--red);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(31, 58, 122, 0.12);
}

/* Route */
.route {
  position: relative;
  height: 8px;
  background: #dfe3ec;
  border-radius: 8px;
  margin: 3rem 0 1.5rem;
}
.route-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--navy), var(--red));
  border-radius: 8px;
  transition: width 2.4s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.route-icon {
  position: absolute;
  top: -26px;
  left: 0;
  font-size: 1.8rem;
  color: var(--red);
  transform: translateX(-50%);
  transition: left 2.4s cubic-bezier(0.3, 0.7, 0.2, 1);
  display: inline-block; /* ← ensures the icon has width */
  will-change: left; /* ← hints the browser to animate left smoothly */
  z-index: 2; /* ← stays above the fill line */
}
.step {
  opacity: 0.45;
}
.step.on {
  opacity: 1;
}
.step i {
  font-size: 1.4rem;
  color: var(--red);
}

/* Admin / side */
.side {
  width: 230px;
  min-height: 100vh;
  background: var(--navy);
}
.side a {
  color: #dfe6fb;
  display: block;
  padding: 0.7rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.side a.active,
.side a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.stat {
  border-top: 5px solid var(--red);
  background: var(--mist);
  padding: 1.2rem;
}
.stat b {
  font-size: 2rem;
  color: var(--navy);
}

@media (max-width: 767px) {
  .side {
    width: 100%;
    min-height: 0;
  }
  .side nav {
    display: flex;
    overflow-x: auto;
  }
  .side a {
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .route-fill,
  .route-icon {
    transition: none;
  }
}

/* Homepage hero2 carousel */
.hero2 {
  position: relative;
  min-height: 520px;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}
.hero2 .carousel,
.hero2 .carousel-inner,
.hero2 .carousel-item,
.slide {
  position: absolute;
  inset: 0;
  height: 100%;
}
.slide {
  background-size: cover;
  background-position: center;
  background-color: var(--navy);
}
.s0 {
  background-color: #16306b;
}
.s1 {
  background-color: #3b2a6e;
}
.s2 {
  background-color: #7a1530;
}
.slide-ic {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  font-size: min(34vw, 320px);
  opacity: 0.1;
}
.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
}
.cap h5 {
  font-weight: 800;
  margin: 0;
}
.cap p {
  margin: 0;
  opacity: 0.85;
}
.hero-ui {
  position: relative;
  z-index: 2;
  padding: 3.5rem 12px 6rem;
  text-align: center;
}
.hero-ui h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 600;
  margin-bottom: 1.8rem;
}
.tabs {
  display: inline-flex;
  gap: 4px;
}
.tabs button {
  width: clamp(90px, 26vw, 150px);
  padding: 0.9rem 0.4rem;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tabs button i {
  display: block;
  font-size: 1.7rem;
}
.tabs button.on {
  background: var(--red);
  color: #fff;
}
.pane {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0;
}
.track-bar {
  display: flex;
  gap: 8px;
  max-width: 760px;
  margin: auto;
}
.track-bar .form-control {
  border-radius: 0;
  padding: 0.8rem;
}
.track-bar .btn {
  border-radius: 0;
  padding: 0 1.6rem;
  font-weight: 800;
  white-space: nowrap;
}
.hero-ui .form-control {
  border-radius: 0;
}
.carousel-indicators {
  z-index: 3;
  margin-bottom: 0.4rem;
}

.notice {
  border: 1px solid #cfd8ef;
  border-left: 4px solid var(--navy);
  padding: 0.9rem 1rem;
  background: #f7f9fd;
}
.quick .q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 1rem 0.3rem;
  border-radius: 6px;
  transition: 0.2s;
}
.quick .q i {
  font-size: 2.4rem;
}
.quick .q:hover {
  background: var(--mist);
  color: var(--red);
  transform: translateY(-3px);
}

.why {
  background: var(--mist);
  padding: 2rem;
  margin: 2rem 0;
}
.ph {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--navy), #3a5fb0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 4rem;
  overflow: hidden;
}
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-x .ph {
  transition: 0.3s;
}
.card-x:hover .ph {
  filter: brightness(1.08);
}

.more {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.more:hover {
  color: var(--red);
}

.stats {
  background: var(--navy);
  color: #fff;
  padding: 3rem 0;
}
.num {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  color: #ff6b88;
}
.biz {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem 0;
  border-bottom: 1px solid #e8ebf2;
}
.biz-ic {
  flex: none;
  width: 72px;
  height: 72px;
  background: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--red);
}
.faq {
  max-width: 760px;
  margin: auto;
}

.foot {
  background: var(--navy);
  color: #c9d3ee;
}
.foot a {
  color: #c9d3ee;
  text-decoration: none;
  display: block;
  margin: 0.3rem 0;
  font-size: 0.9rem;
}
.foot a:hover {
  color: #fff;
}
.foot h6 {
  color: #fff;
  font-weight: 800;
}

@media (max-width: 575px) {
  .track-bar {
    flex-direction: column;
  }
  .track-bar .btn {
    padding: 0.7rem;
  }
  .why {
    padding: 1.2rem;
  }
}

/* Auth */
.auth {
  display: flex;
  min-height: calc(100vh - 63px);
}
.auth.full {
  min-height: 100vh;
}
.auth-side {
  display: none;
  flex: 1 1 50%;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 4rem;
  align-items: center;
}
.auth-side h2 {
  font-size: 2.4rem;
}
.auth-form {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #fff;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card .input-group-text {
  background: var(--mist);
  color: var(--navy);
}
.auth-card .form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 0.2rem rgba(31, 58, 122, 0.15);
}
@media (min-width: 992px) {
  .auth-side {
    display: flex;
  }
}

/* Cookie banner */
.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: var(--navy);
  color: #fff;
  padding: 1rem 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
}

/* Admin background */
body.admin {
  background: #f6f7fb;
}

/* Location results inside the hero (white text on dark hero needs dark card text) */
.loc-card {
  background: #ffffff;
  color: #1b2236; /* dark ink — overrides hero's white */
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  height: 100%;
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.loc-card b {
  display: block;
  color: #1f3a7a; /* navy heading */
  font-weight: 800;
  margin-bottom: 2px;
}
.loc-card .loc-meta {
  color: #7a7f8a; /* grey meta line */
  font-size: 0.78rem;
}
.loc-card .loc-addr {
  color: #1b2236;
  margin-top: 4px;
}

/* Ensure any white card that appears on the dark hero keeps dark text */
.hero-ui .bg-white,
.hero2 .bg-white {
  color: #1b2236;
}

/* =========================================================
   Hero slider (home)
   ========================================================= */
.hero2 {
  position: relative;
  min-height: 560px;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}
.hero2 .carousel,
.hero2 .carousel-inner,
.hero2 .carousel-item,
.hero2 .slide {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}
.hero2 .carousel-item {
  transition: opacity 0.9s ease-in-out;
}
.hero2 .slide {
  background-size: cover;
  background-position: center;
  background-color: var(--navy);
}

/* Caption bottom-left of each slide */
.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 90px;
  padding: 0 1rem;
}
.cap h5 {
  font-weight: 800;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.cap p {
  margin: 0;
  opacity: 0.9;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* UI (headline + tabs) sits on top of the slider */
.hero-ui {
  position: relative;
  z-index: 3;
  padding: 4.5rem 12px 3rem;
  text-align: center;
  pointer-events: none; /* let the slider below receive swipes/clicks */
}
.hero-ui .tabs,
.hero-ui .pane,
.hero-ui h1 {
  pointer-events: auto;
}

.hero-ui h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1.8rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

/* Tabs */
.tabs {
  display: inline-flex;
  gap: 4px;
}
.tabs button {
  width: clamp(90px, 26vw, 150px);
  padding: 0.9rem 0.4rem;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.tabs button i {
  display: block;
  font-size: 1.7rem;
}
.tabs button.on {
  background: var(--red);
  color: #fff;
}

.pane {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* Track bar inside hero */
.track-bar {
  display: flex;
  gap: 8px;
  max-width: 760px;
  margin: auto;
}
.track-bar .form-control {
  border-radius: 0;
  padding: 0.8rem;
}
.track-bar .btn {
  border-radius: 0;
  padding: 0 1.6rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Indicators under the hero-ui */
.hero2 .carousel-indicators {
  z-index: 4;
  bottom: 8px;
  margin-bottom: 0;
}
.hero2 .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  border: 0;
}
.hero2 .carousel-indicators .active {
  background-color: #fff;
}

/* Prev/next arrows (subtle) */
.hero2 .carousel-control-prev,
.hero2 .carousel-control-next {
  z-index: 4;
  width: 5%;
  opacity: 0.55;
}
.hero2 .carousel-control-prev:hover,
.hero2 .carousel-control-next:hover {
  opacity: 1;
}

@media (max-width: 575px) {
  .hero2 {
    min-height: 620px;
  }
  .cap {
    bottom: 130px;
  }
  .track-bar {
    flex-direction: column;
  }
  .track-bar .btn {
    padding: 0.7rem;
  }
}

/* =========================================================
   Feature cards ("Delivery that works around you")
   ========================================================= */
.card-x .ph {
  transition: 0.3s;
  border-radius: 6px;
  overflow: hidden;
}
.card-x:hover .ph {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

/* Make sure the icon fallback hides once the real image is shown */
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph i {
  z-index: 0;
}

/* =========================================================
   "Why ship with FedExpress?" image
   ========================================================= */
.why .ph {
  aspect-ratio: 4/3;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(31, 58, 122, 0.18);
}

/* =========================================================
   Tracking page — live map
   ========================================================= */
.track-map-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(31, 58, 122, 0.18);
  background: var(--mist);
}
#track-map {
  width: 100%;
  height: 100%;
}

/* Vehicle marker */
.track-vehicle .vehicle-inner {
  width: 44px;
  height: 44px;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(200, 24, 61, 0.55);
  animation: mapPulse 2s infinite;
}
@keyframes mapPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 24, 61, 0.75);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(200, 24, 61, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(200, 24, 61, 0);
  }
}

/* Origin / destination pins */
.track-pin .pin-origin {
  color: var(--navy);
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.track-pin .pin-dest {
  color: var(--red);
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

/* Leaflet popup polish */
.leaflet-popup-content-wrapper {
  border-radius: 6px;
}
.leaflet-popup-content {
  margin: 0.6rem 0.9rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 575px) {
  .track-map-wrap {
    height: 340px;
  }
}
