/*
 * Styles généraux et variables pour l'application « Le Tri des Valeurs ».
 * Le design s'inspire d'une esthétique minimaliste avec des couleurs douces,
 * des formes arrondies et une typographie généreuse qui évoquent le site Studio Kyne.
 */

body {
  background-color: var(--neutral-100);
  color: var(--neutral-950);
  font: var(--f-t-m);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === STEP HEADING BLOCK === */
.step-heading {
  width: 100%;
  max-width: 840px;
  margin: 0 auto 2rem;
  text-align: center;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
}
.step-heading .step-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-bottom: 1.25rem;
}
.step-heading .step-label {
  font: var(--f-l-s);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--neutral-600);
}
.progress {
  position: relative;
  width: 240px;
  height: 8px;
  background: var(--neutral-300);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--emerald-400), var(--emerald-600));
  transition: width 0.5s var(--cubic);
}
.step-heading .step-title {
  margin: 0 0 0.75rem;
  font: var(--f-d-h5);
}
.step-heading .step-description {
  margin: 0;
  font: var(--f-t-l);
  color: var(--neutral-700);
  max-width: 640px;
  margin-inline: auto;
}

/* Compteur de cartes restantes */
.cards-remaining {
  margin: 1rem auto 0.5rem;
  font: var(--f-t-s);
  color: var(--neutral-600);
  text-align: center;
}

main {
  margin-top: var(--navbar-height);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  padding: 2rem;
  overflow: hidden;
}

.instructions {
  text-align: center;
  max-width: 600px;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Styles pour le conteneur de carte lors de l'étape de swipe */
.card-container {
  position: relative;
  width: 100%;
  max-width: 350px;
  height: 420px;
  margin: 0 auto;
}

.swipe-indicators {
  display: flex;
  position: absolute;
  top: 50%;
  gap: calc(350px + 4rem);
  justify-self: center;
}

.swipe-indicators span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font: var(--f-t-s);
  opacity: 0.6;
  user-select: none;
  color: var(--neutral-700);
}

/* Section de fin (message "terminé") */
.finish-section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(145deg, var(--green-100), var(--green-200));
  border: 1px solid var(--green-300);
  border-radius: 16px;
  box-shadow: 0 8px 28px -4px rgba(16, 185, 129, 0.35),
    0 4px 12px rgba(16, 185, 129, 0.2);
  opacity: 0;
  transform: scale(0.9) translateY(12px);
  pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity 0.55s var(--cubic), transform 0.55s var(--cubic);
  font: var(--f-t-l);
}
.finish-section .finish-icon {
  margin-bottom: 1rem;
  animation: pop-in 0.8s var(--cubic) 0.1s both;
}
.finish-section .finish-title {
  margin: 0 0 0.5rem;
  font: var(--f-h-h6);
  color: var(--green-900);
}
.finish-section .finish-text {
  margin: 0;
  font: var(--f-t-m);
  color: var(--green-800);
}
.finish-section svg {
  filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.35));
}

/* Affichage une fois activé via JS (display: block déjà défini inline) */
.finish-section.show,
.finish-section[style*="flex"] {
  /* heuristique simple */
  opacity: 1;
  transform: scale(1) translateY(0);
}

@keyframes pop-in {
  0% {
    transform: scale(0.4) rotate(-8deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.05) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem 2.5rem;
  font: var(--f-h-h6);
  text-align: center;
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
  transition: transform 0.35s var(--cubic), opacity 0.35s var(--cubic),
    box-shadow 0.25s var(--cubic), border-color 0.25s var(--cubic),
    background-color 0.25s var(--cubic);
  /* Ombre par défaut neutralisée, on l'appliquera seulement aux 5 cartes supérieures */
  box-shadow: none;
  /* Variables pour le gradient animé */
  --swipe-right-alpha: 0;
  --swipe-left-alpha: 0;
}

/* Ombre douce uniquement sur les 5 premières cartes empilées (visuellement en haut de pile) */
.card-container .card:nth-child(-n + 5) {
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.05);
}

/* (Supprimé) ancien léger décalage générique */

.card.moving {
  transition: none;
}

/* Etat après validation / rejet */
.card.accepted {
  border-color: var(--green-400);
  box-shadow: 0 12px 28px -6px rgba(34, 197, 94, 0.45),
    0 4px 8px -2px rgba(34, 197, 94, 0.3);
}
.card.rejected {
  border-color: var(--red-400);
  box-shadow: 0 12px 28px -6px rgba(239, 68, 68, 0.45),
    0 4px 8px -2px rgba(239, 68, 68, 0.3);
}
.card.gone {
  pointer-events: none;
}

/* Contenu interne de la carte */
.card-content {
  width: 100%;
  z-index: 1;
}
.value-title {
  margin: 1.25rem 0 0.75rem;
  font: var(--f-h-h6);
}

.value-emoji{
  font-size: 2rem;
}

.card-instruction {
  margin: 0;
  font: var(--f-t-s);
  opacity: 0.65;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

/* Badges Tinder style */
.card .badge {
  position: absolute;
  top: 16px;
  padding: 6px 14px 7px;
  font: var(--f-l-s);
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: var(--neutral-100);
  opacity: 0;
  transform: rotate(-8deg) scale(0.9);
  transition: opacity 120ms var(--cubic), transform 160ms var(--cubic);
  pointer-events: none;
  mix-blend-mode: normal;
}
.card .badge-yes {
  left: 16px;
  color: var(--green-600);
}
.card .badge-nope {
  right: 16px;
  color: var(--red-600);
  transform: rotate(8deg) scale(0.9);
}
.card.drag-right .badge-yes,
.card.drag-left .badge-nope {
  opacity: 0.3;
}
.card.drag-right-strong .badge-yes {
  opacity: 1;
  transform: rotate(-4deg) scale(1);
}
.card.drag-left-strong .badge-nope {
  opacity: 1;
  transform: rotate(4deg) scale(1);
}

/* Dégradé de feedback visuel (overlay via pseudo) */
/* Overlay gradient dynamique (double couche droite/gauche + intensité progressive) */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms var(--cubic), transform 240ms var(--cubic);
  transform: scale(0.85);
}
.card.drag-right::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(34, 197, 94, 0.45) 0%,
    rgba(34, 197, 94, 0.3) 18%,
    rgba(34, 197, 94, 0.1) 38%,
    rgba(34, 197, 94, 0) 60%
  );
  filter: blur(18px);
  opacity: 0;
  transform: scale(1);
}
.card.drag-left::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(239, 68, 68, 0.45) 0%,
    rgba(239, 68, 68, 0.3) 18%,
    rgba(239, 68, 68, 0.1) 38%,
    rgba(239, 68, 68, 0) 60%
  );
  filter: blur(18px);
  opacity: 0;
  transform: scale(1);
}
.card.drag-right-strong::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(34, 197, 94, 0.6) 0%,
    rgba(34, 197, 94, 0.38) 20%,
    rgba(34, 197, 94, 0.16) 44%,
    rgba(34, 197, 94, 0) 68%
  );
  filter: blur(22px) saturate(1.1);
  opacity: 0.8;
  transform: scale(1.05);
}
.card.drag-left-strong::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(239, 68, 68, 0.6) 0%,
    rgba(239, 68, 68, 0.38) 20%,
    rgba(239, 68, 68, 0.16) 44%,
    rgba(239, 68, 68, 0) 68%
  );
  filter: blur(22px) saturate(1.1);
  opacity: 0.8;
  transform: scale(1.05);
}

/* Effet de stacking supprimé (cartes superposées simplement) */

/* Accessibilité: renforce le contraste quand accepté / rejeté en glissé fort */
.card.drag-right-strong {
  border-color: var(--green-500);
}
.card.drag-left-strong {
  border-color: var(--red-500);
}

.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  background-color: var(--neutral-950);
  color: var(--white);
  font: var(--f-t-m);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--cubic);
  margin-top: 1rem;
  border: none;
}

.button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.button:hover:not(:disabled) {
  background-color: var(--neutral-800);
}

/* Styles pour l'étape de sélection */
.values-grid {
  --col-min: 150px;
  --gap: 18px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--col-min), 1fr));
  gap: var(--gap);
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: 0 1.25rem 2.5rem;
}

/* Amélioration cartes sélection étape 2 */
.value-card {
  --accent: var(--emerald-500);
  position: relative;
  background: linear-gradient(145deg, var(--neutral-100), var(--neutral-50));
  border: 1px solid var(--neutral-200);
  border-radius: 14px;
  padding: 1.1rem 0.75rem 1rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font: var(--f-t-m);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 180ms var(--cubic), background 280ms var(--cubic),
    box-shadow 240ms var(--cubic), transform 160ms var(--cubic),
    color 200ms var(--cubic);
  min-height: 88px;
  line-height: 1.25;
  color: var(--neutral-800);
  outline: none;
}
.value-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 220ms var(--cubic), transform 300ms var(--cubic);
  pointer-events: none;
}
.value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px -2px rgba(0, 0, 0, 0.06),
    0 4px 10px -2px rgba(0, 0, 0, 0.04);
  border-color: var(--neutral-300);
}
.value-card:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.12);
}
.value-card:focus-visible {
  box-shadow: 0 0 0 4px var(--emerald-200), 0 8px 22px -2px rgba(0, 0, 0, 0.06);
  border-color: var(--emerald-400);
}
.value-card.selected {
  background: linear-gradient(150deg, var(--emerald-100), var(--emerald-50));
  border-color: var(--emerald-400);
  color: var(--emerald-800);
  box-shadow: 0 10px 26px -6px rgba(16, 185, 129, 0.35),
    0 4px 12px -4px rgba(16, 185, 129, 0.25);
}
.value-card.selected::before {
  opacity: 1;
  transform: scale(1);
}
.value-card.selected:hover {
  border-color: var(--emerald-500);
}

/* Badge indicateur sélection (ajout dynamique possible) */
.value-card .check-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--emerald-500);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.5);
  opacity: 0;
  transform: scale(0.6) translateY(-4px);
  transition: opacity 220ms var(--cubic), transform 380ms var(--cubic);
  pointer-events: none;
}
.value-card.selected .check-badge {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Compteur sélection amélioré */
.selection-count {
  font: var(--f-t-s);
  color: var(--neutral-600);
  margin: 0.25rem 0 0;
}

/* Etat limite atteint (10) -> styles appliqués aux non-sélectionnées via classe parent ajoutée en JS possible .limit-reached */
.values-grid.limit-reached .value-card:not(.selected) {
  opacity: 0.55;
  filter: saturate(0.6);
}
.values-grid.limit-reached .value-card:not(.selected):hover {
  transform: none;
  box-shadow: none;
}

@media (max-width: 780px) {
  .values-grid {
    --col-min: 130px;
    --gap: 14px;
  }
  .value-card {
    min-height: 82px;
    font: var(--f-t-s);
  }
}
@media (max-width: 520px) {
  .values-grid {
    --col-min: 46%;
  }
  .value-card {
    padding: 0.95rem 0.65rem 0.85rem;
  }
}

#selection-count {
  margin-top: 8px;
}

/* Styles pour la liste ordonnable */
.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 600px;
}

.sortable-list li {
  --pad-y: 0.9rem;
  --pad-x: 1.15rem;
  position: relative;
  background: linear-gradient(145deg, var(--neutral-100), var(--neutral-50));
  border: 1px solid var(--neutral-200);
  border-radius: 14px;
  padding: var(--pad-y) var(--pad-x) var(--pad-y) calc(var(--pad-x) + 2.65rem);
  margin-bottom: 14px;
  font: var(--f-t-l);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: grab;
  transition: box-shadow 180ms var(--cubic), transform 160ms var(--cubic),
    border-color 200ms var(--cubic), background 280ms var(--cubic);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.08);
}
.sortable-list li::before {
  counter-increment: rank-counter;
  content: counter(rank-counter);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  translate: 0 -50%;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--neutral-200);
  color: var(--neutral-700);
  font: var(--f-l-s);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--neutral-300);
  transition: background 200ms var(--cubic), color 200ms var(--cubic),
    box-shadow 200ms var(--cubic);
}
.sortable-list {
  counter-reset: rank-counter;
}
.sortable-list li:nth-child(-n + 5)::before {
  background: var(--emerald-500);
  color: var(--white);
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45);
}
.sortable-list li:nth-child(-n + 5) {
  border-color: var(--emerald-300);
  background: linear-gradient(150deg, var(--emerald-100), var(--emerald-50));
}
.sortable-list li:hover {
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.18);
  transform: translateY(-3px);
}
.sortable-list li:active {
  transform: translateY(-1px) scale(0.99);
}
.sortable-list li.dragging {
  opacity: 0.65;
  box-shadow: 0 10px 22px -6px rgba(0, 0, 0, 0.28);
  border-style: dashed;
}
.sortable-list li.top-five {
  background: linear-gradient(150deg, var(--emerald-100), var(--emerald-50));
  border-color: var(--emerald-300);
}
.sortable-list li:focus-visible {
  outline: 3px solid var(--emerald-400);
  outline-offset: 2px;
}

.drag-handle {
  cursor: grab;
  margin-left: auto;
  font-size: 0.95rem;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  transition: background 180ms var(--cubic), opacity 180ms var(--cubic);
}
.drag-handle svg {
  width: 20px;
  height: 20px;
}
.sortable-list li:hover .drag-handle {
  opacity: 1;
  background: var(--neutral-200);
}
.sortable-list li.dragging .drag-handle {
  cursor: grabbing;
}

@media (max-width: 640px) {
  .sortable-list li {
    font: var(--f-t-m);
    padding: 0.85rem 1rem 0.85rem calc(1rem + 2.4rem);
  }
  .sortable-list li::before {
    left: 0.65rem;
    width: 1.85rem;
    height: 1.85rem;
    font: var(--f-l-xs);
  }
}

/* Résumé final */
.summary {
  width: 100%;
  max-width: 800px;
}

.summary-item {
  background-color: var(--neutral-200);
  border-radius: 8px;
  border: 1px solid var(--neutral-300);
  padding: 20px;
  margin-bottom: 16px;
}

.summary-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.summary-item p {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

/* Petits écrans */
@media (max-width: 480px) {
  .card-container {
    max-width: 280px;
    height: 380px;
  }
  .card {
    font-size: 1.3rem;
  }
  .sortable-list li {
    font-size: 1rem;
  }
}

/* FORM STYLE */
.form-container {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  justify-content: center;
  align-items: center;
}
.form-container.show-popup {
  display: flex;
}
.form-container iframe {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* === RANKING (NOUVELLE VERSION) === */
.rank-wrapper {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  width: 100%;
  max-width: 1080px;
  padding: 0 1.25rem 3rem;
}
@media (max-width: 860px) {
  .rank-wrapper {
    flex-direction: column;
    gap: 2.25rem;
  }
}
.rank-zone,
.pool-zone {
  flex: 1;
  min-width: 0;
}
.rank-subtitle {
  margin: 0 0 0.75rem;
  font: var(--f-h-h6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#rank-count {
  font: var(--f-l-s);
  background: var(--neutral-200);
  padding: 4px 10px;
  border-radius: 16px;
  color: var(--neutral-700);
  text-wrap: nowrap;
}
.rank-list,
.pool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 220px;
}
.pool-list {
  flex-wrap: wrap;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  min-height: 0;
}

.rank-item,
.pool-item {
  position: relative;
  background: linear-gradient(145deg, var(--neutral-100), var(--neutral-50));
  border: 1px solid var(--neutral-200);
  border-radius: 14px;
  padding: 0.85rem 1rem 0.9rem 3.1rem;
  font: var(--f-t-m);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.18s var(--cubic), border-color 0.2s var(--cubic),
    background 0.3s var(--cubic);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 60px;
}
.pool-item {
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  justify-content: center;
  text-align: center;
}
.rank-item:before {
  counter-increment: rank-pos;
  content: counter(rank-pos);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  translate: 0 -50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font: var(--f-l-s);
  color: var(--neutral-700);
  box-shadow: inset 0 0 0 1px var(--neutral-300);
  transition: background 0.25s var(--cubic), color 0.25s var(--cubic);
}
.rank-list {
  counter-reset: rank-pos;
}
.rank-item:nth-child(-n + 5):before {
  background: var(--emerald-500);
  color: var(--white);
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45);
}
.rank-item.top-five {
  background: linear-gradient(145deg, var(--emerald-100), var(--emerald-50));
  border-color: var(--emerald-300);
}
.rank-item:hover {
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.18);
}
.pool-item:hover {
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.18);
}
.rank-item.dragging {
  opacity: 0.7;
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.28);
  cursor: grabbing;
}
.rank-placeholder {
  border: 2px dashed var(--emerald-400);
  background: var(--emerald-100);
  height: 60px;
  border-radius: 12px;
  animation: pulsePlace 1.2s ease-in-out infinite;
}
@keyframes pulsePlace {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.9;
  }
}
.rank-hint,
.pool-hint {
  margin: 0.75rem 0;
  font: var(--f-t-xs);
  color: var(--neutral-600);
}
.rank-list.empty::after {
  content: "Glissez vos 3 à 5 valeurs ici";
  font: var(--f-t-s);
  color: var(--neutral-500);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px dashed var(--neutral-300);
  border-radius: 12px;
  background: var(--neutral-100);
}
.pool-item.adding {
  animation: popIn 0.45s var(--cubic);
}
.rank-item.removing {
  animation: fadeShrink 0.35s var(--cubic) forwards;
}
@keyframes fadeShrink {
  to {
    opacity: 0;
    transform: scale(0.85);
  }
}
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
.rank-item:focus-visible,
.pool-item:focus-visible {
  outline: 3px solid var(--emerald-400);
  outline-offset: 2px;
}
.order-buttons {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-btn {
  background: var(--neutral-200);
  border: 1px solid var(--neutral-300);
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--cubic), border-color 0.2s var(--cubic),
    opacity 0.2s var(--cubic);
}
.order-btn svg {
  width: 14px;
  height: 14px;
}
.order-btn:hover:not(:disabled) {
  background: var(--neutral-300);
}
.order-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rank-max-reached .pool-item:not(.selected) {
  opacity: 0.55;
  pointer-events: none;
}
.rank-max-reached .pool-hint::after {
  content: " (limite atteinte)";
  color: var(--red-600);
}
#finish:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#sib-container input:-ms-input-placeholder {
  text-align: left;
  font-family: Inter, webFonts;
  color: #c0ccda;
}

#sib-container input::placeholder {
  text-align: left;
  font-family: Inter, webFonts;
  color: #c0ccda;
}

#sib-container textarea::placeholder {
  text-align: left;
  font-family: Inter, webFonts;
  color: #c0ccda;
}

#sib-container a {
  text-decoration: underline;
  color: #ff4b0a;
}

/* === SUMMARY PAGE ENHANCEMENTS === */
.results-heading {
  margin-top: 1rem;
}
.celebration-icon {
  font-size: 3rem;
  line-height: 1;
  animation: pop-celebration 1s var(--cubic);
}
@keyframes pop-celebration {
  0% {
    transform: scale(0.4) rotate(-10deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.05) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.summary-grid {
  width: 100%;
  max-width: 1080px;
  padding: 0 1.25rem 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.summary-card {
  position: relative;
  background: linear-gradient(145deg, var(--neutral-100), var(--neutral-50));
  border: 1px solid var(--neutral-200);
  border-radius: 20px;
  padding: 1.5rem 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 26px -8px rgba(0, 0, 0, 0.08),
    0 4px 14px -6px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.6s var(--cubic), transform 0.6s var(--cubic),
    box-shadow 0.3s var(--cubic);
}
.summary-card.appear {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.summary-card:hover {
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.14),
    0 6px 18px -8px rgba(0, 0, 0, 0.08);
}
.summary-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-content: flex-start;
  padding: 1rem 0;
}
.summary-rank {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--emerald-500);
  color: var(--white);
  font: var(--f-l-m);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(16, 185, 129, 0.55);
}
.summary-card[data-rank="1"] .summary-rank {
  background: var(--amber-500);
  box-shadow: 0 6px 18px -6px rgba(245, 158, 11, 0.55);
}
.summary-card[data-rank="2"] .summary-rank {
  background: var(--sky-500);
  box-shadow: 0 6px 18px -6px rgba(14, 165, 233, 0.55);
}
.summary-card[data-rank="3"] .summary-rank {
  background: var(--violet-500);
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, 0.55);
}
/* Styles rang 4 et 5 (si présents) */
.summary-card[data-rank="4"] .summary-rank {
  background: var(--pink-500);
  box-shadow: 0 6px 18px -6px rgba(236, 72, 153, 0.55);
}
.summary-card[data-rank="5"] .summary-rank {
  background: var(--emerald-500);
  box-shadow: 0 6px 18px -6px rgba(16, 185, 129, 0.55);
}
.summary-title {
  margin: 0;
  font: var(--f-h-h6);
  line-height: 1.1;
}
.summary-description {
  margin: 0;
  font: var(--f-t-m);
  color: var(--neutral-700);
}
.summary-example {
  margin: 1rem 0 0;
  font: var(--f-t-s);
  color: var(--neutral-800);
}

.cta-wrapper {
  width: 100%;
  max-width: 1080px;
  padding: 0 1.25rem 4rem;
}
.cta-card {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
  background: linear-gradient(150deg, var(--neutral-50), var(--neutral-100));
  border-radius: 2rem;
  padding: 2.4rem clamp(1.2rem, 3vw, 2.8rem) 2.75rem;
  border: 1px solid var(--neutral-200);
  box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.05),
    0 18px 42px -18px rgba(29, 24, 234, 0.28),
    0 2px 4px -1px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  backdrop-filter: blur(8px) saturate(1.4);
}
.cta-card:before,
.cta-card:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(75, 71, 238, 0.18),
    rgba(75, 71, 238, 0)
  );
  mix-blend-mode: normal;
}
.cta-card:before {
  width: 520px;
  height: 520px;
  top: -260px;
  right: -180px;
  user-select: none;
  z-index: -1;
}
.cta-card:after {
  width: 340px;
  height: 340px;
  bottom: -170px;
  left: -140px;
  user-select: none;
  z-index: -1;
}
.cta-title {
  margin: 0;
  font: var(--f-h-h6);
  letter-spacing: 0.5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.cta-text {
  margin: 0;
  font: var(--f-t-l);
  max-width: 760px;
  color: var(--neutral-800);
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.cta-card .button {
  margin-top: 0;
  font: var(--f-t-m);
  padding: 0.85rem 1.35rem;
}
/* Variantes boutons (accent secondary) */
.cta-card .button.primary {
  background: linear-gradient(
    90deg,
    var(--secondary-500),
    var(--secondary-600)
  );
  color: var(--white);
  box-shadow: 0 4px 16px -4px rgba(29, 24, 234, 0.45);
}
.cta-card .button.primary:hover {
  background: linear-gradient(
    90deg,
    var(--secondary-600),
    var(--secondary-500)
  );
}
.cta-card .button.secondary {
  background: linear-gradient(var(--white), var(--white)) padding-box,
    linear-gradient(120deg, var(--secondary-300), var(--secondary-500))
      border-box;
  border: 2px solid transparent;
  color: var(--secondary-700);
  box-shadow: 0 2px 10px -2px rgba(29, 24, 234, 0.25);
}
.cta-card .button.secondary:hover {
  color: var(--secondary-800);
  box-shadow: 0 4px 16px -6px rgba(29, 24, 234, 0.35);
}

/* Nouveaux boutons CTA */
.cta-actions {
  gap: 1rem;
  flex-direction: column;
  align-items: flex-start;
}
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.cta-card .button.brand-btn {
  background: linear-gradient(
        var(--neutral-0, var(--neutral-50)),
        var(--neutral-100)
      )
      padding-box,
    linear-gradient(160deg, var(--secondary-400), var(--secondary-600))
      border-box;
  border: 2px solid transparent;
  color: var(--secondary-700);
  font-weight: 600;
  box-shadow: 0 4px 18px -6px rgba(29, 24, 234, 0.35);
}
.cta-card .button.brand-btn:hover {
  background: linear-gradient(var(--neutral-100), var(--neutral-200))
      padding-box,
    linear-gradient(160deg, var(--secondary-500), var(--secondary-600))
      border-box;
  color: var(--secondary-800);
  box-shadow: 0 8px 26px -10px rgba(29, 24, 234, 0.45);
}
.share-btn {
  color: var(--neutral-800);
  background-color: var(--neutral-200);
  transition: all 200ms var(--cubic);
}
.share-btn:hover {
  background-color: var(--neutral-300) !important;
  transition: all 200ms var(--cubic);
}

/* Avatar Buttons */
.avatar-buttons {
  gap: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.follow-label {
  font: var(--f-l-xs);
  background-color: var(--neutral-100);
  border: 1px solid transparent;
  color: var(--secondary-700);
  padding: 0.55rem 0.85rem 0.5rem;
  border-radius: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  line-height: 1;
  box-shadow: 0 2px 6px -2px rgba(29, 24, 234, 0.25);
  animation: fadeInFollow 0.6s var(--cubic);
}
@keyframes fadeInFollow {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.avatar-btn {
  --size: 64px;
  width: var(--size);
  height: var(--size);
  border-radius: 8px;
  border: #c0ccda 2px solid;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid transparent;
  transition: all 200ms var(--cubic);
}
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -10px rgba(29, 24, 234, 0.45);
}
.avatar-btn:active {
  transform: translateY(-1px) scale(0.97);
}
.avatar-btn:focus-visible {
  outline: 3px solid var(--secondary-300);
  outline-offset: 4px;
}
.ownyourbrand-button {
  display: flex;
  padding: 0.625rem 0.625rem 0.625rem 1rem;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  border-radius: 100vmax;
  background: var(--secondary-500);
  box-shadow: 0 -4px 4px 0 rgba(0, 0, 0, 0.05) inset,
    0 4px 6px 0 rgba(255, 255, 255, 0.15) inset;
  font: var(--f-label-m);
  color: var(--white);
  transition: var(--t300);
}

.ownyourbrand-cta-arrow-wrapper {
  padding: 0.375rem;
  border-radius: 100vmax;
  background-color: var(--white);
  color: var(--secondary-500);
  overflow: hidden;
  position: relative;
  place-items: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
}

.ownyourbrand-cta-arrow-1 {
  position: absolute;
  transform-origin: center;
  transform: translate(0%, 0%);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.ownyourbrand-cta-arrow-2 {
  position: absolute;
  transform-origin: center;
  transform: translate(-150%, 150%);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.ownyourbrand-cta-arrow:hover .ownyourbrand-cta-arrow-1 {
  transform: translate(100%, -100%);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.ownyourbrand-cta-arrow:hover .ownyourbrand-cta-arrow-2 {
  transform: translate(0%, 0%);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.ownyourbrand-button:hover {
  background: var(--secondary-400);
  /* box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.05) inset,
    0 -4px 6px 0 rgba(255, 255, 255, 0.15) inset; */
}
.left {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

@media (min-width: 680px) {
  .cta-actions {
    flex-direction: row;
    align-items: flex-start;
    z-index: 1;
  }
  .cta-group.main-buttons {
    flex: 3;
  }
  .cta-group.avatar-buttons {
    flex: 1;
    justify-content: flex-end;
    display: flex;
  }
}
@media (max-width: 520px) {
  .cta-group.main-buttons {
    flex-direction: column;
    width: 100%;
  }
  .cta-card .button {
    width: 100%;
  }
  .avatar-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  #step2-next {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4);
    z-index: 100;
    text-wrap: nowrap;
    background-color: var(--neutral-800);
  }
  #step2-next:disabled {
    background-color: var(--neutral-400);
    color: var(--neutral-300);
    opacity: 1;
  }
  .values-grid {
    margin-bottom: 4rem;
  }

  .swipe-indicators {
    display: none;
  }
  .step-description {
    font: var(--f-t-m) !important;
  }
  .step-heading {
    gap: 0.5rem;
    margin: 0 auto 1rem;
  }
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .cta-card {
    padding: 2rem 1.4rem 2.2rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .avatar-buttons {
    justify-content: center;
  }
  .cta-text {
    font: var(--f-t-m);
  }
  .summary-rank {
    width: 40px;
    height: 40px;
  }
  .pool-zone {
    width: 100%;
  }
}
@media (max-width: 520px) {
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-card .button {
    width: 100%;
  }
  .summary-grid {
    gap: 1rem;
  }
}
