/* Fétali — démonstration de la page invité (/demo).
 * Mêmes couleurs, mêmes animations que la vraie page du photobooth
 * (PHOTOBOOTH/…/fetali_api/templates/download.html), réunies ici parce que la
 * CSP du site interdit les styles écrits dans le HTML. */
:root {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 0 24px;
  background: linear-gradient(160deg, #1a1030, #3a1224);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #f2f4f8;
}
.card {
  width: min(92vw, 460px);
  background: #171c24;
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
h1 {
  color: #e8567a;
  margin: 0 0 4px;
  font-size: 40px;
}
.event {
  color: #9aa4b2;
  margin: 0 0 20px;
}
.photo {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  margin-bottom: 20px;
}
.btn {
  display: inline-block;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: #e8567a;
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}
.btn:active {
  background: #c53e62;
}

/* --- Attente : un Polaroid qui se développe + phrases complices --- */
.loader {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.loader.is-done {
  opacity: 0;
  transform: scale(0.96);
}
.stage {
  position: relative;
  width: 156px;
  height: 188px;
  margin: 10px auto 28px;
}
.flash {
  position: absolute;
  inset: -44px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 62%);
  animation: flash 4.8s ease-out infinite;
}
.polaroid {
  position: absolute;
  inset: 0;
  padding: 12px 12px 42px;
  border-radius: 6px;
  background: #f6f1e7;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
  transform-origin: 50% 85%;
  animation: wobble 2.6s ease-in-out infinite;
}
.film {
  position: relative;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a1a33, #6b2448, #e8567a, #f7b98b, #2a1a33);
  background-size: 300% 300%;
  animation: film 4.8s ease-in-out infinite;
}
.smile {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58%;
  height: 58%;
  color: #fff7ec;
  opacity: 0;
  animation: smile 4.8s ease-in-out infinite;
}
.quip {
  min-height: 4.2em;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.quip.is-out {
  opacity: 0;
  transform: translateY(6px);
}
.dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 4px;
}
.dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e8567a;
  animation: dot 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* --- Révélation : la photo « se développe » à son tour --- */
.result.is-revealed .photo {
  animation: develop 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.result.is-revealed .btn {
  animation: rise 0.5s 0.65s ease-out both;
}

/* --- Le bandeau de démonstration (absent de la vraie page) --- */
.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  width: min(92vw, 460px);
  padding: 12px 16px;
  border: 1px solid rgba(242, 244, 248, 0.14);
  border-radius: 16px;
  background: rgba(23, 28, 36, 0.6);
  color: #c9cfd8;
  font-size: 14px;
  text-align: center;
}
.demo p {
  margin: 0;
}
.demo strong {
  color: #f2f4f8;
}
.demo a {
  color: #f2b33d;
  font-weight: 700;
  text-decoration: none;
}
.demo a:hover {
  text-decoration: underline;
}

@keyframes wobble {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-7px);
  }
}
@keyframes flash {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  3% {
    opacity: 1;
    transform: scale(1);
  }
  12%,
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}
@keyframes film {
  0%,
  100% {
    background-position: 0% 0%;
    filter: brightness(0.55) saturate(0.5);
  }
  55% {
    background-position: 100% 100%;
    filter: brightness(1.05) saturate(1.1);
  }
}
@keyframes smile {
  0%,
  25% {
    opacity: 0;
    transform: scale(0.85);
  }
  55%,
  80% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}
@keyframes dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-7px);
    opacity: 1;
  }
}
@keyframes develop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95) rotate(-1.5deg);
    filter: blur(12px) saturate(0) brightness(1.6);
  }
  45% {
    opacity: 1;
    filter: blur(4px) saturate(0.5) brightness(1.25);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid,
  .flash,
  .smile,
  .dots span {
    animation: none;
  }
  .smile {
    opacity: 0.9;
  }
  .film {
    animation-duration: 12s;
  }
  .loader,
  .quip {
    transition: none;
  }
  .result.is-revealed .photo,
  .result.is-revealed .btn {
    animation: none;
  }
}
