/* ==========================================================================
   Veux-tu faire un date avec moi ?  —  crème, rose, rouge
   ========================================================================== */

:root {
  --cream: #fbf4e8;
  --cream-2: #f4e6d2;
  --paper: #fffaf1;
  --blush: #f6cfd2;
  --rose: #e58e9b;
  --red: #b3283a;
  --red-dark: #8f1c2d;
  --wine: #5b1a27;
  --ink: #3b1b21;
  --muted: #8a5a62;

  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(246, 207, 210, .55), transparent 70%),
    radial-gradient(800px 600px at 90% 95%, rgba(229, 142, 155, .30), transparent 70%),
    var(--cream);
  overflow-x: hidden;
}

/* Grain de papier discret */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .35;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .3  0 0 0 0 .25  0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Décor ---------- */

.garden { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.cluster { position: absolute; width: min(46vw, 380px); aspect-ratio: 1; }
.cluster svg { position: absolute; display: block; overflow: visible; }

.cluster--tl { top: -70px; left: -70px; }
.cluster--br { bottom: -80px; right: -70px; transform: rotate(180deg); }
.cluster--tr { top: -40px; right: -30px; width: min(26vw, 190px); }
.cluster--bl { bottom: -40px; left: -30px; width: min(26vw, 190px); }

.cluster .b { width: 85%; height: 85%; left: 18%; top: 18%; color: var(--red); opacity: .55; }
.cluster .f1 { width: 46%; height: 46%; left: 22%; top: 22%; }
.cluster .f2 { width: 30%; height: 30%; left: 52%; top: 12%; }
.cluster .f3 { width: 24%; height: 24%; left: 10%; top: 56%; }
.cluster--tr .f1, .cluster--bl .f1 { width: 70%; height: 70%; left: 10%; top: 10%; }
.cluster--tr .f2, .cluster--bl .f2 { width: 46%; height: 46%; left: 48%; top: 48%; }

.f { transform-origin: 50% 50%; animation: sway 9s ease-in-out infinite; }
.f2 { animation-duration: 11s; animation-delay: -3s; }
.f3 { animation-duration: 13s; animation-delay: -6s; }
@keyframes sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 5deg; } }

/* Teintes des fleurs (héritées dans le <use>) */
.tone-rose  { --p: #e58e9b; --c: #f8dcc0; --d: #b3283a; }
.tone-red   { --p: #c8374a; --c: #f6cfa8; --d: #7d1626; }
.tone-blush { --p: #f3bcc3; --c: #fbe6cc; --d: #d4616f; }

.petals ellipse { fill: var(--p); fill-opacity: .82; stroke: var(--d); stroke-opacity: .25; stroke-width: .8; }
.core { fill: var(--c); }
.dot  { fill: var(--d); fill-opacity: .8; }
.stem { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.leaf ellipse { fill: currentColor; fill-opacity: .7; }

/* Cœurs flottants */
.floaters { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.floater {
  position: absolute;
  bottom: -40px;
  fill: var(--rose);
  opacity: 0;
  animation: rise linear infinite;
  will-change: transform, opacity;
}
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) rotate(-8deg); opacity: 0; }
  10%  { opacity: var(--o, .35); }
  50%  { transform: translate3d(var(--dx, 24px), -55vh, 0) rotate(8deg); }
  90%  { opacity: var(--o, .35); }
  100% { transform: translate3d(calc(var(--dx, 24px) * -1), -112vh, 0) rotate(-6deg); opacity: 0; }
}

/* ---------- Scène ---------- */

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.step {
  grid-area: 1 / 1;
  width: min(100%, 640px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step.is-entering { animation: stepIn .75s var(--ease) both; }
.step.is-leaving  { animation: stepOut .38s ease-in both; pointer-events: none; }
@keyframes stepIn  { from { opacity: 0; transform: translateY(26px) scale(.985); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepOut { to   { opacity: 0; transform: translateY(-18px) scale(.985); } }

h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--wine);
  line-height: 1.04;
  letter-spacing: -.01em;
  text-wrap: balance;
  outline: none;
}
h1 { font-size: clamp(2.6rem, 8.4vw, 4.8rem); }
h2 { font-size: clamp(2.1rem, 6.6vw, 3.5rem); }
h1 em, h2 em { font-style: italic; color: var(--red); }

.hand {
  margin: 0 0 6px;
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  color: var(--rose);
  transform: rotate(-2deg);
}

.lead { margin: 22px 0 6px; font-size: 1.08rem; line-height: 1.6; color: var(--muted); max-width: 30em; }

.ornament {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 34px;
}
.ornament span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, var(--rose)); }
.ornament span:last-child { transform: scaleX(-1); }
.ornament svg { width: 18px; height: 18px; fill: var(--red); animation: beat 2.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.22); } 24% { transform: scale(1); } 36% { transform: scale(1.14); } 48% { transform: scale(1); } }

/* ---------- Boutons ---------- */

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: .02em;
  line-height: 1;
  padding: 18px 44px;
  border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }

.btn--yes {
  color: #fff;
  background: linear-gradient(180deg, #c8374a, var(--red));
  box-shadow: 0 10px 24px -10px rgba(179, 40, 58, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--yes:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(179, 40, 58, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn--yes:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn--yes:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn--no {
  color: var(--wine);
  background: var(--paper);
  border: 1.5px solid var(--blush);
  box-shadow: 0 8px 20px -12px rgba(91, 26, 39, .5);
}

/* Les deux boutons : « Non » est posé exactement sur « Oui » */
.answers {
  position: relative;
  display: grid;
  place-items: center;
  height: 76px;
  width: 220px;
}
.answers .btn { grid-area: 1 / 1; }
.answers .btn--yes { padding: 18px 40px; }
.answers .btn--no { z-index: 2; width: 172px; height: 70px; padding: 0; }

/* Quand « Non » s'enfuit, il est retiré du flux et se déplace librement */
.btn--no.is-fleeing {
  position: fixed;
  z-index: 50;
  margin: 0;
  width: auto;
  height: auto;
  padding: 16px 34px;
  transition: left .42s cubic-bezier(.34, 1.56, .5, 1), top .42s cubic-bezier(.34, 1.56, .5, 1), transform .2s;
  will-change: left, top;
}
.btn--no.is-fleeing.is-scared { transform: rotate(-7deg) scale(.94); }

.hint { min-height: 1.6em; margin-top: 22px; font-size: 1.5rem; opacity: .9; }

/* ---------- Champs ---------- */

.fields { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; width: 100%; margin-bottom: 8px; }

.field { display: flex; flex-direction: column; gap: 8px; text-align: left; flex: 1 1 200px; max-width: 250px; }
.field--wide { max-width: none; width: 100%; flex: none; }
.field__label {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); padding-left: 6px;
}

input[type="date"], input[type="time"], textarea {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--blush);
  border-radius: 18px;
  padding: 15px 18px;
  width: 100%;
  outline: none;
  box-shadow: 0 10px 24px -18px rgba(91, 26, 39, .6);
  transition: border-color .2s, box-shadow .2s;
  accent-color: var(--red);
}
input[type="date"], input[type="time"] { min-height: 56px; }
input:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(229, 142, 155, .25); }
textarea { resize: vertical; min-height: 140px; line-height: 1.55; border-radius: 22px; }
textarea::placeholder { color: #b98f95; }

.error { min-height: 1.4em; margin: 12px 0 14px; color: var(--red-dark); font-size: .95rem; }

#form { width: 100%; display: flex; flex-direction: column; align-items: center; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Choix ---------- */

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 118px;
  padding: 18px 10px;
  background: var(--paper);
  border: 1.5px solid var(--blush);
  border-radius: 22px;
  color: var(--wine);
  font-weight: 700;
  font-size: .98rem;
  box-shadow: 0 12px 26px -20px rgba(91, 26, 39, .7);
  transition: transform .3s var(--ease), border-color .25s, background-color .25s, color .25s, box-shadow .3s;
}
.choice__card svg { width: 38px; height: 38px; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.choice:hover .choice__card { transform: translateY(-4px); border-color: var(--rose); box-shadow: 0 18px 30px -18px rgba(179, 40, 58, .55); }
.choice:hover .choice__card svg { transform: scale(1.1) rotate(-4deg); }
.choice input:focus-visible + .choice__card { outline: 3px solid var(--rose); outline-offset: 3px; }
.choice input:checked + .choice__card {
  background: linear-gradient(180deg, #c8374a, var(--red));
  border-color: var(--red);
  color: #fff;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 18px 30px -14px rgba(179, 40, 58, .8);
}
.choice input:checked + .choice__card svg { stroke: #fff; }

/* ---------- Final ---------- */

.big-heart { width: 74px; height: 74px; fill: var(--red); margin-bottom: 18px; filter: drop-shadow(0 12px 14px rgba(179, 40, 58, .35)); animation: beat 2.2s ease-in-out infinite; }
#recap { white-space: pre-line; }

.burst { position: fixed; z-index: 60; pointer-events: none; fill: var(--red); animation: burst 1.6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes burst {
  from { transform: translate(0, 0) scale(.3); opacity: 1; }
  to   { transform: translate(var(--bx), var(--by)) scale(var(--bs, 1)) rotate(var(--br, 0deg)); opacity: 0; }
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  #app { padding: 36px 16px; }
  .choices { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .choice__card { min-height: 104px; }
  .btn { padding: 17px 38px; }
  .cluster--tl, .cluster--br { opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .floaters { display: none; }
}
