/* =====================================================================
   Page de réponse — mise en scène « invitation »
   Carré magique Lo Shu animé, pastilles d'infos, cartes-calendrier,
   progression, remerciement + confettis (poll.js).
   Chargé uniquement par poll.html, après style.css.
   ===================================================================== */

/* --- En-tête invitation --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 190px;
  grid-template-areas: "text sigil";
  gap: 10px 26px;
  align-items: center;
  margin: -6px 0 26px;
}
.hero-text { grid-area: text; min-width: 0; }
.sigil { grid-area: sigil; width: 190px; aspect-ratio: 1; filter: drop-shadow(0 10px 26px rgba(236,111,158,.35)); }
.sigil svg { width: 100%; height: 100%; overflow: visible; }

.sigil .ring { transform-origin: 100px 100px; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sigil .palace rect {
  fill: rgba(255,255,255,.55); stroke: url(#sg); stroke-width: .8;
  animation: palace 5.4s ease-in-out infinite;
  animation-delay: calc((var(--n) - 1) * .6s);
}
.sigil .palace text {
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  text-anchor: middle; dominant-baseline: central; fill: #7a3a78;
  animation: palace-t 5.4s ease-in-out infinite;
  animation-delay: calc((var(--n) - 1) * .6s);
}
@keyframes palace {
  0%, 22%, 100% { fill: rgba(255,255,255,.55); }
  6%            { fill: #ffd98a; }
}
@keyframes palace-t {
  0%, 22%, 100% { fill: #7a3a78; }
  6%            { fill: #fff; }
}
.sigil .flight {
  fill: none; stroke: #e6a34a; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  opacity: .75; stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: flight 5.4s ease-in-out infinite;
}
@keyframes flight {
  0%   { stroke-dashoffset: 420; opacity: 0; }
  8%   { opacity: .75; }
  80%  { stroke-dashoffset: 0; opacity: .75; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.eyebrow {
  margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .32em;
  text-transform: uppercase; color: var(--accent);
}
.hero-title {
  font-size: clamp(2rem, 6vw, 3rem);
  background: linear-gradient(100deg, #b8662b 0%, #d4497f 30%, #7b55e0 55%, #d4497f 75%, #b8662b 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 9s ease-in-out infinite;
  margin-bottom: 14px;
}
.hero-title .num, .hero-desc .lead .num { font-family: var(--sans); font-weight: 600; font-size: .82em; font-style: normal; }
@keyframes shimmer { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.hero-desc .lead {
  font-family: var(--serif); font-size: clamp(1.2rem, 3.4vw, 1.42rem); font-style: italic;
  line-height: 1.3; margin: 0 0 14px; color: var(--ink);
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: var(--card-strong); border: 1px solid rgba(236,111,158,.28);
  font-weight: 600; font-size: .95rem;
  box-shadow: 0 6px 16px -10px rgba(120,60,140,.55);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(.25s + var(--i) * .09s);
}
.chip-ico {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad-soft); font-size: .9rem;
}
.hero-desc .note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 10px; color: var(--ink-soft);
}
.note-ico { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.4; }
.hero-desc .note:last-child {
  padding: 11px 14px; border-radius: 14px; margin-top: 4px;
  background: rgba(255, 217, 138, .22); border: 1px dashed rgba(207,122,46,.45); color: #6d4a2a;
}

/* --- Étapes du formulaire --- */
.step {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 12px; font-size: clamp(1.25rem, 3.4vw, 1.5rem);
}
.step-n {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); color: #fff; font-family: var(--sans); font-size: .9rem; font-weight: 700;
  box-shadow: 0 6px 14px -6px rgba(236,111,158,.8);
}
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.who-name { grid-column: 1 / -1; }

.revote {
  margin: -6px 0 6px; padding: 10px 14px; border-radius: 14px;
  background: rgba(47, 158, 111, .09); border: 1px solid rgba(47, 158, 111, .25);
  color: #235c43; font-size: .9rem;
}
.multi {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 14px;
  background: rgba(154,123,255,.12); border: 1px solid rgba(154,123,255,.3);
  color: #4b3a78; font-size: .93rem;
}

/* --- Progression --- */
.progress { margin: 4px 0 16px; }
.progress-track { height: 8px; border-radius: 99px; background: rgba(120,90,150,.14); overflow: hidden; }
.progress-fill {
  display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.progress-label { margin: 7px 0 0; font-size: .88rem; color: var(--ink-soft); }
.progress-label b { color: var(--ink); font-size: 1rem; }
.progress.complete .progress-hint { display: none; }
.progress.complete .progress-label::after { content: " ✨ parfait !"; color: var(--accent); font-weight: 600; }

/* --- Cartes-calendrier --- */
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Calendrier + libellé sur la 1re ligne, boutons sur toute la largeur en dessous :
   côte à côte, « Peut-être » était coupé sous 430 px et en 2 colonnes étroites. */
.date-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "cal title" "opts opts";
  gap: 10px 12px; align-items: center;
  margin: 0; padding: 12px; border-width: 1.5px;
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(.1s + var(--i) * .06s);
  transition: border-color .2s, box-shadow .2s, background .2s, transform .2s;
}
.cal {
  grid-area: cal; width: 56px; display: flex; flex-direction: column; align-items: center;
  border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 6px 16px -8px rgba(60,30,90,.45); border: 1px solid var(--line);
  transition: filter .2s, opacity .2s;
}
.cal-month {
  width: 100%; text-align: center; padding: 3px 0 2px;
  background: var(--grad); color: #fff; font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.cal-day { font-family: var(--sans); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.05; padding-top: 3px; }
.cal-wd { font-size: .7rem; color: var(--ink-soft); padding-bottom: 5px; text-transform: lowercase; }
.cal.we .cal-wd { color: var(--accent); font-weight: 700; }
.date-body { display: contents; }
.date-card .choice-date { grid-area: title; margin: 0; font-size: 1rem; line-height: 1.3; min-width: 0; }
.date-card .choice-opts { grid-area: opts; }
.date-card .choice-date .slot {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px;
  background: var(--grad-soft); font-size: .8rem; font-weight: 600;
}
.date-card .choice-opts { gap: 6px; flex-wrap: nowrap; }
.date-card .opt { flex: 1 1 0; padding: 10px 4px; min-width: 0; }
.date-card .opt span { font-size: .88rem; white-space: nowrap; }

.date-card.is-yes   { border-color: rgba(47,158,111,.65); background: linear-gradient(135deg, #fff 40%, #e6f7ee); box-shadow: 0 10px 26px -14px rgba(47,158,111,.8); }
.date-card.is-maybe { border-color: rgba(207,122,46,.6);  background: linear-gradient(135deg, #fff 40%, #fdf0dc); box-shadow: 0 10px 26px -14px rgba(207,122,46,.75); }
.date-card.is-no    { border-color: rgba(216,85,107,.45); background: linear-gradient(135deg, #fff 40%, #fbe9ec); }
.date-card.is-no .cal { filter: grayscale(.6); opacity: .8; }
.date-card.is-yes .cal-month { background: linear-gradient(135deg, #3fb57f, #2f9e6f); }
.date-card.pop { animation: pop .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }

/* --- Bouton d'envoi --- */
.cta {
  position: relative; overflow: hidden; width: 100%; margin-top: 18px;
  padding: 16px 22px !important; font-size: 1.05rem !important; letter-spacing: .02em;
}
.cta span { position: relative; z-index: 1; }
.cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-100%); animation: sweep 3.8s ease-in-out infinite 1.2s;
}
@keyframes sweep { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }

/* --- Remerciement --- */
.thanks {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; margin: 0 0 22px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(223,245,232,.95), rgba(255,236,210,.95));
  border: 1px solid rgba(47,158,111,.3);
  box-shadow: 0 16px 36px -18px rgba(47,158,111,.7);
  animation: rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.thanks > div { flex: 1 1 auto; min-width: 0; }
.thanks-check { flex: 0 0 52px; width: 52px; height: 52px; }
.thanks-check circle {
  fill: #2f9e6f; stroke: #bfe9cf; stroke-width: 2;
  transform-origin: center; animation: check-in .5s cubic-bezier(.3,1.5,.5,1) both .1s;
}
.thanks-check path {
  fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s ease-out forwards .5s;
}
@keyframes check-in { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks-title { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; margin: 0 0 2px; color: #1f6b48; }
.thanks-sub { margin: 0 0 10px; color: #3f6b57; font-size: .92rem; }

canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }

/* --- Responsive --- */
@media (max-width: 680px) {
  .date-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "sigil" "text"; text-align: center; }
  .sigil { width: 150px; justify-self: center; }
  .chips { justify-content: center; }
  .hero-desc .note { text-align: left; }
  .who { grid-template-columns: 1fr; }
  .date-card .opt span { font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sigil .ring, .sigil .palace rect, .sigil .palace text, .sigil .flight,
  .hero-title, .chip, .date-card, .cta::after, .thanks, .thanks-check circle { animation: none; }
  .sigil .flight { stroke-dashoffset: 0; opacity: .5; }
  .thanks-check path { animation: none; stroke-dashoffset: 0; }
}
