:root {
  --sable: #fbe9c8;
  --sable-clair: #fffaf0;
  --papier: #fff6e3;
  --encre: #2a231d;
  --encre-doux: rgba(42, 35, 29, 0.55);
  --lagon: #0e9c9c;
  --lagon-fonce: #0a6f73;
  --mangue: #f0a52e;
  --hibiscus: #e0473f;
  --feuille: #2f8f5b;

  --police-titre: "Shrikhand", "Cooper Black", Georgia, serif;
  --police-texte: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --police-main: "Caveat", "Comic Sans MS", cursive;

  --largeur: 42rem;
  --rayon: 16px;
  --trait: 2.5px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--encre);
  background-color: var(--sable);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(240, 165, 46, 0.22), transparent 42%),
    radial-gradient(circle at 88% 96%, rgba(14, 156, 156, 0.16), transparent 46%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 3rem;
}

.bord-madras {
  width: 100vw;
  height: 14px;
  margin-bottom: 1.25rem;
  background-image: repeating-linear-gradient(
    90deg,
    var(--hibiscus) 0 12px,
    var(--mangue) 12px 24px,
    var(--feuille) 24px 36px,
    var(--lagon) 36px 48px,
    var(--sable-clair) 48px 60px
  );
}

.entete {
  width: 100%;
  max-width: var(--largeur);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 0 0.25rem 1rem;
}

.entete-ile {
  font-family: var(--police-titre);
  font-size: 1.15rem;
  color: var(--lagon-fonce);
}

.entete-fleche {
  color: var(--hibiscus);
}

.entete-nom {
  font-family: var(--police-main);
  font-size: 1.35rem;
  color: var(--encre-doux);
  transform: rotate(-1.5deg);
}

main {
  width: 100%;
  max-width: var(--largeur);
}

.pied {
  max-width: var(--largeur);
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--encre-doux);
}

.pied p {
  margin: 0;
}

/* --- Structure des écrans --- */

.ecran {
  animation: entrer 0.32s ease-out both;
}

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

.intro {
  background: var(--sable-clair);
  border: var(--trait) solid var(--encre);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--encre);
  padding: 1.6rem 1.35rem 1.9rem;
  position: relative;
  overflow: hidden;
}

.intro::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--encre-doux);
  border-radius: 16px;
  pointer-events: none;
}

.kicker {
  margin: 0 0 0.5rem;
  font-family: var(--police-main);
  font-size: 1.4rem;
  color: var(--hibiscus);
  transform: rotate(-2deg);
  transform-origin: left center;
}

.titre-intro {
  font-family: var(--police-titre);
  font-size: clamp(2rem, 8.5vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  color: var(--encre);
}

.soustitre {
  font-family: var(--police-texte);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  color: var(--lagon-fonce);
  margin: 0 0 1.3rem;
}

.message-papa {
  position: relative;
  margin: 0 0 1.4rem;
  padding: 1.05rem 1.1rem 0.95rem;
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--mangue);
  transform: rotate(-0.5deg);
}

.message-nom {
  position: absolute;
  top: -0.85rem;
  left: 0.9rem;
  padding: 0.05rem 0.55rem;
  background: var(--hibiscus);
  color: #fff;
  font-family: var(--police-main);
  font-size: 1.25rem;
  line-height: 1.3;
  border: 2px solid var(--encre);
  border-radius: 999px;
  transform: rotate(-3deg);
}

.message-papa p {
  margin: 0;
  font-size: 1.02rem;
}

.intro-texte {
  margin: 0 0 1.5rem;
  color: var(--encre);
}

.note {
  margin: 1rem 0 0;
  font-family: var(--police-main);
  font-size: 1.3rem;
  color: var(--lagon-fonce);
  text-align: center;
  transform: rotate(-1deg);
}

/* --- Boutons --- */

.bouton {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--police-texte);
  font-weight: 900;
  font-size: 1.08rem;
  color: #fff;
  background: var(--hibiscus);
  border: var(--trait) solid var(--encre);
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  box-shadow: 5px 5px 0 var(--encre);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.bouton:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--encre);
}

.bouton:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--encre);
}

.bouton.secondaire {
  background: var(--sable-clair);
  color: var(--encre);
}

.bouton.lagon {
  background: var(--lagon);
}

#commencer {
  width: 100%;
}

.lien-bouton {
  appearance: none;
  background: none;
  border: none;
  padding: 0.35rem;
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--encre);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lien-bouton:hover {
  color: var(--hibiscus);
}

/* --- Progression --- */

.progression {
  margin: 0 0 1.1rem;
  padding: 0 0.25rem;
}

.trajet {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ville {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--encre-doux);
  white-space: nowrap;
}

.piste {
  position: relative;
  flex: 1;
  height: 34px;
  margin: 0 18px;
}

.piste::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 3px dashed var(--encre-doux);
  transform: translateY(-50%);
}

.avion {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 34px;
  color: var(--hibiscus);
  transform: translate(-50%, -50%) rotate(-10deg);
  transition: left 0.5s cubic-bezier(0.45, -0.35, 0.4, 1.35);
}

.compteur {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--encre-doux);
}

/* --- Question --- */

.question {
  background: var(--sable-clair);
  border: var(--trait) solid var(--encre);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--lagon);
  padding: 1.5rem 1.35rem 1.7rem;
}

.entete-question {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  margin-bottom: 1.3rem;
}

.motif {
  display: block;
  width: 52px;
  height: 52px;
  color: var(--lagon-fonce);
  transform: rotate(-4deg);
}

.motif svg,
.option-icone svg,
.avion svg,
.tampon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motif .plein,
.option-icone .plein {
  fill: currentColor;
  stroke: none;
}

.titre {
  font-family: var(--police-titre);
  font-size: clamp(1.8rem, 7.5vw, 2.7rem);
  line-height: 1.02;
  margin: 0;
  color: var(--encre);
}

.titre:focus {
  outline: none;
}

.aide {
  margin: 0.1rem 0 0;
  font-style: italic;
  color: var(--encre-doux);
}

/* --- Champs --- */

.champ {
  display: grid;
  gap: 0.4rem;
}

.champ label {
  font-weight: 900;
  font-size: 1rem;
}

input[type="date"],
textarea {
  width: 100%;
  font-family: var(--police-texte);
  font-size: 1.05rem;
  color: var(--encre);
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  box-shadow: inset 3px 3px 0 rgba(42, 35, 29, 0.08);
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

input[type="date"]:focus-visible,
textarea:focus-visible,
.option input:focus-visible + .option-cadre,
.bouton:focus-visible,
.lien-bouton:focus-visible {
  outline: 3px dashed var(--hibiscus);
  outline-offset: 3px;
}

.indice {
  margin: 0;
  font-size: 0.85rem;
  color: var(--encre-doux);
}

/* --- Options (radio / checkbox) --- */

.options {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.option {
  position: relative;
  display: block;
  cursor: pointer;
}

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option-cadre {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(42, 35, 29, 0.22);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.option input:checked + .option-cadre {
  background: var(--lagon);
  color: #fff;
  transform: rotate(-0.7deg) translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--encre);
}

.option-icone {
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--lagon-fonce);
}

.option input:checked + .option-cadre .option-icone {
  color: #fff;
}

.option-texte {
  display: grid;
  gap: 0.05rem;
  font-weight: 700;
}

.option-detail {
  font-weight: 400;
  font-style: italic;
  font-size: 0.88rem;
  opacity: 0.85;
}

/* --- Erreur --- */

.erreur {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  background: #ffe1de;
  border: 2px solid var(--hibiscus);
  border-radius: 12px;
  font-weight: 700;
  color: #8f1f18;
}

.erreur[hidden] {
  display: none;
}

.secousse {
  animation: secousse 0.32s ease-in-out;
}

@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* --- Barre d'actions --- */

.barre-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.barre-actions .bouton:last-child {
  margin-left: auto;
}

/* --- Récapitulatif --- */

.recapitulatif {
  display: grid;
  gap: 1rem;
}

.carte-sejour {
  position: relative;
  background: var(--sable-clair);
  border: var(--trait) solid var(--encre);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--mangue);
  padding: 1.6rem 1.35rem 1.8rem;
  overflow: hidden;
}

.carte-sejour::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--encre-doux);
  border-radius: 14px;
  pointer-events: none;
}

.carte-haut {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 88px;
  margin: 0 0 0.2rem;
}

.carte-entete {
  margin: 0.35rem 0 0;
  max-width: 12rem;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--lagon-fonce);
}

.signature-courte {
  font-family: var(--police-main);
  font-size: 1.5rem;
  color: var(--hibiscus);
  margin: 0.15rem 0 1.2rem;
  transform: rotate(-1.5deg);
}

.details {
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.55rem;
}

.detail {
  display: grid;
  gap: 0.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px dotted var(--encre-doux);
}

.detail:last-child {
  border-bottom: 0;
}

.detail dt {
  font-weight: 900;
  font-size: 0.86rem;
  color: var(--lagon-fonce);
}

.detail dd {
  margin: 0;
}

.actions-recap {
  display: grid;
  gap: 0.7rem;
}

.actions-recap .bouton {
  width: 100%;
}

.aide-mail {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--encre-doux);
}

.actions-fin {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.tampon {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
  margin: 0.2rem 0.2rem 0 0;
  display: grid;
  place-items: center;
  border: 3px solid var(--hibiscus);
  border-radius: 50%;
  color: var(--hibiscus);
  text-align: center;
  font-family: var(--police-titre);
  font-size: 0.78rem;
  line-height: 1.1;
  transform: rotate(-14deg) scale(0.6);
  opacity: 0;
  pointer-events: none;
}

.tampon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed var(--hibiscus);
  border-radius: 50%;
}

.tampon.actif {
  animation: tamponner 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.25s forwards;
}

@keyframes tamponner {
  0% {
    transform: rotate(-14deg) scale(1.7);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: rotate(-14deg) scale(1);
    opacity: 0.92;
  }
}

/* --- Utilitaires --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 560px) {
  .intro,
  .question,
  .carte-sejour {
    padding: 2.1rem 2rem 2.3rem;
  }

  .actions-recap {
    grid-template-columns: 1fr 1fr;
  }

  .tampon {
    width: 112px;
    height: 112px;
    font-size: 0.92rem;
  }

  .carte-haut {
    min-height: 106px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
