/* Tutoriel visuel « Comment ça marche » — diaporama type PowerPoint.
   Réutilise les couleurs de marque RM (vert #167a52, encre #263544, or #C99A32). */

.ccm-tuto {
  --ccm-green: #167a52;
  --ccm-green-soft: #23a86f;
  --ccm-ink: #263544;
  --ccm-muted: #61717c;
  --ccm-line: #e2e9ef;
  --ccm-gold: #C99A32;
  margin: 22px 0 34px;
}

.ccm-tuto-window {
  position: relative;
  border: 1px solid #dbe3df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 30, 40, 0.10);
  overflow: hidden;
}

.ccm-tuto-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f3f6f8;
  border-bottom: 1px solid #e6ecf0;
}
.ccm-tuto-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d7dee3;
}
.ccm-tuto-bar span:nth-child(1) { background: #f0b85a; }
.ccm-tuto-bar span:nth-child(2) { background: #b9c4cd; }
.ccm-tuto-bar span:nth-child(3) { background: #9fd3b8; }
.ccm-tuto-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  color: #97a4ae;
}

.ccm-tuto-stage {
  position: relative;
  min-height: 600px;
  background: #eef1f4;
}

.ccm-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 22px 100px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform: translateY(6px);
}
.ccm-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---- Mockups internes ---- */

.ccm-mock {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.ccm-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  padding: 5px 5px 5px 14px;
  box-shadow: 0 1px 3px rgba(20, 30, 40, 0.06);
}
.ccm-search-box .ccm-search-ico { color: #97a4ae; flex: 0 0 auto; }
.ccm-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ccm-ink);
  padding: 11px 0;
  font-size: 0.9rem;
}
.ccm-search-box button {
  border: 0;
  background: var(--ccm-gold);
  color: #fff;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Carte « fiche confirmée » (étape bouton vert). */
.ccm-confirmed {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  background: #fff;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(20, 30, 40, 0.06);
  text-align: left;
}
.ccm-confirmed div { border-left: 3px solid #dcefe6; padding-left: 9px; min-width: 0; }
.ccm-confirmed dt { font-size: 0.72rem; color: var(--ccm-muted); }
.ccm-confirmed dd { margin: 3px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--ccm-ink); overflow-wrap: anywhere; }

/* ---- Hotspots (ronds à regarder) ---- */

.ccm-hotspot {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ccm-green);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(20, 30, 40, 0.28);
  transform: translate(-50%, -50%);
}
.ccm-hotspot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ccm-green);
  animation: ccm-pulse 1.8s ease-out infinite;
}
/* Ancrage : le rond est placé sur un coin de l'élément qu'il annote. */
.ccm-anchor { position: relative; }
.ccm-hotspot--tl { top: -8px; left: -8px; transform: none; }
.ccm-hotspot--tr { top: -8px; right: -8px; transform: none; }
@keyframes ccm-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ---- Légende qui apparaît sur l'image ---- */

.ccm-caption {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(6px);
  width: min(520px, calc(100% - 32px));
  background: rgba(24, 40, 58, 0.92);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ccm-slide.is-active .ccm-caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ccm-caption strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 3px;
}
.ccm-caption span {
  display: block;
  font-size: 0.82rem;
  color: #cdd8e0;
  line-height: 1.45;
}

/* ---- Contrôles (ronds de navigation) ---- */

.ccm-tuto-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.ccm-nav {
  width: 40px;
  height: 40px;
  border: 1px solid #dbe3df;
  border-radius: 50%;
  background: #fff;
  color: var(--ccm-ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ccm-nav:hover { background: var(--ccm-green); color: #fff; border-color: var(--ccm-green); }
.ccm-dots { display: flex; gap: 10px; }
.ccm-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #cdd7de;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ccm-dot:hover { background: #aebcc6; }
.ccm-dot.is-active {
  background: var(--ccm-green);
  transform: scale(1.25);
}
.ccm-tuto-progress {
  text-align: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--ccm-muted);
}

/* Fenêtre de comparaison fidèle au produit (étape 2 : score + cartes + détails). */
.ccm-compare-dialog {
  width: min(580px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  border: 1px solid #dbe3df;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 4px 18px rgba(20, 30, 40, 0.08);
}
.ccm-vote-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #e2e9ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(20, 30, 40, 0.06);
}
.ccm-vote-btns { display: flex; gap: 6px; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; }
.ccm-vote-btns .vote-decision-btn { flex: 1 1 0; max-width: none; padding: 8px 10px; }
.ccm-vote-btns .vote-text { font-size: 0.72rem; }
.ccm-score { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; flex: 0 0 auto; }
.ccm-score-value { font-size: 1.9rem; font-weight: 800; color: #2f6b17; letter-spacing: -0.01em; }
.ccm-score-value span { font-size: 1rem; font-weight: 700; }
.ccm-score-label { font-size: 0.72rem; color: #61717c; text-transform: uppercase; letter-spacing: 0.04em; }
.ccm-maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ccm-map-box {
  position: relative;
  height: 100px;
  border: 1px solid #d4ded6;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
    repeating-linear-gradient(0deg, #d7e1d0 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, #d7e1d0 0 1px, transparent 1px 24px),
    #e8efe4;
}
.ccm-maps iframe {
  width: 100%;
  height: 100px;
  border: 0;
  border-radius: 6px;
}
.ccm-tile-map {
  position: relative;
  height: 100px;
  border: 1px solid #d4ded6;
  border-radius: 6px;
  overflow: hidden;
  background: #dbe4ea;
}
.ccm-tile-tiles { position: absolute; inset: 0; }
.ccm-tile-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
}
.ccm-tile-tiles .ccm-tile-overlay { opacity: 0.85; }
.ccm-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b42318;
  box-shadow: 0 0 0 2px #b42318, 0 6px 12px rgba(20, 30, 40, 0.28);
  transform: translate(-50%, -50%);
}
.ccm-map-label {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #44525e;
  font-size: 0.62rem;
}
.ccm-detail-rows {
  background: #fff;
  border: 1px solid #e2e9ef;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}
.ccm-detail-rows p { margin: 0 0 6px; font-size: 0.85rem; color: #263544; }
.ccm-detail-rows p:last-child { margin: 0; }
.ccm-detail-rows strong { color: #44525e; }

/* Légende numérotée (étape 2) : chaque rond de la fenêtre est expliqué. */
.ccm-mock--search { width: min(520px, 100%); }
.ccm-mock--compare { width: min(580px, 100%); }
.ccm-legend {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e9ef;
  border-radius: 8px;
  text-align: left;
  display: grid;
  gap: 5px;
}
.ccm-legend li { display: flex; gap: 8px; align-items: baseline; font-size: 0.78rem; color: #263544; line-height: 1.35; }
.ccm-legend b {
  flex: 0 0 auto;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ccm-green);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
}

/* Astuce « coller » (étape 1). */
.ccm-paste-hint {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f3ec;
  color: var(--ccm-green);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 620px) {
  .ccm-tuto-stage { min-height: 420px; max-height: 60vh; }
  .ccm-slide { padding: 18px 12px; justify-content: flex-start; overflow-y: auto; }
  .ccm-confirmed { grid-template-columns: 1fr; }
  .ccm-caption { position: relative; left: auto; bottom: auto; transform: none; width: 100%; margin-top: 14px; }
  .ccm-slide.is-active .ccm-caption { transform: none; }
  .ccm-vote-panel { flex-direction: column; align-items: stretch; }
  .ccm-vote-btns { flex-wrap: wrap; }
  .ccm-vote-btns .vote-decision-btn { flex: 1 1 30%; }
  .ccm-score { flex-direction: row; gap: 8px; align-items: baseline; }
  .ccm-maps { grid-template-columns: 1fr; }
}
