body {
  font-family: "Poppins", Arial, sans-serif;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* Fondo a pantalla completa */
.tracking-bg {
  background-size: cover;
  width: 100%;
  /*min-height: 100vh;  ✅ se adapta al contenido */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* ✅ el formulario comienza desde arriba */
  padding-top: 20px; /* separa del header */
  padding-bottom: 60px; /* deja espacio al final */
  box-sizing: border-box;
}

/* Contenedor principal (main) */
.tracking-container {
  background: rgba(255, 255, 255, 0.9);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 90%;
  max-width: 617px;
}

h1 {
  color: grey !important;
  margin-bottom: 25px !important;
  font-size: 30px !important;
}

/* ----- Formulario ----- */
form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

input {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
}

input:focus {
  border-color: #4EA635;
}

button {
  padding: 10px 20px;
  background: #4EA635 !important;
  color: #fff !important;
  border: 0px solid #ff5e14 !important;
  border: none;
  border-radius: 8px !important;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
  line-height: inherit;
}

button:hover {
  background: #6fb65b;
  color:#fff !important;
}

button:focus {
  background: #6fb65b;
  color:#fff !important;
}

/* ----- Resultado ----- */
.tracking-result {
  margin-top: 30px;
  padding: 20px;
  background: #f1f1f1;
  border-radius: 8px;
  text-align: left;
  display: none;
  background-color: white;
  color: black;
}

.tracking-result p {
margin: 8px;
}

/* ----- Loader ----- */
.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4EA635;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* ----- Barra de progreso animada ----- */
.progress-container {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}

.progress-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 4px;
}

.progress-bar {
  position: absolute;
  top: 50%;
  left: 0;
  height: 6px;
  width: 0;
  background: #4EA635;
  transform: translateY(-50%);
  z-index: 2;
  border-radius: 4px;
  transition: width 1.2s ease-in-out, background 0.5s;
}

.progress-step {
  position: relative;
  z-index: 3;
  width: 30px;
  height: 30px;
  background: #e0e0e0;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: #fff;
  transition: background 0.5s ease-in-out, transform 0.3s ease;
}

.progress-step.active {
  background: #4EA635;
  transform: scale(1.1);
}

.progress-step.completed {
  background: #4EA635;
  transform: scale(1.1);
}

.progress-step.failed {
  background: #dc3545;
  transform: scale(1.1);
}

/* Etiquetas de estado debajo */
.step-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: #555;
}


/* ----- Galería de imágenes ----- */
.tracking-images {
  margin-top: 40px;
}

.tracking-images h4 {
  margin-bottom: 20px;
  font-size: 14px;
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-gallery img {
  width: 22%;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.image-gallery img:hover {
  transform: scale(1.05);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .tracking-container {
    padding: 25px 20px;
  }

  form {
    flex-direction: column;
    gap: 15px;
  }

  button {
    width: 100%;
    font-size: 15px;
  }
  input {
    width: 92%;
  }

  /* Timeline reducido pero horizontal */
  .progress-container {
    margin-top: 30px;
    transform: scale(0.9);
    transform-origin: center;
  }

  .progress-step {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .step-labels {
    font-size: 12px;
  }

  .image-gallery img {
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  input, button {
    font-size: 14px;
    padding: 8px 12px;
  }

  .progress-container {
    margin-top: 25px;
    transform: scale(0.8);
  }

  .progress-step {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .step-labels {
    font-size: 11px;
  }
}