@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --navy: #082653;
  --teal: #008f9b;
  --teal-dark: #007c86;
  --cyan: #03bac4;
  --pale: #e9f8f9;
  --coral: #ff5d50;
  --muted: #62748b;
  --error: #c2453c;

  /* Parallaxe pilotée par la souris (main.js), entre -1 et 1 */
  --mx: 0;
  --my: 0;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #f2fbfc;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  overflow-x: hidden;
  color: var(--navy);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #f4fcfd 0%, #ffffff 45%, #eaf8f9 100%);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Fond vivant ─────────────────────────────────────────── */

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

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}

.blob--cyan {
  width: 520px;
  height: 520px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(3, 186, 196, 0.55), transparent 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
  translate: calc(var(--mx) * -30px) calc(var(--my) * -30px);
}

.blob--teal {
  width: 460px;
  height: 460px;
  bottom: -180px;
  left: -140px;
  background: radial-gradient(circle, rgba(0, 143, 155, 0.4), transparent 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
  translate: calc(var(--mx) * 25px) calc(var(--my) * 25px);
}

.blob--coral {
  width: 300px;
  height: 300px;
  top: 55%;
  right: 8%;
  background: radial-gradient(circle, rgba(255, 93, 80, 0.32), transparent 65%);
  animation: drift-c 18s ease-in-out infinite alternate;
  translate: calc(var(--mx) * -45px) calc(var(--my) * -45px);
}

.blob--navy {
  width: 260px;
  height: 260px;
  top: 12%;
  left: 10%;
  background: radial-gradient(circle, rgba(8, 38, 83, 0.14), transparent 65%);
  animation: drift-a 30s ease-in-out infinite alternate-reverse;
  translate: calc(var(--mx) * 40px) calc(var(--my) * 40px);
}

@keyframes drift-a {
  to { transform: translate(-80px, 90px) scale(1.15); }
}

@keyframes drift-b {
  to { transform: translate(110px, -70px) scale(1.2); }
}

@keyframes drift-c {
  to { transform: translate(-120px, -60px) scale(0.85); }
}

.grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(8, 38, 83, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 38, 83, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 55%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 55%);
  transform: perspective(700px) rotateX(55deg) translateY(10%);
  animation: grid-slide 14s linear infinite;
}

@keyframes grid-slide {
  to { background-position: 0 44px, 44px 0; }
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ─── Scène ───────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 540px;
  text-align: center;
}

/* ─── Cadeau ──────────────────────────────────────────────── */

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 44px;
}

.gift {
  position: relative;
  width: 132px;
  height: 139px;
  margin-bottom: 28px;
  translate: calc(var(--mx) * 10px) calc(var(--my) * 8px);
  animation: gift-drop 1.1s var(--ease-spring) both;
  cursor: pointer;
}

.gift__svg {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: gift-float 4.2s ease-in-out 1.1s infinite;
  filter: drop-shadow(0 14px 18px rgba(8, 38, 83, 0.16));
}

.gift__top {
  transform-box: fill-box;
  transform-origin: 85% 100%;
  animation: lid-wiggle 6s ease-in-out 2.4s infinite;
  transition: transform 0.7s var(--ease-spring);
}

.gift__play {
  transform-box: fill-box;
  transform-origin: center;
  animation: play-pulse 2.1s ease-in-out infinite;
}

.gift:hover .gift__svg {
  animation: gift-shake 0.6s ease-in-out;
}

.gift.is-open .gift__top {
  animation: none;
  transform: translate(-6px, -46px) rotate(-22deg);
}

.gift.is-open .gift__svg {
  animation: gift-hop 0.6s var(--ease-spring);
}

.gift__shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -18px;
  width: 96px;
  height: 14px;
  margin-left: -48px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(8, 38, 83, 0.22), transparent);
  animation: shadow-breathe 4.2s ease-in-out 1.1s infinite;
}

.gift__halo {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 55%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border: 2px solid rgba(3, 186, 196, 0.45);
  border-radius: 50%;
  opacity: 0;
  animation: halo 3.6s ease-out 1.2s infinite;
}

.gift__halo--2 { animation-delay: 2.4s; }
.gift__halo--3 { animation-delay: 3.6s; border-color: rgba(255, 93, 80, 0.35); }

@keyframes gift-drop {
  0%   { opacity: 0; transform: translateY(-120px) scale(0.6) rotate(-12deg); }
  60%  { opacity: 1; transform: translateY(8px) scale(1.04, 0.94) rotate(3deg); }
  80%  { transform: translateY(-6px) scale(0.98, 1.03) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes gift-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-10px) rotate(-1.5deg); }
}

@keyframes shadow-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.78); opacity: 0.6; }
}

@keyframes lid-wiggle {
  0%, 78%, 100% { transform: rotate(0); }
  82% { transform: translateY(-5px) rotate(-7deg); }
  86% { transform: translateY(-2px) rotate(5deg); }
  90% { transform: translateY(-3px) rotate(-4deg); }
  94% { transform: rotate(2deg); }
}

@keyframes play-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}

@keyframes gift-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-7deg) scale(1.04); }
  40% { transform: rotate(6deg) scale(1.04); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(2deg); }
}

@keyframes gift-hop {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(6px) scale(1.08, 0.9); }
  70%  { transform: translateY(-14px) scale(0.96, 1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes halo {
  0%   { opacity: 0.9; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(1.9); }
}

/* ─── Logotype ────────────────────────────────────────────── */

.word {
  display: flex;
  margin: 0;
  font-size: clamp(46px, 12vw, 68px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.065em;
}

.word__l {
  display: inline-block;
  opacity: 0;
  animation: letter-in 0.8s var(--ease-out) calc(0.45s + var(--i) * 0.07s) both;
}

.word__l--nc {
  color: transparent;
  background: linear-gradient(100deg, var(--teal) 0%, var(--cyan) 30%, #7fe7ec 45%, var(--cyan) 60%, var(--teal) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation:
    letter-in 0.8s var(--ease-out) calc(0.45s + var(--i) * 0.07s) both,
    shimmer 5s ease-in-out 1.6s infinite;
}

@keyframes letter-in {
  0%   { opacity: 0; transform: translateY(40px) rotate(8deg); filter: blur(8px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes shimmer {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: 0 0; }
}

/* ─── Formulaire ──────────────────────────────────────────── */

.signup {
  position: relative;
  text-align: left;
  animation: rise 0.9s var(--ease-out) 1.05s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.signup__card {
  position: relative;
  padding: 2px;
  border-radius: 20px;
  background: conic-gradient(from var(--angle), rgba(3, 186, 196, 0.15), var(--cyan), rgba(255, 93, 80, 0.7), rgba(3, 186, 196, 0.15) 60%);
  box-shadow: 0 24px 60px rgba(8, 38, 83, 0.14), 0 2px 6px rgba(8, 38, 83, 0.05);
  animation: spin-border 6s linear infinite;
  transition: box-shadow 0.3s;
}

.signup__card:focus-within {
  box-shadow: 0 24px 60px rgba(8, 38, 83, 0.16), 0 0 0 6px rgba(3, 186, 196, 0.16);
}

@keyframes spin-border {
  to { --angle: 360deg; }
}

.signup__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 18px;
  border-radius: 18px;
  background: #fff;
}

.signup__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: #8a99aa;
  transition: color 0.3s, transform 0.3s var(--ease-spring);
}

.signup__card:focus-within .signup__icon {
  color: var(--teal);
  transform: scale(1.12) rotate(-6deg);
}

.signup__input {
  flex: 1;
  min-width: 0;
  padding: 15px 4px;
  border: 0;
  outline: 0;
  color: var(--navy);
  background: transparent;
  font: inherit;
  font-size: 16px;
}

.signup__input::placeholder {
  color: #8a99aa;
}

.signup__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  min-height: 52px;
  padding: 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 143, 155, 0.35);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}

.signup__button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep 3.4s ease-in-out 2.2s infinite;
}

@keyframes sweep {
  0%, 55%  { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

.signup__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 143, 155, 0.42);
}

.signup__button:active {
  transform: translateY(0) scale(0.97);
}

.signup__button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.signup__button[disabled] {
  cursor: wait;
}

.signup__arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease-spring);
}

.signup__button:hover .signup__arrow {
  transform: translateX(4px);
}

.signup__spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.signup.is-loading .signup__label,
.signup.is-loading .signup__arrow { visibility: hidden; }
.signup.is-loading .signup__spinner { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Case à cocher personnalisée */

.signup__consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 6px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.signup__consent input {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.signup__check {
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border: 1.6px solid #b6c3cf;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.85);
  transition: background 0.25s, border-color 0.25s, transform 0.3s var(--ease-spring);
}

.signup__check svg {
  width: 13px;
  height: 13px;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 0.35s var(--ease-out) 0.05s;
}

.signup__consent input:checked + .signup__check {
  border-color: var(--teal);
  background: var(--teal);
  transform: scale(1.12);
}

.signup__consent input:checked + .signup__check svg {
  stroke-dashoffset: 0;
}

.signup__consent input:focus-visible + .signup__check {
  outline: 3px solid rgba(255, 93, 80, 0.6);
  outline-offset: 2px;
}

/* Messages */

.signup__message {
  min-height: 20px;
  margin: 12px 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

.signup__message.is-error {
  color: var(--error);
  animation: pop-in 0.35s var(--ease-spring);
}

.signup.is-error .signup__card {
  animation: spin-border 6s linear infinite, shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(3px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* État « inscrit » */

.signup__done {
  display: none;
  justify-content: center;
  color: var(--teal);
}

.signup__done-icon {
  width: 64px;
  height: 64px;
}

.signup__done-icon circle {
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
}

.signup__done-icon path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
}

.signup.is-success .signup__card,
.signup.is-success .signup__consent {
  display: none;
}

.signup.is-success .signup__done {
  display: flex;
}

.signup.is-success .signup__done-icon circle {
  animation: draw 0.6s var(--ease-out) forwards;
}

.signup.is-success .signup__done-icon path {
  animation: draw 0.4s var(--ease-out) 0.45s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.signup.is-success .signup__message {
  margin-top: 14px;
  color: var(--navy);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  animation: rise 0.6s var(--ease-out) 0.3s both;
}

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

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 620px) {
  .logo {
    margin-bottom: 36px;
  }

  .gift {
    width: 104px;
    height: 110px;
    margin-bottom: 22px;
  }

  .gift__halo {
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
  }

  .signup__row {
    flex-wrap: wrap;
    padding: 8px;
  }

  .signup__icon {
    margin-left: 10px;
  }

  .signup__button {
    width: 100%;
  }

  .blob--cyan { width: 360px; height: 360px; }
  .blob--teal { width: 320px; height: 320px; }
}

/* ─── Mouvement réduit ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }

  .fx {
    display: none;
  }
}
