/* Override pour matcher la DA globale du site QUIZ 2027 */

body {
  background:
    radial-gradient(circle at 16% 12%, rgba(92,141,255,.18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(215,180,106,.12), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(92,141,255,.08), transparent 34%),
    linear-gradient(145deg, #07020f, #081326 55%, #02040a) !important;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif !important;
}

/* Questions adaptatives - jamais tronquées */
.quiz-shell h2 {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  font-size: clamp(18px, 2.4vw, 28px) !important;
  line-height: 1.25 !important;
  max-width: 100% !important;
  word-wrap: break-word;
  hyphens: auto;
  margin-bottom: 20px !important;
  animation: fadeInUp .4s ease forwards;
}

@media (max-width: 900px) {
  .quiz-shell h2 {
    font-size: clamp(18px, 5vw, 24px) !important;
  }
}

@media (max-width: 560px) {
  .quiz-shell h2 {
    font-size: clamp(17px, 5.5vw, 22px) !important;
  }
}

/* Réponses plus compactes et animées */
.answers {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.answers button {
  font-size: 14.5px !important;
  padding: 14px 18px !important;
  line-height: 1.45 !important;
  animation: fadeInUp .35s ease backwards;
}

.answers button:nth-child(1) { animation-delay: .05s; }
.answers button:nth-child(2) { animation-delay: .10s; }
.answers button:nth-child(3) { animation-delay: .15s; }
.answers button:nth-child(4) { animation-delay: .20s; }
.answers button:nth-child(5) { animation-delay: .25s; }
.answers button:nth-child(6) { animation-delay: .30s; }

@media (max-width: 560px) {
  .answers button {
    font-size: 13.5px !important;
    padding: 12px 14px !important;
  }
}

/* Topbar mobile : boutons toujours visibles */
@media (max-width: 720px) {
  .topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
  }
  .topbar-actions {
    justify-content: center !important;
  }
  .brand {
    align-self: center !important;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 16px, 1080px) !important;
    padding: 16px 0 40px !important;
  }
  .quiz-shell {
    padding: 18px !important;
  }
  .hero {
    padding: 24px !important;
  }
  .quiz-meta {
    font-size: 10px !important;
  }
  .quiz-meta span {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 14px 40px rgba(92,141,255,.22); }
  50% { box-shadow: 0 18px 50px rgba(92,141,255,.40); }
}

.btn.primary {
  animation: glowPulse 3s ease-in-out infinite;
}

.btn.primary:hover {
  animation: none;
}

#progressBar {
  position: relative;
  overflow: hidden;
}

#progressBar::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.quiz-shell, .hero, .results-shell {
  animation: scaleIn .5s ease;
}

.brand {
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  background: rgba(7, 10, 20, .60);
  backdrop-filter: blur(18px);
}

.brand-mark {
  border-radius: 10px !important;
  transform: rotate(-4deg);
}

.brand strong {
  font-size: 13px;
  letter-spacing: .09em;
}

.brand small {
  color: #8fb3ff;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.back-link, .btn-back {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #b5bdce;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s;
}

.back-link:hover, .btn-back:hover {
  background: rgba(255,255,255,.08);
}

.soutenir-link {
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4f7b, #ffab00);
  color: #111;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(255,79,123,.22);
  transition: transform .2s, box-shadow .2s;
}

.soutenir-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255,79,123,.32);
}

.hero, .quiz-shell, .results-shell {
  border-radius: 34px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    rgba(4, 6, 14, .78) !important;
  box-shadow: 0 34px 120px rgba(0,0,0,.5) !important;
}

.hero::before, .quiz-shell::before, .results-shell::before {
  display: none !important;
}

.overline {
  color: #5c8dff !important;
}

h1 {
  letter-spacing: -.06em !important;
}

.btn.primary {
  border-radius: 18px !important;
  background: linear-gradient(135deg, #5c8dff, #8fb3ff) !important;
  border: none !important;
  color: #111 !important;
  box-shadow: 0 14px 40px rgba(92,141,255,.22) !important;
}

.btn.primary:hover {
  box-shadow: 0 18px 50px rgba(92,141,255,.35) !important;
}

.progress {
  border-radius: 999px !important;
  border: none !important;
  background: rgba(255,255,255,.08) !important;
  height: 4px !important;
}

#progressBar {
  border-radius: 999px !important;
  background: linear-gradient(90deg, #2457d6, #f8fafc 50%, #c7353d) !important;
}

.quiz-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
}

.answers button {
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(255,255,255,.035) !important;
  transition: background .18s, border-color .18s, transform .18s !important;
}

.answers button:hover {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(92,141,255,.35) !important;
  transform: translateX(4px) !important;
}

.answers button.selected {
  background: rgba(92,141,255,.14) !important;
  border-color: #5c8dff !important;
  color: #fff !important;
}

.gauge-card, .analysis-card {
  border-radius: 22px !important;
  border: 1px solid rgba(92,141,255,.18) !important;
  background: rgba(92,141,255,.04) !important;
}

.analysis-label {
  color: #5c8dff !important;
}

.analysis-card mark {
  color: #8fb3ff !important;
}

.compact-profile {
  border: 1px solid rgba(92,141,255,.15) !important;
  border-radius: 18px !important;
}

.compact-profile div {
  border-color: rgba(92,141,255,.12) !important;
}

.restart-zone {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #d0d7e5;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}

.btn-back:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(215,180,106,.3);
  transform: translateY(-2px);
}

/* ====== Bouton "Recommencer" stylé ====== */
.btn-restart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 18px;
  border: 1.5px solid rgba(143, 179, 255, .35);
  background:
    linear-gradient(135deg, rgba(92,141,255,.10), rgba(215,180,106,.06));
  color: #cfdcff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.22,.61,.36,1),
              border-color .25s, color .25s, box-shadow .25s;
}

.btn-restart::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #5c8dff, #ead6a2);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 0;
}

.btn-restart svg,
.btn-restart span {
  position: relative;
  z-index: 1;
  transition: color .25s, transform .4s cubic-bezier(.22,.61,.36,1);
}

.btn-restart svg { color: #8fb3ff; }

.btn-restart:hover {
  transform: translateY(-2px);
  border-color: transparent;
  color: #111;
  box-shadow: 0 16px 40px rgba(92,141,255,.28);
}

.btn-restart:hover::before { opacity: 1; }
.btn-restart:hover svg { color: #111; transform: rotate(-180deg); }
.btn-restart:hover span { color: #111; }

.btn-restart:active { transform: translateY(0); }

.result-help {
  color: #8d97aa;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Résultats modernisés */
.results-shell h2 {
  letter-spacing: -.05em !important;
}

.results-shell h3 {
  color: #8fb3ff !important;
  letter-spacing: -.03em !important;
}

.families .family-card,
.families > div {
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(255,255,255,.03) !important;
  transition: border-color .2s, transform .2s;
}

.families .family-card:hover,
.families > div:hover {
  border-color: rgba(92,141,255,.3) !important;
  transform: translateY(-2px);
}

.families .family-card:first-child,
.families > div:first-child {
  border-color: rgba(92,141,255,.5) !important;
  background: rgba(92,141,255,.06) !important;
}

.gauge {
  position: relative;
  border-radius: 999px !important;
  overflow: visible !important;
  border: none !important;
  background: linear-gradient(90deg,
    #1e3a8a 0%,
    #2457d6 25%,
    #e8eef9 48%,
    #ffffff 50%,
    #e8eef9 52%,
    #c7353d 75%,
    #7a1f24 100%
  ) !important;
  height: 22px !important;
  opacity: 1 !important;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.3),
    inset 0 -1px 0 rgba(255,255,255,.08),
    0 8px 24px rgba(0,0,0,.4) !important;
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 50%, rgba(0,0,0,.15));
  pointer-events: none;
}

.gauge-labels {
  margin-bottom: 18px !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}

.gauge-labels span:first-child { color: #5c8dff !important; }
.gauge-labels span:nth-child(2) { color: #e0e8f5 !important; }
.gauge-labels span:last-child { color: #ff6b75 !important; }

#needle {
  position: absolute !important;
  top: -6px !important;
  width: 6px !important;
  height: 34px !important;
  background: linear-gradient(180deg, #ffffff, #d7b46a) !important;
  border-radius: 4px !important;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.25),
    0 0 20px rgba(255,255,255,.6),
    0 6px 16px rgba(0,0,0,.6) !important;
  transition: left .8s cubic-bezier(.2,.9,.3,1.1) !important;
  z-index: 5 !important;
}

#needle::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}

@media (max-width: 560px) {
  .topbar-actions { gap: 6px; }
  .back-link, .soutenir-link { font-size: 11px; padding: 7px 10px; }
}
