/* Intro Top Auto — v13 : fond clair, finition premium */

body.topauto-intro-active {
  overflow: hidden !important;
}

body.topauto-intro-active #root {
  opacity: 0;
  pointer-events: none;
}

body.topauto-intro-reveal #root,
body.topauto-intro-done #root {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body.topauto-intro-done {
  overflow: auto !important;
  overflow-x: hidden !important;
}

#topauto-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #ffffff 0%, #f6f8fc 40%, #eef2f7 100%);
  overflow: hidden;
  font-family: Montserrat, system-ui, sans-serif;
}

#topauto-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 28%, rgba(20, 59, 110, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 92% 75%, rgba(233, 30, 99, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 8% 70%, rgba(20, 59, 110, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

#topauto-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 22%, transparent 88%, rgba(255, 255, 255, 0.4) 100%);
  pointer-events: none;
}

#topauto-intro.topauto-intro--hidden,
#topauto-intro.topauto-intro--exit {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.topauto-intro__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topauto-intro__bg-accent {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(420px, 90vw);
  height: 200px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(20, 59, 110, 0.06) 0%, transparent 72%);
  pointer-events: none;
  z-index: 1;
}

.topauto-intro__speedlines {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 28px,
    rgba(20, 59, 110, 0.04) 28px,
    rgba(20, 59, 110, 0.04) 32px
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ── Logo + loader ── */
.topauto-intro__panel {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  pointer-events: none;
}

.topauto-intro__brand {
  position: relative;
  z-index: 32;
  padding: 20px 36px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 24px rgba(20, 59, 110, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.topauto-intro__logo {
  display: block;
  max-width: min(280px, 78vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 20px rgba(20, 59, 110, 0.12));
  animation: topauto-intro-logo-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.topauto-intro__wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: topauto-intro-logo-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.topauto-intro__mark-icon {
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #e91e63 0%, #143b6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topauto-intro__mark-text {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #143b6e;
}

@keyframes topauto-intro-logo-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.topauto-intro__loader-zone {
  position: relative;
  z-index: 34;
  margin-top: 40px;
  padding: 16px 32px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(20, 59, 110, 0.08);
  box-shadow:
    0 8px 28px rgba(20, 59, 110, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.03);
}

.topauto-intro__loader {
  width: min(220px, 58vw);
  height: 5px;
  margin: 0 auto 12px;
  background: rgba(20, 59, 110, 0.1);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(20, 59, 110, 0.06);
}

.topauto-intro__loader-bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #143b6e 0%, #e91e63 55%, #e6004d 100%);
  box-shadow: 0 0 12px rgba(233, 30, 99, 0.35);
  transition: width 0.12s ease-out;
}

.topauto-intro__status {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #143b6e;
  opacity: 0.65;
}

/* ── Route : visible seulement quand la voiture passe ── */
.topauto-intro__road {
  position: absolute;
  z-index: 10;
  left: 4%;
  right: 4%;
  top: 72%;
  height: 2px;
  opacity: 0;
  visibility: hidden;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(20, 59, 110, 0.15) 10%,
    rgba(20, 59, 110, 0.15) 90%,
    transparent 100%
  );
  border-radius: 999px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#topauto-intro.topauto-intro--drive .topauto-intro__road {
  opacity: 1;
  visibility: visible;
}

.topauto-intro__road::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(233, 30, 99, 0.45) 0,
    rgba(233, 30, 99, 0.45) 20px,
    transparent 20px,
    transparent 40px
  );
  transform: translateY(-50%);
  opacity: 0;
}

.topauto-intro__road::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 24px;
  background: linear-gradient(180deg, rgba(20, 59, 110, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

#topauto-intro.topauto-intro--drive .topauto-intro__road::before {
  animation: topauto-intro-road-dash 0.4s linear infinite;
  opacity: 1;
}

@keyframes topauto-intro-road-dash {
  to {
    transform: translateY(-50%) translateX(-40px);
  }
}

/* ── Voiture ── */
.topauto-intro__car-wrap {
  position: absolute;
  z-index: 20;
  left: -12%;
  top: 72%;
  width: min(120px, 30vw);
  transform: translate(-50%, -55%);
  opacity: 0;
  pointer-events: none;
  will-change: left, transform, opacity;
}

.topauto-intro__car-svg {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center 85%;
  filter: drop-shadow(0 10px 18px rgba(20, 59, 110, 0.2));
}

.topauto-intro__wheel {
  transform-origin: center;
  transform-box: fill-box;
}

.topauto-intro__motion-trail {
  position: absolute;
  left: -100%;
  top: 52%;
  width: 90%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(233, 30, 99, 0.45), rgba(20, 59, 110, 0.25), transparent);
  border-radius: 999px;
  opacity: 0;
}

.topauto-intro__brake-mark,
.topauto-intro__smoke {
  display: none;
}

/* ── Phase conduite ── */
#topauto-intro.topauto-intro--drive .topauto-intro__speedlines {
  animation: topauto-intro-lines-move 0.1s linear infinite;
  opacity: 0.7;
}

@keyframes topauto-intro-lines-move {
  to {
    transform: translateX(-60px);
  }
}

#topauto-intro.topauto-intro--drive .topauto-intro__car-wrap {
  opacity: 1;
  animation: topauto-intro-drive-ltr 0.75s linear forwards;
}

#topauto-intro.topauto-intro--drive .topauto-intro__car-svg {
  animation: topauto-intro-car-run 0.75s ease-out forwards;
}

#topauto-intro.topauto-intro--drive .topauto-intro__wheel {
  animation: topauto-intro-wheel-spin 0.1s linear infinite;
}

#topauto-intro.topauto-intro--drive .topauto-intro__motion-trail {
  animation: topauto-intro-trail-drive 0.75s linear forwards;
}

@keyframes topauto-intro-drive-ltr {
  0% {
    left: -18%;
    transform: translate(-50%, -55%) scale(0.88);
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  20% {
    left: 18%;
  }
  45% {
    left: 48%;
    transform: translate(-50%, -55%) scale(1);
  }
  70% {
    left: 78%;
  }
  88% {
    left: 102%;
    opacity: 1;
  }
  100% {
    left: 118%;
    transform: translate(-50%, -55%) scale(1.02);
    opacity: 0;
  }
}

@keyframes topauto-intro-car-run {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes topauto-intro-wheel-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes topauto-intro-trail-drive {
  0%,
  6% {
    opacity: 0;
  }
  12% {
    opacity: 0.75;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
  }
}

/* Fin */
#topauto-intro.topauto-intro--drive-end .topauto-intro__panel {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#topauto-intro.topauto-intro--drive-end .topauto-intro__car-wrap {
  opacity: 0;
  transition: opacity 0.25s ease;
}

#topauto-intro.topauto-intro--drive-end {
  animation: topauto-intro-fadeout 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes topauto-intro-fadeout {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 480px) {
  .topauto-intro__brand {
    padding: 16px 24px 18px;
  }

  .topauto-intro__loader-zone {
    margin-top: 32px;
    padding: 14px 22px 12px;
  }

  .topauto-intro__road,
  .topauto-intro__car-wrap {
    top: 76%;
  }

  .topauto-intro__car-wrap {
    width: min(96px, 32vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  #topauto-intro {
    display: none !important;
  }

  body.topauto-intro-active #root {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
