:root {
  --theme: #b5532f;
  --theme-rgb: 181, 83, 47;
  --text: #1c1613;
  --text-muted: rgba(32, 24, 20, 0.68);
  --mx: 50%;
  --my: 20%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1.1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: #ede2d2;
  overflow-x: hidden;
  position: relative;
}

/* ================= FLUID BACKGROUND + COMITÉ LOGO BEHIND FORM ================= */
.liquid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 248, 236, 0.95), transparent 55%),
    radial-gradient(circle at 82% 84%, rgba(235, 220, 198, 0.92), transparent 55%),
    #ece0ce;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.65;
  will-change: transform, background;
  transition: background 0.75s ease;
}

.blob-1 {
  width: 440px;
  height: 440px;
  top: -110px;
  left: calc(50% - 360px);
  background: rgba(var(--theme-rgb), 0.56);
  animation: liquidFloat1 13s ease-in-out infinite alternate;
}

.blob-2 {
  width: 400px;
  height: 400px;
  bottom: -110px;
  right: calc(50% - 350px);
  background: rgba(var(--theme-rgb), 0.46);
  animation: liquidFloat2 16s ease-in-out infinite alternate;
}

.blob-3 {
  width: 310px;
  height: 310px;
  top: 36%;
  left: calc(50% + 90px);
  background: rgba(242, 182, 120, 0.52);
  animation: liquidFloat3 11s ease-in-out infinite alternate;
}

.blob-4 {
  width: 280px;
  height: 280px;
  bottom: 20%;
  left: calc(50% - 310px);
  background: rgba(255, 255, 255, 0.82);
  animation: liquidFloat1 14s ease-in-out infinite alternate-reverse;
}

/* Stage wrapper anchors the background stamp to one side of the glass form */
.stage {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}

/* Smaller Comité Logistique Logo positioned behind one side (top-right corner) */
.bg-logo-wrap {
  position: absolute;
  top: -46px;
  right: -112px;
  z-index: 0;
  width: 225px;
  pointer-events: none;
  transition: transform 0.25s ease-out;
}

.bg-logo {
  width: 100%;
  height: auto;
  opacity: 0.78;
  transform: rotate(10deg);
  filter: drop-shadow(0 10px 22px rgba(85, 40, 15, 0.16));
  animation: logoBreathe 8s ease-in-out infinite alternate;
}

@keyframes logoBreathe {
  0% { transform: rotate(9deg) translateY(0) scale(0.98); }
  100% { transform: rotate(13deg) translateY(-5px) scale(1.03); }
}

@media (max-width: 560px) {
  .bg-logo-wrap {
    width: 175px;
    top: -38px;
    right: -42px;
  }
}

@keyframes liquidFloat1 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { transform: translate(65px, 45px) scale(1.15) rotate(16deg); }
}

@keyframes liquidFloat2 {
  0% { transform: translate(0, 0) scale(1.05); }
  100% { transform: translate(-60px, -50px) scale(0.92); }
}

@keyframes liquidFloat3 {
  0% { transform: translate(0, 0) scale(0.95); }
  100% { transform: translate(-55px, 40px) scale(1.18); }
}

/* ================= CRYSTAL LIQUID GLASS CARD ================= */
.glass-card {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 34px;
  padding: 2rem 1.8rem 1.85rem;
  text-align: center;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.44) 0%,
    rgba(255, 255, 255, 0.18) 52%,
    rgba(255, 255, 255, 0.34) 100%
  );
  backdrop-filter: blur(11px) saturate(185%) brightness(1.03);
  -webkit-backdrop-filter: blur(11px) saturate(185%) brightness(1.03);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.92),
    inset 0 -1.5px 3px rgba(255, 255, 255, 0.45),
    inset 0 0 34px rgba(255, 255, 255, 0.18),
    0 28px 65px -16px rgba(32, 20, 12, 0.24),
    0 8px 24px -6px rgba(var(--theme-rgb), 0.18);
  overflow: hidden;
  animation: cardAppear 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.22s ease-out, box-shadow 0.5s ease;
}

/* Specular Diagonal Rim Border (Liquid Glass optical edge) */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.6px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.30) 38%,
    rgba(var(--theme-rgb), 0.40) 68%,
    rgba(255, 255, 255, 0.92) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Cursor-reactive Liquid Specular Sheen */
.glass-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    300px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.42),
    transparent 65%
  );
  z-index: 0;
}

.glass-card > *:not(.glass-sheen) {
  position: relative;
  z-index: 1;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================= HEADER & BADGE ================= */
.sub {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.38rem 0.98rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 12px -4px rgba(var(--theme-rgb), 0.2);
  color: var(--theme);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  transition: color 0.4s ease, box-shadow 0.4s ease;
}

.scooter {
  display: inline-block;
  animation: scoot 2.4s ease-in-out infinite;
}

@keyframes scoot {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(3px) rotate(-7deg); }
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 3rem;
  letter-spacing: 0.04em;
  line-height: 1.02;
  margin-bottom: 1.35rem;
  color: #1c1512;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.75);
}

/* ================= FORM & LIQUID GLASS INPUTS ================= */
form {
  display: grid;
  gap: 1.05rem;
}

.inputs {
  display: grid;
  gap: 0.72rem;
}

.glass-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 1.05rem;
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.66),
    rgba(255, 255, 255, 0.42)
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.92),
    0 6px 16px -8px rgba(35, 22, 14, 0.14);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.28s ease,
    transform 0.22s ease;
}

.glass-input:focus-within {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(var(--theme-rgb), 0.75);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(var(--theme-rgb), 0.16),
    0 10px 22px -10px rgba(var(--theme-rgb), 0.25);
  transform: translateY(-1px);
}

.glass-input .icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.glass-input:focus-within .icon {
  color: var(--theme);
  transform: scale(1.08);
}

.glass-input input {
  width: 100%;
  padding: 0.94rem 0;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.glass-input input::placeholder {
  font-weight: 500;
  color: var(--text-muted);
}

/* ================= LIQUID GLASS TEAM TILES ================= */
.teams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.68rem;
  margin-top: 0.1rem;
}

.teams label {
  cursor: pointer;
  animation: tileEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i) * 0.08s + 0.12s);
}

@keyframes tileEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.teams input {
  display: none;
}

.team-glass {
  position: relative;
  display: grid;
  gap: 0.18rem;
  padding: 1.05rem 0.4rem 0.92rem;
  border-radius: 20px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(255, 255, 255, 0.38) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.4px solid rgba(var(--c-rgb), 0.46);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.92),
    0 8px 18px -10px rgba(var(--c-rgb), 0.28);
  color: var(--c);
  font-weight: 600;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.25s ease,
    box-shadow 0.3s ease;
}

/* Liquid shimmer reflection across team tile */
.team-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 25%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 75%
  );
  transform: translateX(-125%);
  transition: transform 0.6s ease;
}

.teams label:hover .team-glass {
  transform: translateY(-4px);
  border-color: rgba(var(--c-rgb), 0.8);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    0 14px 24px -10px rgba(var(--c-rgb), 0.42);
}

.teams label:hover .team-glass::after {
  transform: translateX(125%);
}

.team-glass b {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-glass em {
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

/* Real-time member counter pill */
.member-pill {
  margin: 0.32rem auto 0;
  padding: 0.2rem 0.52rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border-radius: 999px;
  background: rgba(var(--c-rgb), 0.11);
  border: 1px solid rgba(var(--c-rgb), 0.24);
  color: var(--c);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.member-pill.bump {
  animation: countBump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-style: normal;
  font-size: 0.7rem;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Selected Team = Luminous Tinted Liquid Glass */
.teams input:checked + .team-glass {
  background: linear-gradient(
    150deg,
    rgba(var(--c-rgb), 0.90) 0%,
    rgba(var(--c-rgb), 0.72) 100%
  );
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.68),
    inset 0 -2px 6px rgba(0, 0, 0, 0.14),
    0 16px 28px -8px rgba(var(--c-rgb), 0.62);
}

.teams input:checked + .team-glass b {
  transform: scale(1.1);
}

.teams input:checked + .team-glass .check {
  opacity: 1;
  transform: scale(1);
}

.teams input:checked + .team-glass .member-pill {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

/* ================= LIQUID GLASS CTA BUTTON ================= */
.glass-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.05rem 1.5rem;
  margin-top: 0.15rem;
  font: inherit;
  font-weight: 600;
  font-size: 1.02rem;
  color: #fff;
  background: linear-gradient(
    160deg,
    rgba(var(--theme-rgb), 0.94) 0%,
    rgba(var(--theme-rgb), 0.76) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.68),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15),
    0 14px 28px -8px rgba(var(--theme-rgb), 0.62);
  transition:
    background 0.4s ease,
    transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease;
}

.glass-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.38),
    transparent
  );
  transition: left 0.55s ease;
}

.glass-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.78),
    0 18px 32px -8px rgba(var(--theme-rgb), 0.72);
}

.glass-btn:hover::before {
  left: 130%;
}

.glass-btn:active {
  transform: translateY(1px) scale(0.98);
}

.glass-btn .arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.glass-btn:hover .arrow {
  transform: translateX(4px);
}

/* ================= FEEDBACK & CONFIRMATION VIEW ================= */
.view[hidden] {
  display: none !important;
}

#msg {
  font-weight: 600;
  font-size: 0.92rem;
  color: #c0392b;
}

#msg:empty {
  display: none;
}

#msg:not(:empty) {
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
}

.success-view {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0 0.15rem;
  animation: successPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(var(--theme-rgb), 0.95),
    rgba(var(--theme-rgb), 0.75)
  );
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.7),
    0 12px 24px -6px rgba(var(--theme-rgb), 0.55);
  margin-bottom: 0.2rem;
}

.success-view .sub {
  margin-bottom: 0;
}

.success-view h2 {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 2.65rem;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: #1c1512;
  margin-bottom: 0.25rem;
}

.success-box {
  width: 100%;
  display: grid;
  gap: 0.75rem;
  padding: 1.15rem 1.15rem;
  border-radius: 22px;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0.44)
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.2px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.95),
    0 10px 24px -12px rgba(35, 22, 14, 0.14);
  text-align: center;
  line-height: 1.5;
}

.success-box .lead {
  font-size: 1.02rem;
  font-weight: 600;
  color: #1c1613;
}

.whatsapp-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: rgba(37, 211, 102, 0.13);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #176b3a;
  font-size: 0.92rem;
  font-weight: 600;
}

.wa-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: #1da851;
}

.success-box .thanks {
  font-size: 0.93rem;
  color: rgba(30, 23, 19, 0.82);
  font-weight: 500;
}

.whatsapp-cta {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(155deg, #25d366 0%, #169c48 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.65),
    0 12px 24px -8px rgba(22, 156, 72, 0.55);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.whatsapp-cta[hidden],
.redirect-hint[hidden] {
  display: none !important;
}

.whatsapp-cta:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.8),
    0 16px 28px -8px rgba(22, 156, 72, 0.68);
}

.wa-cta-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.redirect-hint {
  font-size: 0.83rem;
  font-weight: 600;
  color: #176b3a;
  opacity: 0.9;
}

.glass-secondary-btn {
  margin-top: 0.45rem;
  padding: 0.72rem 1.25rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--theme);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 6px 16px -8px rgba(var(--theme-rgb), 0.28);
  transition: transform 0.22s ease, background 0.25s ease;
}

.glass-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-2px);
}

/* Confetti particle */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 999;
  animation: confettiFall 0.95s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.4);
  }
}
