/* ============================================
   REPROGRAMMATION — page complète (drill-down + résultats)
   Réutilise les tokens de style.css (--red = bleu #3366FF) et
   les blocs de fusibles.css (.fz-hero, .fz-breadcrumb…).
   Page : reprogrammation.html
   ============================================ */

.rp-page { color: var(--black); }
.rp-block { background: var(--white); }

/* ---------- Fil d'ariane cliquable dans le hero ---------- */
.rp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.82rem; margin-bottom: 16px; }
.rp-crumbs a { color: rgba(255,255,255,.6); }
.rp-crumbs a:hover { color: #fff; }
.rp-crumbs .sep { color: rgba(255,255,255,.3); }
.rp-crumbs .cur { color: #fff; font-weight: 600; }

.rp-hero-sub { color: rgba(255,255,255,.72); font-size: 1.02rem; line-height: 1.6; max-width: 720px; margin: 0; }

/* ---------- Barre de progression des étapes ---------- */
.rp-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 30px; }
.rp-step {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--gray-400);
  padding: 7px 14px; border: 1px solid var(--gray-200); border-radius: 30px;
  background: var(--white);
}
.rp-step b { width: 18px; height: 18px; border-radius: 50%; background: var(--gray-200); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; }
.rp-step.done { color: var(--gray-700); border-color: var(--gray-300); }
.rp-step.done b { background: var(--red-light); }
.rp-step.active { color: var(--red); border-color: var(--red); }
.rp-step.active b { background: var(--red); }

/* ---------- Grilles de sélection ---------- */
.rp-select-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: -0.01em;
  font-weight: 400; font-size: 1.6rem; color: var(--black); margin: 0 0 4px; }
.rp-select-sub { color: var(--gray-500); font-size: 0.95rem; margin: 0 0 22px; }

.rp-search { max-width: 420px; margin: 0 0 24px; position: relative; }
.rp-search input { width: 100%; padding: 13px 16px 13px 44px; border: 1px solid var(--gray-200);
  border-radius: 30px; font-family: var(--font); font-size: 0.95rem; color: var(--black); background: var(--white); }
.rp-search input:focus { outline: none; border-color: var(--red); }
.rp-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

/* Modèles avec photo */
.rp-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.rp-model { border: 1px solid var(--gray-200); border-radius: 16px; background: var(--white); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s; }
.rp-model:hover { border-color: var(--gray-400); box-shadow: 0 12px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.rp-model-photo { aspect-ratio: 16/10; background: var(--gray-100); overflow: hidden; position: relative; }
.rp-model-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.rp-model:hover .rp-model-photo img { transform: scale(1.05); }
.rp-model-photo.no-img { background: var(--gray-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%239C9CA8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l1.5-4.5A2 2 0 0 1 8.4 7h7.2a2 2 0 0 1 1.9 1.5L19 13'/%3E%3Cpath d='M5 13h14v4H5z'/%3E%3Ccircle cx='8' cy='17' r='1'/%3E%3Ccircle cx='16' cy='17' r='1'/%3E%3C/svg%3E") center no-repeat; }
.rp-model-info { padding: 13px 16px 15px; }
.rp-model-name { font-weight: 700; color: var(--black); font-size: 1.02rem; }

/* Listes (générations, moteurs) */
.rp-list { display: flex; flex-direction: column; gap: 10px; }
.rp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--gray-200); border-radius: 14px; background: var(--white);
  cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.rp-row:hover { border-color: var(--red); background: rgba(51,102,255,.03); transform: translateX(4px); }
.rp-row-main { min-width: 0; }
.rp-row-name { font-weight: 700; color: var(--black); font-size: 1rem; }
.rp-row-meta { color: var(--gray-500); font-size: 0.85rem; margin-top: 2px; }
.rp-row-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.rp-row-gain { font-size: 0.8rem; font-weight: 700; color: var(--red); white-space: nowrap; }
.rp-row-arrow { color: var(--gray-400); font-size: 1.2rem; }

/* Groupe carburant */
.rp-fuel-group { margin-bottom: 26px; }
.rp-fuel-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.rp-fuel-tag { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  font-size: 1.1rem; color: var(--black); }
.rp-fuel-line { flex: 1; height: 1px; background: var(--gray-200); }

/* ============================================
   PAGE RÉSULTATS (gains)
   ============================================ */
.rp-result-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-result-logo { width: 60px; height: 60px; object-fit: contain; filter: brightness(0); flex-shrink: 0; }
.rp-result-logo.logo-photo { filter: none; }
.rp-result-titles h1 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: -0.02em;
  font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.02; color: var(--black); margin: 0; }
.rp-result-engine { color: var(--gray-500); font-size: 1rem; margin-top: 6px; }
.rp-fuel-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 10px; border-radius: 20px; background: var(--gray-100); color: var(--gray-700); margin-left: 8px; }

/* Onglets de stage */
.rp-stage-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 22px; }
.rp-stage-tab { appearance: none; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-700);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600; padding: 9px 18px; border-radius: 30px; cursor: pointer; transition: .16s; }
.rp-stage-tab:hover { border-color: var(--gray-400); }
.rp-stage-tab.active { background: var(--black); border-color: var(--black); color: #fff; }

/* Panneaux de gains */
.rp-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rp-metric { border: 1px solid var(--gray-200); border-radius: 18px; padding: 24px; background: var(--white); }
.rp-metric-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.rp-metric-title { font-family: var(--font-display); text-transform: uppercase; font-size: 1.15rem; color: var(--black); letter-spacing: .01em; }
.rp-metric-unit { font-size: 0.78rem; color: var(--gray-400); font-weight: 600; }

.rp-bar-row { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; }
.rp-bar-label { font-size: 0.82rem; color: var(--gray-500); font-weight: 600; }
.rp-bar-track { height: 14px; background: var(--gray-100); border-radius: 8px; overflow: hidden; }
.rp-bar { height: 100%; border-radius: 8px; transform-origin: left; animation: rpGrow .7s var(--ease) both; }
.rp-bar-origin { background: var(--gray-300); }
.rp-bar-stage { background: var(--red); }
.rp-bar-val { font-size: 0.92rem; font-weight: 700; color: var(--black); font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }
@keyframes rpGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.rp-gain { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-100);
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--red); line-height: 1; }
.rp-gain span { font-size: 0.95rem; color: var(--gray-500); font-family: var(--font); font-weight: 600; margin-left: 8px; }

/* Bandeau prix + CTA */
.rp-cta-bar { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding: 24px 28px; border-radius: 20px; background: var(--black); color: #fff; }
.rp-cta-price { display: flex; flex-direction: column; gap: 3px; }
.rp-cta-price .lbl { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.6); }
.rp-cta-price .val { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.rp-cta-price .note { font-size: 0.78rem; color: rgba(255,255,255,.55); }
.rp-cta-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff;
  padding: 14px 28px; border-radius: 30px; font-weight: 700; font-size: 0.98rem; white-space: nowrap; }
.rp-cta-btn:hover { background: var(--red-light); }

/* Ce qui est inclus */
.rp-included { margin-top: 30px; }
.rp-included h2 { font-family: var(--font-display); text-transform: uppercase; font-size: 1.5rem; color: var(--black); margin: 0 0 16px; letter-spacing: -0.01em; }
.rp-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.rp-feat { display: flex; gap: 12px; padding: 16px 18px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--white); }
.rp-feat svg { color: var(--red); flex-shrink: 0; margin-top: 2px; }
.rp-feat-t { font-weight: 700; color: var(--black); font-size: 0.95rem; }
.rp-feat-d { color: var(--gray-600); font-size: 0.86rem; line-height: 1.45; margin-top: 2px; }

.rp-empty { color: var(--gray-500); text-align: center; padding: 48px 20px; }
.rp-loading { color: var(--gray-400); text-align: center; padding: 60px 20px; }

@media (max-width: 700px) {
  .rp-metrics { grid-template-columns: 1fr; }
  .rp-cta-bar { flex-direction: column; align-items: stretch; }
  .rp-cta-btn { justify-content: center; }
}

/* ---------- Transitions de navigation (client-side) ---------- */
#rpContent.rp-anim { animation: rpEnter .34s var(--ease) both; }
@keyframes rpEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Léger décalé sur les cartes / lignes lors de l'apparition */
#rpContent.rp-anim .rp-model,
#rpContent.rp-anim .brand-item,
#rpContent.rp-anim .rp-row {
  animation: rpItemIn .4s var(--ease) both;
}
@keyframes rpItemIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#rpContent.rp-anim .rp-model:nth-child(1),#rpContent.rp-anim .brand-item:nth-child(1),#rpContent.rp-anim .rp-row:nth-child(1){ animation-delay:.02s }
#rpContent.rp-anim .rp-model:nth-child(2),#rpContent.rp-anim .brand-item:nth-child(2),#rpContent.rp-anim .rp-row:nth-child(2){ animation-delay:.05s }
#rpContent.rp-anim .rp-model:nth-child(3),#rpContent.rp-anim .brand-item:nth-child(3),#rpContent.rp-anim .rp-row:nth-child(3){ animation-delay:.08s }
#rpContent.rp-anim .rp-model:nth-child(4),#rpContent.rp-anim .brand-item:nth-child(4),#rpContent.rp-anim .rp-row:nth-child(4){ animation-delay:.11s }
#rpContent.rp-anim .rp-model:nth-child(5),#rpContent.rp-anim .brand-item:nth-child(5),#rpContent.rp-anim .rp-row:nth-child(5){ animation-delay:.14s }
#rpContent.rp-anim .rp-model:nth-child(6),#rpContent.rp-anim .brand-item:nth-child(6),#rpContent.rp-anim .rp-row:nth-child(6){ animation-delay:.17s }
#rpContent.rp-anim .rp-model:nth-child(n+7),#rpContent.rp-anim .brand-item:nth-child(n+7),#rpContent.rp-anim .rp-row:nth-child(n+7){ animation-delay:.19s }

@media (prefers-reduced-motion: reduce) {
  .rp-bar { animation: none; }
  #rpContent.rp-anim, #rpContent.rp-anim .rp-model, #rpContent.rp-anim .brand-item, #rpContent.rp-anim .rp-row { animation: none; }
}
