:root {
  --bg-dark: #070709;
  --bg-surface: #121216;
  --accent-red: #e31e24;
  --accent-red-hover: #ff2b32;
  --accent-red-glow: rgba(227, 30, 36, 0.4);
  --text-white: #ffffff;
  --text-muted: #b4b4bc;
  --border-subtle: rgba(255, 255, 255, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   Video de fondo Full-Screen
   =========================== */
.video-bg-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 100%, rgba(227, 30, 36, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 15% 15%, rgba(227, 30, 36, 0.14) 0%, transparent 45%),
    var(--bg-dark);
}

.video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 7, 9, 0.78) 0%,
    rgba(7, 7, 9, 0.65) 50%,
    rgba(7, 7, 9, 0.88) 100%
  );
}

/* Líneas diagonales rojas inspiradas en la estética de marca */
.accent-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(135deg, rgba(227, 30, 36, 0.25) 0%, transparent 18%),
    linear-gradient(315deg, rgba(227, 30, 36, 0.2) 0%, transparent 22%);
}

/* ===========================
   Sección Principal (Hero)
   =========================== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 1.5rem 1.75rem;
}

.hero-content {
  margin: auto 0;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-header {
  margin-bottom: 2rem;
}

.brand-logo {
  display: block;
  max-width: 240px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
}

.hero-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.text-accent {
  color: var(--accent-red);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.5;
  margin-bottom: 2.25rem;
}

/* ===========================
   Formulario de Rastreo
   =========================== */
.tracking-form {
  width: 100%;
  max-width: 620px;
}

.input-group {
  display: flex;
  align-items: center;
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.45rem 0.45rem 0.45rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.18), 0 20px 50px rgba(0, 0, 0, 0.65);
}

.input-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.tracking-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.65rem 0.5rem 0.65rem 0;
}

.tracking-input::placeholder {
  color: #858591;
}

.tracking-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--accent-red);
  color: var(--text-white);
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.75rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 8px 24px var(--accent-red-glow);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.tracking-btn:hover {
  background-color: var(--accent-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(227, 30, 36, 0.5);
}

.tracking-btn:active {
  transform: translateY(0);
}

.tracking-error {
  margin-top: 0.75rem;
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: #ff6b6f;
  font-weight: 500;
}

/* ===========================
   Footer
   =========================== */
.hero-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 620px;
  text-align: center;
}

.hero-footer p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

/* ===========================
   Modal con Iframe
   =========================== */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  height: min(86vh, 780px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #0c0c0f;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-badge {
  background: rgba(227, 30, 36, 0.16);
  color: var(--accent-red);
  border: 1px solid rgba(227, 30, 36, 0.35);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-close:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--text-white);
}

.modal-body {
  position: relative;
  flex: 1;
  background: #ffffff;
}

.modal-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 1;
}

.modal-loader[hidden] {
  display: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.tracking-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 560px) {
  .brand-logo {
    max-width: 190px;
  }

  .input-group {
    flex-direction: column;
    border-radius: 20px;
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .input-icon {
    display: none;
  }

  .tracking-input {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
  }

  .tracking-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
  }

  .modal {
    padding: 0.5rem;
  }

  .modal-container {
    height: 92vh;
    border-radius: 12px;
  }
}
