/* Faux Raccord - composants réutilisables : logo, bulle, boutons, champs, sticker, toast, confettis */

/* ---------- Logo : le mot RACCORD est coupé et décalé, un vrai faux raccord ! ---------- */
.logo {
  margin: 0; display: flex; flex-direction: column; align-items: center;
  font: 400 1rem/.9 var(--font-title); text-transform: uppercase; text-align: center;
  animation: logo-in .7s var(--pop) .1s both;
}
.logo__word { position: relative; display: block; padding: .12em .1em; }
.logo__word--faux {
  font-size: clamp(2.4rem, 13vw, 3.6rem); color: #fff; transform: rotate(-4deg);
  margin-bottom: -.1em; text-shadow: var(--outline), 0 7px 0 var(--blue);
}
.logo__word--raccord {
  font-size: clamp(2.6rem, 16vw, 4.6rem); color: var(--yellow); transform: rotate(2deg);
  text-shadow: var(--outline);
  /* moitié haute, bord en zigzag */
  clip-path: polygon(0 0, 100% 0, 100% 54%, 86% 60%, 72% 51%, 58% 60%, 44% 51%, 30% 60%, 16% 51%, 0 58%);
}
.logo__word--raccord::after {
  /* moitié basse, rose, qui glisse de travers après un instant */
  content: attr(data-text); position: absolute; inset: 0; padding: inherit;
  color: var(--pink); text-shadow: var(--outline), 0 7px 0 var(--blue);
  clip-path: polygon(0 58%, 16% 51%, 30% 60%, 44% 51%, 58% 60%, 72% 51%, 86% 60%, 100% 54%, 100% 100%, 0 100%);
  transform: translate(8px, 3px);
  animation: slip .5s var(--pop) .9s backwards;
}
@keyframes logo-in { from { opacity: 0; transform: scale(.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes slip { from { transform: translate(0, 0); } }

/* ---------- Bulle de BD ---------- */
.bubble {
  position: relative; margin: 0 0 16px; padding: 12px 16px;
  background: #fff; color: var(--ink); text-align: center; font-weight: 700;
  border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 5px 0 var(--ink); transform: rotate(-1deg);
}
.bubble::before, .bubble::after {
  content: ""; position: absolute; left: 28px; border: solid transparent;
}
.bubble::before { bottom: -30px; border-width: 16px 12px; border-top-color: var(--ink); }
.bubble::after  { bottom: -21px; left: 30px; border-width: 14px 10px; border-top-color: #fff; }

/* ---------- Boutons ---------- */
.btn {
  --bg: var(--yellow); --fg: var(--ink);
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 12px 22px;
  font: 400 1.35rem/1 var(--font-title); color: var(--fg); background: var(--bg);
  border: 4px solid var(--ink); border-radius: 20px; box-shadow: 0 7px 0 var(--ink);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform .12s var(--pop), box-shadow .12s;
}
.btn:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) { .btn:hover:not([disabled]) { transform: translateY(-2px) rotate(-1deg); } }
.btn--pink  { --bg: var(--pink); --fg: #fff; text-shadow: 0 2px 0 var(--ink); }
.btn--blue  { --bg: var(--blue); --fg: #fff; text-shadow: 0 2px 0 var(--ink); }
.btn--ghost { --bg: rgba(25, 11, 58, .6); --fg: var(--paper); }
.btn--small { min-height: 44px; padding: 8px 16px; font-size: 1rem; box-shadow: 0 4px 0 var(--ink); }
.btn--icon  { min-width: 58px; padding: 0; font-size: 1.6rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn[disabled]:active { transform: none; box-shadow: 0 7px 0 var(--ink); }

/* ---------- Champs ---------- */
.field { display: grid; gap: 8px; }
.field label { font: 400 1.15rem var(--font-title); text-shadow: 0 2px 0 var(--ink); }
.field__row { display: flex; gap: 10px; }
.field input {
  flex: 1; min-width: 0; min-height: 58px; padding: 10px 16px; text-align: center;
  font: 700 1.3rem var(--font-body); /* >= 16px : évite le zoom automatique sur iPhone */
  color: var(--ink); background: var(--paper);
  border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: inset 0 4px 0 rgba(25, 11, 58, .12), 0 5px 0 var(--ink);
}
.field input::placeholder { color: rgba(25, 11, 58, .45); }
.field input:focus { outline: none; box-shadow: 0 0 0 5px var(--yellow), 0 5px 0 var(--ink); }
.field__error {
  margin: 0; padding: 8px 12px; font-weight: 700; color: #fff; background: var(--pink);
  border: 3px solid var(--ink); border-radius: 14px; transform: rotate(-1deg);
}
.field__error[hidden] { display: none; }

/* ---------- Sticker, toast, confettis ---------- */
.sticker {
  display: inline-block; margin: 0; padding: 6px 16px; transform: rotate(6deg);
  font: 400 1rem var(--font-title); color: #fff; background: var(--blue);
  border: 4px solid #fff; border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
}
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); padding: 10px 18px; white-space: nowrap;
  font: 400 1.05rem var(--font-title); color: var(--ink); background: var(--yellow);
  border: 4px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink);
  animation: toast-in .3s var(--pop);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.8); } }
.confetti-piece { position: fixed; top: 0; left: 0; width: 10px; height: 14px; z-index: 50; pointer-events: none; }
