/* =========================
   Theme: Nature / Botanique / Papier
   ========================= */

/* Reset léger */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: #1f2a22;
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.6;

  /* Fond naturel : dégradés + grain */
  background:
    radial-gradient(
      1200px 700px at 15% 10%,
      rgba(122, 169, 133, 0.2),
      transparent 55%
    ),
    radial-gradient(
      900px 550px at 85% 25%,
      rgba(230, 199, 119, 0.14),
      transparent 55%
    ),
    radial-gradient(
      800px 600px at 50% 100%,
      rgba(77, 120, 92, 0.16),
      transparent 60%
    ),
    linear-gradient(180deg, #f7f3e8 0%, #f1ecd9 45%, #f7f3e8 100%);
  position: relative;
  overflow-x: hidden;
}

/* Grain subtil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* =========================
   Container & Header
   ========================= */

.container {
  width: min(980px, calc(100% - 2.2rem));
  margin: clamp(24px, 4vw, 52px) auto;
  padding-bottom: 40px;
}

header {
  text-align: center;
  padding: clamp(18px, 3vw, 28px) 0 10px;
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.12;
  margin: 0;
  letter-spacing: 0.4px;
  color: #1b2a21;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Divider élégant */
.divider {
  width: min(520px, 85%);
  margin: 16px auto 0;
  height: 16px;
  position: relative;
}
.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 44%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(31, 42, 34, 0.35),
    transparent
  );
  transform: translateY(-50%);
}
.divider::before {
  left: 0;
}
.divider::after {
  right: 0;
}
.divider span {
  display: none;
}
.divider::marker {
  content: "";
}
.divider::selection {
  background: transparent;
}
/* petit “sceau” central */
.divider::mid {
  content: "";
}

/* bon, simple : on crée un 3e pseudo via background */
.divider {
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(230, 199, 119, 0.55),
      rgba(230, 199, 119, 0) 55%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(31, 42, 34, 0.25),
      rgba(31, 42, 34, 0) 62%
    );
}

/* =========================
   Cards
   ========================= */

.card {
  margin: 16px 0;
  padding: clamp(16px, 2.4vw, 22px);
  border-radius: 18px;

  /* Papier + reflet */
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.82),
      rgba(255, 255, 255, 0.6)
    ),
    radial-gradient(
      1200px 220px at 20% 0%,
      rgba(230, 199, 119, 0.1),
      transparent 55%
    );

  border: 1px solid rgba(31, 42, 34, 0.1);
  box-shadow:
    0 12px 34px rgba(21, 30, 24, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

/* Petite bordure botanique */
.card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(31, 42, 34, 0.14);
  pointer-events: none;
}

.subtitle {
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #2a3a30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Petit indicateur feuille */
.subtitle::before {
  content: "❖";
  font-size: 0.95rem;
  color: rgba(77, 120, 92, 0.95);
}

/* Paragraphes */
p {
  margin: 0.35rem 0;
  color: rgba(31, 42, 34, 0.92);
}

/* =========================
   Lists (benefits & instructions)
   ========================= */

.benefits,
.check-list,
.quiz-list {
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.benefits li,
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(31, 42, 34, 0.08);
  box-shadow: 0 8px 20px rgba(21, 30, 24, 0.08);
}

.benefits li + li,
.check-list li + li {
  margin-top: 10px;
}

.benefits li span {
  font-size: 1.05rem;
  line-height: 1.2;
  margin-top: 1px;
}

/* =========================
   Form section
   ========================= */

#form {
  margin-top: 18px;
}

form {
  margin-top: 14px;
}

.questions {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin: 10px 0 14px;
  color: #17231c;
  letter-spacing: 0.2px;
  text-align: left;
  position: relative;
  padding-left: 14px;
}

.questions::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(77, 120, 92, 0.9),
    rgba(230, 199, 119, 0.75)
  );
  box-shadow: 0 8px 18px rgba(77, 120, 92, 0.25);
}

/* Liste des réponses */
.quiz-list li + li {
  margin-top: 12px;
}

/* Label cliquable */
.quiz-answer {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 14px;
  align-items: start;

  padding: 14px 14px;
  border-radius: 18px;
  cursor: pointer;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0.52)
  );
  border: 1px solid rgba(31, 42, 34, 0.12);
  box-shadow: 0 12px 26px rgba(21, 30, 24, 0.1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
  position: relative;
  overflow: hidden;
}

/* Halo */
.quiz-answer::before {
  content: "";
  position: absolute;
  inset: -40px -80px auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(
    circle,
    rgba(230, 199, 119, 0.22),
    transparent 60%
  );
  transform: rotate(15deg);
  pointer-events: none;
}

.quiz-answer:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 120, 92, 0.22);
  box-shadow: 0 16px 34px rgba(21, 30, 24, 0.14);
}

.quiz-answer p {
  margin: 0;
  color: rgba(31, 42, 34, 0.92);
}

/* On masque l'input natif */
.quiz-answer input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Custom checkbox */
.custom-check {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  border: 1.5px solid rgba(31, 42, 34, 0.22);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.6)
  );
  box-shadow:
    0 10px 20px rgba(21, 30, 24, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.55) inset;
  display: grid;
  place-items: center;
  margin-top: 2px;
  .custom-check {
    transition:
      transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1),
      border-color 180ms ease,
      box-shadow 180ms ease,
      background 180ms ease;
  }
}

/* coche */
.custom-check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 3px solid rgba(255, 255, 255, 0);
  border-bottom: 3px solid rgba(255, 255, 255, 0);
  transform: rotate(-45deg) scale(0.8);
  transition: 160ms ease;
  opacity: 0;
}

/* état checké : on style le label + la case */
.quiz-answer:has(input[type="checkbox"]:checked) {
  border-color: rgba(77, 120, 92, 0.35);
  background:
    radial-gradient(
      900px 240px at 20% 0%,
      rgba(77, 120, 92, 0.12),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78),
      rgba(255, 255, 255, 0.56)
    );
  box-shadow: 0 18px 38px rgba(21, 30, 24, 0.16);
}

.quiz-answer:has(input[type="checkbox"]:checked) .custom-check {
  border-color: rgba(77, 120, 92, 0.55);
  background: linear-gradient(
    180deg,
    rgba(77, 120, 92, 0.95),
    rgba(52, 92, 68, 0.95)
  );
  box-shadow:
    0 16px 30px rgba(21, 30, 24, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
  animation: check-spin 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes check-spin {
  0% {
    transform: rotate(30deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.15);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

.quiz-answer:has(input[type="checkbox"]:checked) .custom-check::after {
  border-left-color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.95);
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

/* Focus accessibilité */
.quiz-answer:has(input[type="checkbox"]:focus-visible) {
  outline: 3px solid rgba(230, 199, 119, 0.35);
  outline-offset: 4px;
}

/* Fallback si :has non supporté : minimum visuel */
@supports not selector(:has(*)) {
  .quiz-answer input[type="checkbox"]:checked + .custom-check {
    border-color: rgba(77, 120, 92, 0.55);
    background: linear-gradient(
      180deg,
      rgba(77, 120, 92, 0.95),
      rgba(52, 92, 68, 0.95)
    );
  }
  .quiz-answer input[type="checkbox"]:checked + .custom-check::after {
    border-left-color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.95);
    opacity: 1;
  }
}

/* =========================
   Button
   ========================= */

.btn-submit {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  letter-spacing: 0.6px;
  color: #0f1a13;
  background:
    radial-gradient(
      900px 220px at 20% 0%,
      rgba(255, 255, 255, 0.25),
      transparent 55%
    ),
    linear-gradient(180deg, rgba(230, 199, 119, 0.95), rgba(203, 166, 82, 0.95));

  box-shadow:
    0 16px 34px rgba(21, 30, 24, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    filter 170ms ease;
  position: relative;
  overflow: hidden;
}

/* petit reflet animé */
.btn-submit::before {
  content: "";
  position: absolute;
  inset: -60% -30%;
  background: linear-gradient(
    120deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 65%
  );
  transform: translateX(-40%) rotate(12deg);
  opacity: 0.9;
  transition: transform 420ms ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(21, 30, 24, 0.22);
  filter: saturate(1.05);
}
.btn-submit:hover::before {
  transform: translateX(30%) rotate(12deg);
}

.btn-submit:active {
  transform: translateY(0px);
  box-shadow: 0 12px 26px rgba(21, 30, 24, 0.18);
}

.btn-submit:focus-visible {
  outline: 3px solid rgba(77, 120, 92, 0.35);
  outline-offset: 4px;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 720px) {
  .quiz-answer {
    grid-template-columns: 24px 1fr;
    padding: 13px 12px;
    border-radius: 16px;
  }
  .custom-check {
    border-radius: 8px;
  }
}

/* =========================
   Petites améliorations UX
   ========================= */

/* Sélection de texte plus douce */
::selection {
  background: rgba(230, 199, 119, 0.35);
}

/* Liens éventuels */
a {
  color: #2f6b4a;
  text-underline-offset: 3px;
}
a:hover {
  color: #24543a;
}

/* =========================
   Résultats du Quiz
   ========================= */

#quizResult {
  margin-top: 40px;
  animation: fadeIn 0.8s ease-out;
}

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

/* Badges de pourcentages */
.results-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.stat-badge {
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(77, 120, 92, 0.2);
  font-size: 0.9rem;
  color: #2a3a30;
  box-shadow: 0 4px 12px rgba(21, 30, 24, 0.05);
}

/* Titres des résultats */
.result-main-title {
  font-family: "Playfair Display", serif;
  text-align: center;
  color: #1b2a21;
  margin: 30px 0 20px;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
}

/* Carte de résultat spécifique */
.result-card {
  border-left: 4px solid #4d785c; /* Rappel du vert botanique */
}

/* Bloc de détail pour les ex-aequo */
.profile-detail-block {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  border-bottom: 1px dashed rgba(31, 42, 34, 0.15);
}

.profile-detail-block h3.subtitle::before {
  content: "🌿"; /* On change le symbole pour le résultat */
}

/* Style de l'erreur */
#quizError {
  display: none;
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(185, 28, 28, 0.2);
  margin-top: 20px;
  text-align: center;
}

/* Ligne de texte au-dessus de la barre */
.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2a3a30;
}

/* Le rail de la barre (creux) */
.progress-container {
  width: 100%;
  height: 10px;
  background: rgba(31, 42, 34, 0.08); /* Gris neutre très léger */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Le remplissage (partie colorée) */
.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); /* Animation fluide au chargement */
  position: relative;
}

/* Couleurs botaniques pour chaque tempérament */
.progress-fill.sanguin {
  background: linear-gradient(90deg, #e6c777, #f0d9a3); /* Jaune/Doré (Air) */
}
.progress-fill.bilieux {
  background: linear-gradient(
    90deg,
    #d97757,
    #e69177
  ); /* Terre battue/Rouille (Feu) */
}
.progress-fill.lymphatique {
  background: linear-gradient(90deg, #7aa985, #a3c9ad); /* Vert Sauge (Eau) */
}
.progress-fill.nerveux {
  background: linear-gradient(
    90deg,
    #5c7890,
    #85a3b9
  ); /* Bleu Ardoise (Terre/Froid) */
}

/* Petit effet de brillance sur la jauge */
.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
}
/* Section de capture d'email */
.email-capture-container {
  margin-top: 40px;
  padding: 30px;
  background: linear-gradient(135deg, #f9fbf9 0%, #f0f4f1 100%);
  border: 2px solid #4d785c;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.email-title {
  font-family: "Playfair Display", serif;
  color: #1b2a21;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.email-subtitle {
  color: #5c7865;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.email-input {
  flex: 1;
  min-width: 250px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(77, 120, 92, 0.3);
  outline: none;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.email-input:focus {
  border-color: #4d785c;
  box-shadow: 0 0 0 3px rgba(77, 120, 92, 0.1);
}

.email-submit-btn {
  padding: 14px 28px;
  background-color: #4d785c;
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    background-color 0.3s;
}

.email-submit-btn:hover {
  background-color: #3e614a;
  transform: translateY(-2px);
}

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

/* Message de succès/erreur après envoi */
.email-status-message {
  margin-top: 15px;
  font-size: 0.9rem;
  display: none;
}
.consent-label {
  font-size: 0.8rem;
  color: #2a3a30;
  margin: auto;
}

/* Style du Loader */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(
    255,
    255,
    255,
    0.9
  ); /* Fond blanc très légèrement transparent */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Toujours au-dessus */
  backdrop-filter: blur(5px); /* Effet de flou sur le reste de la page */
}

.loader-content {
  text-align: center;
  font-family: "Helvetica", sans-serif;
  color: #2d5a3f; /* Ton vert naturo */
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #e0e0e0;
  border-top: 6px solid #2d5a3f; /* Couleur de l'animation */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loaderText {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}
