:root {
  --rose: #cc7881;
  --rose-dark: #b86871;
  --accent-tea: #4a9b9b;
  --noir: #333;
  --blanc: #fff;
  --maxw: 720px;
}

/* Polices locales */
@font-face {
  font-family: "Banana Cupcake";
  src: url("fonts/Banana Cupcake.ttf") format("truetype");
}
@font-face {
  font-family: "Photography";
  src: url("fonts/Photography.otf") format("opentype");
}
@font-face {
  font-family: "Montreal Regular";
  src: url("fonts/MontrealRegular.ttf") format("truetype");
}
@font-face {
  font-family: "Montreal Medium";
  src: url("fonts/MontrealMedium.ttf") format("truetype");
}

body {
  margin: 0;
  font-family: "Montreal Regular", sans-serif;
  color: var(--noir);
  background: var(--blanc);
  line-height: 1.1;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: center;
}

.logo {
  display: block;
  width: 160px;
  max-width: 80vw;
  height: auto;
  margin: 1.25rem auto 0.75rem;
}

/* Intro logo plein viewport */
#logo-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: none;
  animation: introOverlay 3.25s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  overflow: hidden; /* important pour clipper les particules */
}
/* Couche particules */
#logo-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* Petites particules (multi points) */
  background: radial-gradient(
      circle at 10% 20%,
      rgba(255, 255, 255, 0.9) 0 2px,
      transparent 3px
    ),
    radial-gradient(
      circle at 30% 80%,
      rgba(255, 255, 255, 0.7) 0 1.5px,
      transparent 3px
    ),
    radial-gradient(
      circle at 55% 35%,
      rgba(255, 255, 255, 0.8) 0 1.8px,
      transparent 3px
    ),
    radial-gradient(
      circle at 70% 65%,
      rgba(255, 255, 255, 0.65) 0 1.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at 88% 25%,
      rgba(255, 255, 255, 0.85) 0 1.7px,
      transparent 3px
    );
  background-size: 220px 160px;
  opacity: 0.55;
  mix-blend-mode: screen;

  animation: particlesDrift 4s linear infinite;
  z-index: 1;
}

/* Deuxième couche : quelques étoiles plus grosses et lentes */
#logo-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;

  background: radial-gradient(
      circle at 18% 30%,
      rgba(255, 255, 255, 0.85) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 42% 68%,
      rgba(255, 255, 255, 0.75) 0 2.5px,
      transparent 4px
    ),
    radial-gradient(
      circle at 66% 26%,
      rgba(255, 255, 255, 0.8) 0 2.8px,
      transparent 4px
    ),
    radial-gradient(
      circle at 78% 72%,
      rgba(255, 255, 255, 0.7) 0 2.4px,
      transparent 4px
    ),
    radial-gradient(
      circle at 90% 40%,
      rgba(255, 255, 255, 0.82) 0 2.6px,
      transparent 4px
    );

  background-size: 320px 240px;
  opacity: 0.35;
  mix-blend-mode: screen;

  animation: particlesFloat 6.5s ease-in-out infinite;
}

@keyframes particlesFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.28;
  }
  50% {
    transform: translate3d(40px, -30px, 0);
    opacity: 0.45;
  }
}

@keyframes particlesDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-80px, 60px, 0);
  }
}

/* Pour être sûr que le logo passe au-dessus */
.logo-intro-img {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  animation: logoIntro 3.25s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes logoIntro {
  /* Hold plein écran ~3s */
  0%,
  60% {
    top: 50%;
    width: 100vw;
    height: 100vh;
    opacity: 1;
  }
  /* Transition vers la taille du header */
  90% {
    top: 34px;
    width: 190px;
    height: 190px;
    opacity: 1;
  }
  100% {
    top: 42px;
    width: 160px;
    height: 160px;
    opacity: 0;
  }
}

@keyframes introOverlay {
  0%,
  60% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #logo-intro {
    animation: none;
    opacity: 0;
    visibility: hidden;
  }
  .logo-intro-img {
    animation: none;
  }
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  border-radius: 12px;
}

h1,
h2,
h3 {
  font-family: "Photography", cursive;
  color: var(--rose);
  text-align: center;
  line-height: 3rem;
  margin: 0 0 0.35rem;
}

p {
  text-align: center;
  margin: 0 0 1.25rem;
}

/* Espace entre le texte teasing et le formulaire */
main p + form {
  margin-top: 1.25rem;
}

label {
  color: var(--noir);
}

form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

input[type="text"],
input[type="email"],
input[type="tel"],
button {
  width: 100%;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: "Montreal Regular";
}

input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  margin: 0;
  accent-color: var(--accent-tea);
}

button {
  background: linear-gradient(180deg, var(--rose), var(--rose-dark));
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.links {
  text-align: center;
  margin-top: 1rem;
}

a {
  color: var(--accent-tea);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  margin: 2rem 0 1rem;
  font-size: 0.9rem;
  color: #888;
}

.hide {
  display: none;
}

/* Évite les checkboxes invisibles si Materialize est chargé */

[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
  position: inherit;
  opacity: 1;
}

/* Mobile: plus "fluide", sans forcer à tout faire tenir */
@media (max-width: 480px) {
  .logo {
    width: 130px;
    margin: 1rem auto 0.6rem;
  }

  main {
    width: calc(100% - 1.5rem);
    margin: 0 auto 1rem;
    border-radius: 12px;
    padding: 1rem;
  }

  h1 {
    font-size: 3rem;
    line-height: 3rem;
    margin-bottom: 0.35rem;
  }

  p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  form {
    gap: 0.9rem;
    padding: 1rem;
  }

  input,
  button {
    padding: 0.65rem;
  }

  button {
    font-size: 1.05rem;
  }

  /* Préférences : propre + wrap */
  fieldset {
    margin: 0;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.2rem;
    row-gap: 0.6rem;
    align-items: center;
  }

  fieldset legend {
    width: 100%;
    margin-bottom: 0.25rem;
  }

  fieldset label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    white-space: nowrap;
  }

  .links {
    margin-top: 0.75rem;
    font-size: 0.92rem;
  }

  footer {
    margin: 1.5rem 0 1rem;
    font-size: 0.82rem;
  }
}

/* Mobiles très bas en hauteur : léger resserrage */
@media (max-width: 480px) and (max-height: 720px) {
  .logo {
    width: 120px;
    margin: 0.8rem auto 0.5rem;
  }

  h1 {
    font-size: 2.5rem;
    line-height: 2.5rem;
  }

  form {
    gap: 0.75rem;
    padding: 0.9rem;
  }
}
