/* ============ Opération Marshmallow — styles ============ */
/* Mobile-first. Vibe : nuit étoilée + feu de camp en haut, carnet d'aventure en bas. */

:root {
  --night: #0b1026;
  --night-2: #141a35;
  --ember: #ff7a18;
  --ember-2: #ffb347;
  --flame-y: #ffd166;
  --paper: #faf3e3;
  --paper-2: #f3e9d2;
  --ink: #2f2a20;
  --forest: #3e5f44;
  --forest-2: #5a7d61;
  --radius: 16px;
  --font-display: 'Alfa Slab One', serif;
  --font-hand: 'Caveat', cursive;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  background: linear-gradient(180deg, #05070f 0%, var(--night) 45%, #1a1230 80%, #2b1a2e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 24px 20px 90px;
}

/* étoiles générées en CSS */
.stars, .stars::before, .stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 15%, #fff, transparent),
    radial-gradient(1px 1px at 70% 10%, #ffe9c9, transparent),
    radial-gradient(1.8px 1.8px at 85% 30%, #fff, transparent),
    radial-gradient(1px 1px at 40% 25%, #cfe4ff, transparent),
    radial-gradient(1.3px 1.3px at 10% 45%, #fff, transparent),
    radial-gradient(1px 1px at 55% 5%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 92% 55%, #ffe9c9, transparent),
    radial-gradient(1px 1px at 30% 60%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 64% 40%, #cfe4ff, transparent),
    radial-gradient(1px 1px at 5% 75%, #fff, transparent);
  animation: twinkle 4s ease-in-out infinite;
}
.stars::before { transform: translate(30px, 40px) scale(1.1); animation-delay: 1.3s; }
.stars::after { transform: translate(-40px, 90px) scale(0.9); animation-delay: 2.6s; }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .45; } }

.shooting-star {
  position: absolute;
  top: 12%; left: -10%;
  width: 90px; height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  border-radius: 2px;
  transform: rotate(-18deg);
  animation: shoot 7s ease-in infinite;
  opacity: 0;
}
@keyframes shoot {
  0%, 82% { opacity: 0; left: -10%; top: 12%; }
  84% { opacity: 1; }
  92% { opacity: 0; left: 95%; top: 38%; }
  100% { opacity: 0; }
}

.hero-content { position: relative; z-index: 2; max-width: 560px; }
.hero-kicker {
  font-size: .85rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ember-2);
  margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8.4vw, 3.8rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.hero-title span {
  color: var(--ember);
  text-shadow: 0 0 30px rgba(255, 122, 24, .55);
}
.hero-sub {
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #d9dcef;
}

/* ============ FEU DE CAMP ANIMÉ ============ */
.campfire {
  position: relative;
  width: 120px; height: 120px;
  margin: 34px auto 26px;
  filter: drop-shadow(0 0 35px rgba(255, 122, 24, .45));
}
.flame {
  position: absolute;
  bottom: 26px; left: 50%;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  transform-origin: 50% 100%;
}
.flame-1 {
  width: 26px; height: 44px;
  margin-left: -13px;
  background: linear-gradient(180deg, var(--flame-y), var(--ember));
  animation: flicker 0.55s ease-in-out infinite alternate;
}
.flame-2 {
  width: 42px; height: 64px;
  margin-left: -21px;
  background: linear-gradient(180deg, var(--ember-2), var(--ember) 65%, #e2521a);
  opacity: .85;
  animation: flicker 0.7s ease-in-out infinite alternate-reverse;
}
.flame-3 {
  width: 58px; height: 82px;
  margin-left: -29px;
  background: linear-gradient(180deg, var(--ember), #d63b0f);
  opacity: .55;
  animation: flicker 0.9s ease-in-out infinite alternate;
}
@keyframes flicker {
  0% { transform: scaleY(1) scaleX(1) rotate(-2deg); }
  100% { transform: scaleY(1.12) scaleX(.94) rotate(2.5deg); }
}
.spark {
  position: absolute;
  bottom: 60px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--flame-y);
  animation: spark 1.8s ease-out infinite;
  opacity: 0;
}
.spark.s2 { animation-delay: .6s; margin-left: 10px; }
.spark.s3 { animation-delay: 1.2s; margin-left: -12px; }
@keyframes spark {
  0% { opacity: 0; transform: translateY(0) scale(1); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-70px) translateX(8px) scale(.3); }
}
.log {
  position: absolute;
  bottom: 14px; left: 50%;
  width: 74px; height: 14px;
  background: linear-gradient(180deg, #6b4426, #4a2d17);
  border-radius: 7px;
}
.log-a { transform: translateX(-50%) rotate(16deg); }
.log-b { transform: translateX(-50%) rotate(-16deg); }

/* ============ BOUTONS ============ */
.btn-fire {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ember), #e2521a);
  border: none;
  border-radius: 999px;
  padding: 16px 30px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 122, 24, .4);
  transition: transform .15s ease, box-shadow .15s ease;
  touch-action: manipulation;
}
.btn-fire:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 30px rgba(255, 122, 24, .55); }
.btn-fire:active { transform: scale(.97); }
.btn-fire:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-big { font-size: 1.2rem; padding: 18px 40px; }
.hero-hint { margin-top: 12px; font-size: .85rem; color: #9aa0c3; }

.mountains {
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; height: 120px;
  z-index: 1;
}

/* ============ SECTIONS "CARNET" ============ */
.paper {
  background: var(--paper);
  background-image: radial-gradient(rgba(62, 95, 68, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 12px 0 0;
}
.section {
  max-width: 640px;
  margin: 0 auto;
  padding: 38px 22px;
}
.section + .section { border-top: 2px dashed rgba(62, 95, 68, .25); }
.section p { line-height: 1.65; margin-bottom: 14px; font-size: 1.02rem; }
.section-title {
  font-size: 1.9rem;
  margin-bottom: 18px;
  color: var(--forest);
}
.hand { font-family: var(--font-hand); font-size: 2.4rem; }

.timeline { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 560px) { .timeline { grid-template-columns: 1fr 1fr; } }
.day {
  background: #fff;
  border: 2px solid rgba(62, 95, 68, .2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 3px 3px 0 rgba(62, 95, 68, .15);
}
.day-badge {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: #fff;
  background: var(--forest);
  border-radius: 999px;
  padding: 2px 16px;
  margin-bottom: 12px;
  transform: rotate(-2deg);
}
.day ul { list-style: none; }
.day li { padding: 6px 0; line-height: 1.45; }

.cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 14px; }
.cost {
  background: #fff;
  border: 2px solid rgba(62, 95, 68, .2);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cost-emoji { font-size: 1.6rem; }
.cost-label { font-size: .78rem; color: #6b6250; line-height: 1.3; }
.cost-val { font-weight: 800; color: var(--forest); font-size: 1.05rem; }
.cost-total {
  background: rgba(255, 179, 71, .25);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
}

.gear-list { list-style: none; margin: 6px 0 16px; }
.gear-list li {
  padding: 9px 0 9px 4px;
  border-bottom: 1px dashed rgba(62, 95, 68, .2);
  line-height: 1.5;
}
.gear-list em { color: #857a63; font-size: .9em; }
.gear-note {
  background: rgba(62, 95, 68, .1);
  border-left: 4px solid var(--forest);
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
}

.section-cta { text-align: center; padding-bottom: 60px; }
.footer {
  text-align: center;
  font-size: .85rem;
  color: #8b8168;
  padding: 24px 20px calc(30px + env(safe-area-inset-bottom));
  border-top: 2px dashed rgba(62, 95, 68, .25);
}

/* ============ WIZARD ============ */
.wizard {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  background-image: radial-gradient(rgba(62, 95, 68, .06) 1px, transparent 1px);
  background-size: 22px 22px;
}
.wizard-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
}
.wizard-back, .wizard-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--forest);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
}
.wizard-back:hover, .wizard-close:hover { background: rgba(62, 95, 68, .1); }
.wizard-back.invisible { visibility: hidden; }

/* barre de progression façon sentier */
.trail {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(62, 95, 68, .18);
  border-radius: 99px;
}
.trail-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--forest-2), var(--ember));
  transition: width .35s ease;
}
.trail-hiker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -58%) scaleX(-1);
  font-size: 1.25rem;
  transition: left .35s ease;
}
.trail-flag {
  position: absolute;
  right: -6px; top: 50%;
  transform: translateY(-58%);
  font-size: 1.15rem;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 20px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.wizard-bottom {
  padding: 12px 22px calc(16px + env(safe-area-inset-bottom));
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.btn-next { width: 100%; }

.step { animation: stepIn .3s ease; }
@keyframes stepIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.step-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.step h2 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 6px; color: var(--ink); }
.step .step-sub { color: #7a7159; margin-bottom: 20px; line-height: 1.5; }

/* inputs */
.input-text {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 16px 18px;
  border: 2px solid rgba(62, 95, 68, .35);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}
.input-text:focus { border-color: var(--ember); box-shadow: 0 0 0 4px rgba(255, 122, 24, .15); }
textarea.input-text { font-size: 1rem; font-weight: 400; resize: vertical; min-height: 110px; line-height: 1.5; }

/* choix (radio / checkbox stylés) */
.choices { display: grid; gap: 10px; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid rgba(62, 95, 68, .25);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.35;
  transition: border-color .12s, background .12s, transform .12s;
  user-select: none;
}
.choice:active { transform: scale(.98); }
.choice .c-emoji { font-size: 1.5rem; flex-shrink: 0; }
.choice .c-sub { display: block; font-weight: 400; font-size: .82rem; color: #857a63; }
.choice.selected {
  border-color: var(--ember);
  background: rgba(255, 179, 71, .18);
  box-shadow: 0 0 0 1px var(--ember);
}

/* slider budget */
.budget-value {
  font-family: var(--font-display);
  font-size: 3rem;
  text-align: center;
  color: var(--ember);
  margin: 10px 0 4px;
}
.budget-caption { text-align: center; color: #7a7159; margin-bottom: 22px; min-height: 1.4em; font-family: var(--font-hand); font-size: 1.35rem; }
input[type="range"] {
  width: 100%;
  accent-color: var(--ember);
  height: 34px;
  cursor: pointer;
}

/* calendrier */
.cal-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 2px solid rgba(62, 95, 68, .3);
  background: #fff;
  color: var(--forest);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .85rem;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.cal-month { margin-bottom: 18px; }
.cal-month h3 {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--forest);
  margin-bottom: 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-dow {
  text-align: center;
  font-size: .7rem;
  font-weight: 800;
  color: #9a9078;
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  border: 2px solid rgba(62, 95, 68, .18);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  user-select: none;
  transition: background .1s, border-color .1s;
}
.cal-day.weekend { border-color: rgba(255, 122, 24, .45); background: rgba(255, 179, 71, .12); }
.cal-day.selected { background: var(--ember); border-color: var(--ember); color: #fff; }
.cal-day.empty { visibility: hidden; }
.cal-day.past { opacity: .3; pointer-events: none; }
.cal-legend { font-size: .8rem; color: #857a63; margin-top: 4px; }

/* récap */
.recap {
  background: #fff;
  border: 2px solid rgba(62, 95, 68, .2);
  border-radius: var(--radius);
  padding: 6px 18px;
  margin-top: 8px;
}
.recap-row { padding: 12px 0; border-bottom: 1px dashed rgba(62, 95, 68, .2); line-height: 1.5; }
.recap-row:last-child { border-bottom: none; }
.recap-row b { color: var(--forest); }

/* merci */
.thanks {
  text-align: center;
  padding-top: 8vh;
}
.thanks .campfire { transform: scale(1.15); }
.thanks h2 { font-size: 1.9rem; margin: 20px 0 10px; }
.thanks p { color: #7a7159; line-height: 1.6; max-width: 420px; margin: 0 auto 10px; }
.marsh {
  font-size: 3rem;
  display: inline-block;
  animation: bounce 1.4s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

/* erreur */
.shake { animation: shake .35s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
.error-msg { color: #c0392b; font-weight: 700; margin-top: 10px; display: none; }
.error-msg.visible { display: block; }
