/* Page "en construction" du site de réservation : reprend la DA noir et blanc de la page fermée
   (teaser.css) et l'animation "voiture" de la confirmation de commande du shop.
   Cycle de 9 s : le plan se trace, la voiture se construit, les roues tournent, elle brille. */

.build{ position:relative; width:min(440px,88vw); margin:0 auto 30px; }
.build svg{ display:block; width:100%; height:auto; overflow:visible; }

/* Halo discret derrière la voiture (rend le noir moins plat) */
.build::before{
  content:""; position:absolute; left:50%; top:46%; width:120%; aspect-ratio:2/1; transform:translate(-50%,-50%);
  background:radial-gradient(ellipse at center, rgba(160,160,160,0.13), transparent 62%);
  pointer-events:none; animation:b-halo 9s ease-in-out infinite;
}

.b-stage{ animation:b-stage 9s linear infinite; }

.b-line{
  fill:none; stroke:var(--or); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:100; stroke-dashoffset:100;
}
.b-thin{ stroke-width:1.4; }
.b-guide{
  fill:none; stroke:var(--gris); stroke-width:1; stroke-linecap:round;
  stroke-dasharray:100; stroke-dashoffset:100; opacity:.55;
}
.b-tick{ fill:none; stroke:var(--gris); stroke-width:1; opacity:0; animation:b-tick 9s ease infinite; }

.b-guide{ animation:b-guide 9s ease-in-out infinite; }
.b-body{ animation:b-body 9s cubic-bezier(.6,0,.3,1) infinite; }
.b-cabin{ animation:b-cabin 9s cubic-bezier(.6,0,.3,1) infinite; }
.b-wheel{ animation:b-wheel 9s ease-in-out infinite; }
.b-detail{ animation:b-detail 9s ease-in-out infinite; }

.b-spokes{ transform-box:fill-box; transform-origin:center; animation:b-spin .9s linear infinite; }

/* Sol qui défile : donne l'impression que la voiture roule une fois construite */
.b-ground{
  fill:none; stroke:var(--line); stroke-width:2; stroke-linecap:round;
  stroke-dasharray:14 18; opacity:0;
  animation:b-ground-in 9s ease infinite, b-ground-run 1.1s linear infinite;
}

/* Remplissage doux de la carrosserie une fois tracée */
.b-fill{ fill:rgba(160,160,160,0.08); stroke:none; opacity:0; animation:b-fill 9s ease infinite; }

/* Passage de brillance (comme la confirmation de commande) */
.b-shine-svg{
  position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible;
  filter:drop-shadow(0 0 9px rgba(207,207,207,0.6));
  clip-path:inset(-20% 100% -20% 0);
  animation:b-shine 9s cubic-bezier(.65,0,.35,1) infinite, b-stage 9s linear infinite;
}
.b-shine{ fill:none; stroke:var(--or-clair); stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.b-sweep{
  position:absolute; top:6%; bottom:14%; left:0; width:16px; border-radius:8px;
  background:linear-gradient(90deg, transparent, rgba(245,245,244,0.85), transparent);
  filter:blur(5px); opacity:0; animation:b-sweep 9s cubic-bezier(.65,0,.35,1) infinite;
}
.b-spark{
  position:absolute; color:var(--or-clair); font-size:15px; opacity:0; pointer-events:none;
  animation:b-spark 9s ease-in-out infinite;
}
.b-spark.s1{ top:6%;  left:20%; }
.b-spark.s2{ top:58%; left:4%;  font-size:10px; animation-delay:.25s; }
.b-spark.s3{ top:0%;  left:70%; font-size:12px; animation-delay:.5s; }
.b-spark.s4{ top:54%; left:92%; font-size:10px; animation-delay:.75s; }

/* Barre d'avancement + étapes */
.b-progress{ width:min(260px,70vw); margin:0 auto; }
.b-bar{ height:2px; background:var(--line); border-radius:2px; overflow:hidden; }
.b-bar i{ display:block; height:100%; width:0; background:var(--or-clair); animation:b-bar 9s ease-in-out infinite; }
.b-steps{ position:relative; height:18px; margin-top:12px; font-family:'JetBrains Mono',monospace; font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--gris); }
.b-steps span{ position:absolute; inset:0; text-align:center; opacity:0; }
.b-steps span b{ color:var(--or); font-weight:600; margin-right:8px; }
.b-steps span:nth-child(1){ animation:b-step1 9s ease infinite; }
.b-steps span:nth-child(2){ animation:b-step2 9s ease infinite; }
.b-steps span:nth-child(3){ animation:b-step3 9s ease infinite; }

@keyframes b-stage{ 0%{opacity:1} 90%{opacity:1} 97%,100%{opacity:0} }
@keyframes b-halo{ 0%,4%{opacity:0} 40%,88%{opacity:1} 97%,100%{opacity:0} }

@keyframes b-guide{ 0%,2%{stroke-dashoffset:100} 14%,100%{stroke-dashoffset:0} }
@keyframes b-tick{ 0%,10%{opacity:0} 16%,100%{opacity:.55} }
@keyframes b-body{ 0%,8%{stroke-dashoffset:100} 34%,100%{stroke-dashoffset:0} }
@keyframes b-cabin{ 0%,26%{stroke-dashoffset:100} 42%,100%{stroke-dashoffset:0} }
@keyframes b-wheel{ 0%,36%{stroke-dashoffset:100} 48%,100%{stroke-dashoffset:0} }
@keyframes b-detail{ 0%,44%{stroke-dashoffset:100} 52%,100%{stroke-dashoffset:0} }
@keyframes b-fill{ 0%,48%{opacity:0} 58%,100%{opacity:1} }
@keyframes b-ground-in{ 0%,50%{opacity:0} 60%,100%{opacity:1} }
@keyframes b-ground-run{ to{ stroke-dashoffset:-32; } }
@keyframes b-spin{ to{ transform:rotate(360deg); } }

@keyframes b-shine{
  0%,54%{ clip-path:inset(-20% 100% -20% 0); }
  70%,100%{ clip-path:inset(-20% 0% -20% 0); }
}
@keyframes b-sweep{
  0%,54%{ left:0%; opacity:0; }
  57%,67%{ opacity:1; }
  70%,100%{ left:100%; opacity:0; }
}
@keyframes b-spark{
  0%,64%{ opacity:0; transform:scale(.4) rotate(0deg); }
  72%{ opacity:1; transform:scale(1) rotate(25deg); }
  82%,100%{ opacity:0; transform:scale(.4) rotate(50deg); }
}

@keyframes b-bar{ 0%{ width:0; } 70%,92%{ width:100%; } 100%{ width:100%; } }
@keyframes b-step1{ 0%,3%{opacity:0} 8%,26%{opacity:1} 32%,100%{opacity:0} }
@keyframes b-step2{ 0%,30%{opacity:0} 36%,50%{opacity:1} 56%,100%{opacity:0} }
@keyframes b-step3{ 0%,54%{opacity:0} 60%,90%{opacity:1} 96%,100%{opacity:0} }

.construction-note{ margin-top:34px; font-size:12px; color:var(--gris); }
.construction-note a{ color:var(--or-clair); text-decoration:underline; }

@media (max-width:750px){
  .build{ margin-bottom:24px; }
  .b-steps{ font-size:10px; }
}

/* Mouvement réduit : voiture terminée et brillante, sans animation */
@media (prefers-reduced-motion: reduce){
  .build::before, .b-stage, .b-line, .b-guide, .b-tick, .b-ground, .b-fill, .b-sweep,
  .b-shine-svg, .b-spark, .b-bar i, .b-steps span, .b-spokes{ animation:none; }
  .b-line, .b-guide{ stroke-dashoffset:0; }
  .b-tick, .b-ground, .b-fill{ opacity:1; }
  .b-shine-svg{ clip-path:inset(-20% 0% -20% 0); }
  .b-bar i{ width:100%; }
  .b-steps span:nth-child(3){ opacity:1; }
}
