/* Design « mobile d'abord » : pensé pour un téléphone, puis élargi sur ordinateur. */
:root {
  --corail: #ff5e3a;
  --peche: #ff9a5a;
  --soleil: #ffc145;
  --lagon: #10b9a6;
  --ocean: #0e7490;
  --nuit: #0f172a;
  --gris: #64748b;
  --fond: #fff8f1;
  --carte: #ffffff;
  --ligne: #f3e6da;
  --rayon: 22px;
  --ombre: 0 10px 35px rgba(15, 23, 42, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--nuit);
  background: var(--fond);
  line-height: 1.5;
  overflow-x: hidden;
}
main { max-width: 680px; margin: 0 auto; padding: 0 16px 32px; position: relative; z-index: 1; /* toujours au-dessus de la vague */ }

/* ---------- En-tête : dégradé qui bouge, nuages et avion qui flottent ---------- */
.entete {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--corail), var(--peche), var(--soleil), var(--lagon), var(--ocean));
  background-size: 300% 300%;
  animation: degrade 14s ease infinite;
  color: #fff;
  padding: 30px 20px 92px;
  text-align: center;
}
@keyframes degrade { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.deco { position: absolute; pointer-events: none; opacity: .9; z-index: 0; }
.entete > :not(.deco):not(.vague) { position: relative; z-index: 1; }
.nuage { font-size: 2.4rem; animation: derive 18s linear infinite; }
.nuage.n1 { top: 3%; left: -15%; }
.nuage.n2 { top: 80%; left: -25%; font-size: 1.8rem; animation-duration: 26s; animation-delay: -9s; opacity: .7; }
@keyframes derive { from { transform: translateX(0); } to { transform: translateX(140vw); } }
.avion-deco { top: 14%; right: 8%; font-size: 2rem; animation: plane 4s ease-in-out infinite; }
@keyframes plane { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(-10px, -12px) rotate(4deg); } }
.vague { position: absolute; bottom: -1px; left: 0; width: 100%; height: 70px; }
.vague path { fill: var(--fond); }

.logo {
  display: inline-block; margin: 0 0 12px; font-weight: 800; font-size: .9rem;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px);
}
h1 { margin: 0; font-size: clamp(1.9rem, 8vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; text-shadow: 0 3px 18px rgba(0,0,0,.15); }
h1 span {
  background: linear-gradient(90deg, #fff6c9, #fff, #fff6c9);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: brille 4s linear infinite;
}
@keyframes brille { to { background-position: 200% center; } }
.sous-titre { margin: 12px auto 0; max-width: 470px; opacity: .97; }
.atouts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.atouts span {
  font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35);
}

/* ---------- Cartes ---------- */
.carte {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 20px;
  margin-top: 16px;
}
#formulaire {
  margin-top: -64px; position: relative; z-index: 2;
  background: #fff;
  border: 1px solid #fff;
  box-shadow: 0 20px 50px rgba(255, 94, 58, .18), var(--ombre);
  animation: monte .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes monte { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 14px; }
label small { font-weight: 400; color: var(--gris); }
input {
  display: block; width: 100%; margin-top: 6px;
  padding: 14px; font-size: 1rem; color: var(--nuit);
  border: 2px solid var(--ligne); border-radius: 14px; background: #fffdfa;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
input:focus { outline: none; border-color: var(--corail); box-shadow: 0 0 0 5px rgba(255, 94, 58, .15); transform: translateY(-1px); }
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.styles { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { margin: 0; font-weight: 600; }
.puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.puce span {
  display: inline-block; padding: 10px 14px; border-radius: 999px;
  border: 2px solid var(--ligne); background: #fffdfa; cursor: pointer;
  transition: transform .15s, border-color .2s, background .2s, box-shadow .2s;
}
.puce span:hover { transform: translateY(-2px); }
.puce input:checked + span {
  border-color: var(--corail); color: #fff;
  background: linear-gradient(135deg, var(--corail), var(--peche));
  box-shadow: 0 6px 16px rgba(255, 94, 58, .35);
  transform: scale(1.04);
}
.puce input:focus-visible + span { outline: 3px solid var(--lagon); outline-offset: 2px; }

/* Bouton principal : reflet qui passe + pulsation légère */
.bouton-principal {
  position: relative; overflow: hidden;
  display: block; width: 100%; text-align: center; text-decoration: none;
  padding: 16px; border: 0; border-radius: 16px; cursor: pointer;
  font-size: 1.08rem; font-weight: 800; color: #fff; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--corail), var(--peche));
  box-shadow: 0 10px 24px rgba(255, 94, 58, .4);
  transition: transform .15s, box-shadow .2s;
  animation: pulse 2.6s ease-in-out infinite;
}
.bouton-principal::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: reflet 3.2s ease-in-out infinite;
}
@keyframes reflet { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 10px 24px rgba(255, 94, 58, .4); } 50% { box-shadow: 0 12px 34px rgba(255, 94, 58, .6); } }
.bouton-principal:hover { transform: translateY(-2px); }
.bouton-principal:active { transform: scale(.98); }
.bouton-principal:disabled { opacity: .6; cursor: wait; animation: none; }

.bouton-second {
  flex: 1; padding: 13px 10px; border-radius: 14px; cursor: pointer;
  font-size: .98rem; font-weight: 800;
  border: 2px solid var(--lagon); background: #fff; color: var(--ocean);
  transition: background .2s, color .2s, transform .15s;
}
.bouton-second:hover { background: var(--lagon); color: #fff; transform: translateY(-2px); }
.petit { text-align: center; color: var(--gris); font-size: .85rem; margin: 10px 0 0; }
.erreur { color: #b91c1c; font-weight: 700; }

/* ---------- Animation de chargement ---------- */
.chargement { text-align: center; padding: 34px 20px; }
.globe { position: relative; width: 120px; height: 120px; margin: 0 auto 10px; }
.globe .terre { font-size: 4.2rem; line-height: 120px; display: block; animation: tourne 6s linear infinite; }
.globe .orbite { position: absolute; inset: 0; animation: tourne 2.2s linear infinite; }
.globe .orbite span { position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(90deg); font-size: 1.6rem; }
@keyframes tourne { to { transform: rotate(360deg); } }
#message-chargement { font-weight: 700; min-height: 1.5em; transition: opacity .3s; }
.barre { height: 8px; background: var(--ligne); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.barre span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--corail), var(--soleil), var(--lagon));
  animation: glisse 1.4s linear infinite;
}
@keyframes glisse { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- Résultat : les cartes apparaissent l'une après l'autre ---------- */
.apparait { animation: monte .6s cubic-bezier(.2, .8, .2, 1) both; }
.tete-plan { padding: 0; overflow: hidden; }
.tete-plan .bandeau {
  position: relative; min-height: 210px; display: flex; align-items: flex-end;
  background: linear-gradient(135deg, var(--corail), var(--lagon));
}
.photo-destination { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: zoom 18s ease-out both; }
@keyframes zoom { from { transform: scale(1.15); } to { transform: scale(1); } }
.tete-plan .bandeau::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(15, 23, 42, .75)); }
.tete-plan .bandeau h2 { position: relative; z-index: 1; color: #fff; margin: 0; padding: 18px 20px; font-size: 1.55rem; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.tete-plan .corps { padding: 16px 20px 20px; }
.resume { margin: 0; color: #475569; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.alerte { background: #fff6e8; border-left: 6px solid var(--soleil); }
.alerte h2 { margin-top: 0; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }

/* Budget : jauges qui se remplissent */
.budget-ligne { margin-bottom: 12px; }
.budget-ligne div { display: flex; justify-content: space-between; font-weight: 700; }
.jauge { height: 12px; background: var(--ligne); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.jauge span { display: block; height: 100%; border-radius: 99px; width: 0; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }

/* Programme */
.jour { position: relative; padding: 0 0 14px 22px; border-left: 3px dashed #fdd2c2; margin-left: 6px; }
.jour::before { content: ""; position: absolute; left: -9px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--corail); box-shadow: 0 0 0 4px #ffe1d6; }
.jour:last-child { border-left-color: transparent; padding-bottom: 0; }
.jour h3 { margin: 0 0 6px; font-size: 1.05rem; color: #c2410c; }
.moment { margin: 4px 0; }
.moment b { display: inline-block; min-width: 108px; }

.logement { padding: 12px 14px; border-radius: 14px; background: #ecfeff; margin-bottom: 8px; border: 1px solid #cffafe; }
ol, ul { padding-left: 20px; margin: 0; }
li { margin-bottom: 6px; }
.mention { text-align: center; font-weight: 800; color: #92400e; background: #fff6e8; }

/* ---------- Bons plans : photos, prix bas en gros ---------- */
.bons-plans { background: linear-gradient(135deg, #fff0e5, #e3fbf7); border: 2px solid #ffd9a8; }
.bons-plans h2 { font-size: 1.3rem; }
.grille-bons-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bon-plan {
  background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
  transition: transform .2s, box-shadow .2s;
}
.bon-plan:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 14px 28px rgba(15, 23, 42, .14); }
.bon-plan-visuel { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, var(--soleil), var(--lagon)); }
.icone-lieu { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.bon-plan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.bon-plan:hover .bon-plan-photo { transform: scale(1.08); }
.prix {
  position: absolute; left: 8px; bottom: 8px; z-index: 1; max-width: calc(100% - 16px);
  background: var(--corail); color: #fff; font-weight: 900; font-size: 1.05rem; line-height: 1.2;
  padding: 5px 11px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both .3s;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.bon-plan-titre { padding: 10px 10px 0; font-size: .95rem; line-height: 1.25; }
.bon-plan-detail { padding: 4px 10px 0; margin: 0; font-size: .85rem; color: #475569; }
.economie { margin: 8px 10px 0; color: #0f766e; font-weight: 800; font-size: .8rem; }

/* ---------- Réserver : hôtels et voiture ---------- */
.reserver { background: linear-gradient(135deg, #e6fbff, #f2fff9); border: 2px solid #b8f0ea; }
.reserver h3 { margin: 16px 0 8px; font-size: 1.02rem; }
.grille-resa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bouton-resa {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 10px; border-radius: 14px; text-decoration: none;
  font-weight: 800; font-size: .92rem; color: #fff;
  background: linear-gradient(135deg, var(--ocean), var(--lagon));
  box-shadow: 0 6px 16px rgba(14, 116, 144, .28);
  transition: transform .15s, box-shadow .2s;
}
.bouton-resa::after { content: " ↗"; margin-left: 4px; }
.bouton-resa:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(14, 116, 144, .38); }
.lien-quartier { display: inline-block; margin-top: 6px; font-weight: 800; color: var(--ocean); text-decoration: none; }
.lien-quartier:hover { text-decoration: underline; }

.pied { text-align: center; color: var(--gris); padding: 16px 16px 28px; }
.pied a { color: var(--corail); font-weight: 800; text-decoration: none; }

@media (min-width: 640px) {
  .entete { padding: 48px 20px 110px; }
  .carte { padding: 26px; }
  .tete-plan { padding: 0; }
  .grille-bons-plans { grid-template-columns: 1fr 1fr 1fr; }
  .tete-plan .bandeau { min-height: 260px; }
}

/* Respect des personnes sensibles aux animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .nuage { display: none; }
}

/* PDF : on n'imprime que le plan, sans boutons ni formulaire */
@media print {
  body { background: #fff; }
  .entete, #formulaire, #chargement, #limite, .actions, #resultat > .bouton-principal { display: none !important; }
  .carte { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .apparait, .prix, .photo-destination { animation: none !important; }
  .jauge span { transition: none; }
  main { max-width: none; }
}
