/* Page publique : ciel de cadeaux, texte de la phase, parcours de participation et mentions.
   Valeurs reprises des maquettes 1c (../Directions Ciel mobile/Ecran.dc.html). */

:root {
  --noir: #000000;
  --orange: #ff7900;
  --orange-clair: #ff8f2e;
  --jaune: #ffd600;
  --blanc: #ffffff;
  --encre: #0a1230;
  --encre-douce: #3a4260;
  --bordure: #c9ccd8;
  --alerte-fond: #fff1e6;
  --alerte-texte: #7a3a00;
  --erreur: #cd3c14;
  --police: "HelvNeueOrange", "Helvetica Neue", Helvetica, "Noto Sans", "Liberation Sans", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--police);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--orange);
}

:focus-visible {
  outline: 2px solid var(--jaune);
  outline-offset: 2px;
}

/* ---- En-tête et pied ---- */

.entete {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0;
}

.entete img {
  display: block;
  width: 40px;
  height: auto;
}

.entete-titre {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.pied {
  display: flex;
  gap: 18px;
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

/* ---- Scène : ciel et texte de la phase ---- */

.scene {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.ciel {
  position: relative;
  height: clamp(320px, 55vh, 520px);
  height: clamp(320px, 55svh, 520px);
  overflow: hidden;
}

.ciel-fond {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  pointer-events: none;
}

.ciel-cadeaux {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}

.slogan {
  position: absolute;
  left: 16px;
  bottom: 0;
  z-index: 2;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  pointer-events: none;
}

.phase {
  display: flex;
  flex-direction: column;
  padding: 22px 16px 24px;
}

.phase p {
  margin: 0;
}

.phase .phase-etiquette,
.carte-etiquette {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--jaune);
}

.phase .phase-compteur {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.phase .phase-etiquette + .phase-compteur {
  margin-top: 8px;
}

.phase-compteur strong {
  font-size: 22px;
  color: var(--blanc);
}

.phase .phase-intro {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.phase .phase-grand {
  margin-top: 6px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.phase .phase-titre {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.phase[data-etat="a_venir"] .phase-titre {
  margin-top: 18px;
}

.phase[data-etat="close"] .phase-titre,
.phase[data-etat="revelee"] .phase-titre {
  margin-top: 16px;
}

.phase[data-etat="vide"] .phase-titre {
  margin-top: 0;
}

.phase .phase-rebours {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.phase .phase-texte {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.phase-bouton {
  width: 100%;
  margin-top: 18px;
  box-shadow: 0 0 30px rgba(255, 121, 0, 0.35);
}

.phase .sans-module {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.js-pret .sans-module {
  display: none;
}

/* ---- Cadeaux ---- */

.cadeau {
  position: absolute;
  z-index: 1;
  width: var(--zone);
  height: var(--zone);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
}

.cadeau:disabled {
  cursor: default;
}

.cadeau--ouvert {
  z-index: 5;
}

.cadeau-eclat {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) * 2.6);
  height: calc(var(--s) * 2.6);
  margin: calc(var(--s) * -1.3) 0 0 calc(var(--s) * -1.3);
  pointer-events: none;
  animation: scintille 1.7s ease-in-out infinite;
  animation-delay: var(--delai, 0s);
  transition: width 0.6s ease, height 0.6s ease, margin 0.6s ease;
}

.cadeau-eclat::before,
.cadeau-eclat::after {
  content: "";
  position: absolute;
  opacity: var(--g);
  transition: opacity 0.6s ease;
}

.cadeau-eclat::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.cadeau-eclat::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.cadeau-boite,
.cadeau-couvercle,
.cadeau-noeud,
.cadeau-visuel {
  position: absolute;
  left: 50%;
  top: 50%;
}

.cadeau-boite {
  width: var(--s);
  height: calc(var(--s) * 0.82);
  margin: calc(var(--s) * -0.32) 0 0 calc(var(--s) / -2);
  background-color: var(--orange);
  background-image: linear-gradient(90deg, transparent 42%, var(--jaune) 42% 58%, transparent 58%);
  box-shadow: 0 0 calc(var(--s) * 0.8) calc(var(--s) * 0.15) rgba(255, 160, 70, 0.6);
}

.cadeau-couvercle {
  width: calc(var(--s) * 1.14);
  height: calc(var(--s) * 0.26);
  margin: calc(var(--s) * -0.52) 0 0 calc(var(--s) * -0.57);
  background-color: var(--orange-clair);
  background-image: linear-gradient(90deg, transparent 42%, var(--jaune) 42% 58%, transparent 58%);
}

.cadeau-noeud {
  width: calc(var(--s) * 0.5);
  height: calc(var(--s) * 0.3);
  margin: calc(var(--s) * -0.8) 0 0 calc(var(--s) * -0.25);
  border: calc(var(--s) * 0.08 + 1px) solid var(--jaune);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.cadeau-visuel {
  display: none;
  width: calc(var(--s) * 1.3);
  height: calc(var(--s) * 1.3);
  margin: calc(var(--s) * -0.65) 0 0 calc(var(--s) * -0.65);
  overflow: hidden;
  border: 2px solid var(--jaune);
  border-radius: 50%;
  background: radial-gradient(circle, #333333, #000000);
  box-shadow: 0 0 calc(var(--s) * 0.9) calc(var(--s) * 0.2) rgba(255, 160, 70, 0.55);
}

.cadeau-visuel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cadeau--revele .cadeau-boite,
.cadeau--revele .cadeau-couvercle,
.cadeau--revele .cadeau-noeud {
  display: none;
}

.cadeau--revele .cadeau-visuel {
  display: block;
  animation: apparition 0.5s ease-out both;
}

.cadeau-etiquette {
  position: absolute;
  top: 50%;
  left: calc(50% + var(--s) * 0.9 + 6px);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--blanc);
  text-shadow: 0 1px 4px #000000;
  pointer-events: none;
  transform: translateY(-50%);
}

.cadeau--etiquette-gauche .cadeau-etiquette {
  left: auto;
  right: calc(50% + var(--s) * 0.9 + 6px);
}

.cadeau-bulle {
  display: none;
  position: absolute;
  bottom: calc(50% + var(--s) * 1.3 + 4px);
  left: 50%;
  padding: 8px 10px;
  background: var(--blanc);
  color: var(--encre);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}

.cadeau[data-bulle="gauche"] .cadeau-bulle {
  left: -6px;
  transform: none;
}

.cadeau[data-bulle="droite"] .cadeau-bulle {
  left: auto;
  right: -6px;
  transform: none;
}

.cadeau--ouvert .cadeau-bulle {
  display: block;
}

.ciel--scintille .cadeau-eclat {
  animation: eclat-global 1.2s ease-in-out;
}

@keyframes scintille {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(0.86);
  }
}

@keyframes eclat-global {
  0%,
  100% {
    transform: scale(1);
    filter: none;
  }
  40% {
    transform: scale(1.35);
    filter: brightness(1.6);
  }
}

@keyframes apparition {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- Carte « hors ligne » ---- */

.carte {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  padding: 22px 20px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.carte p {
  margin: 0;
}

.carte-titre {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.carte-texte {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
}

.carte .bouton {
  height: 48px;
  margin-top: 8px;
  font-size: 16px;
}

/* ---- Boutons ---- */

.bouton {
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: var(--orange);
  color: #000000;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.bouton:hover {
  background: var(--orange-clair);
}

.bouton:disabled {
  opacity: 0.6;
  cursor: default;
}

.alerte {
  padding: 12px 14px;
  background: var(--alerte-fond);
  border: 1px solid var(--orange);
  color: var(--alerte-texte);
  font-size: 14px;
  line-height: 1.4;
}

.alerte strong {
  color: var(--encre);
}

.champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.champ-saisie {
  position: relative;
  display: flex;
  flex-direction: column;
}

.champ input[type="tel"],
.champ input[type="text"] {
  height: 48px;
  padding: 0 12px;
  border: 2px solid var(--bordure);
  border-radius: 0;
  background: var(--blanc);
  color: var(--encre);
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.champ input:focus {
  border-color: var(--encre);
}

.champ input.champ--choisi {
  border-color: var(--orange);
}

.champ input[aria-invalid="true"] {
  border-color: var(--erreur);
}

.champ input:disabled {
  background: #f4f5f8;
}

.champ-erreur {
  margin: 0;
  color: var(--erreur);
  font-size: 13px;
  font-weight: 400;
}

.champ-aide {
  margin: 0;
  color: var(--encre-douce);
  font-size: 13px;
  font-weight: 400;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 3;
  max-height: 200px;
  margin: 2px 0 0;
  padding: 4px 0;
  overflow: auto;
  list-style: none;
  background: var(--blanc);
  border: 2px solid var(--encre);
  box-shadow: 0 10px 30px rgba(10, 18, 48, 0.25);
}

.suggestion {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.suggestion[aria-selected="true"],
.suggestion:hover {
  background: var(--alerte-fond);
  font-weight: 700;
}

.suggestion--message,
.suggestion--message:hover {
  background: transparent;
  color: #6a7190;
  font-size: 14px;
  font-weight: 400;
  cursor: default;
}

.case {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--encre-douce);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.case input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--orange);
}

.champ-piege {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Parcours : la question, l'inscription, les souhaits ---- */

body.parcours-ouvert {
  overflow: hidden;
}

.parcours {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--noir);
}

.parcours:focus,
.parcours-titre:focus {
  outline: none;
}

.parcours-fond {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  pointer-events: none;
}

.parcours-cadre {
  position: relative;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
}

/* La marge automatique centre l'étape quand elle tient, sinon elle part du haut et la fenêtre défile. */
.parcours-etape {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto 0;
}

.parcours-etape--1,
.parcours-etape--2,
.parcours-etape--fin {
  align-items: center;
  text-align: center;
}

.parcours-cadeau {
  --s: 96px;
  --g: 1;
  position: relative;
  flex: none;
  width: calc(var(--s) * 1.6);
  height: calc(var(--s) * 1.5);
}

.parcours-titre {
  margin: 0;
  color: var(--orange);
  font-size: clamp(28px, 9vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.parcours-ligne {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  line-height: 1.4;
}

.est-active .parcours-titre {
  animation: parcours-monte 0.3s ease both;
}

.est-active .parcours-ligne {
  animation: parcours-monte 0.3s ease 0.1s both;
}

@keyframes parcours-monte {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Écran de fin : le cadeau est ouvert, couvercle et nœud soulevés autour du coin bas gauche du couvercle. */
.parcours-etape--fin .cadeau-couvercle,
.parcours-etape--fin .cadeau-noeud {
  transform: translateY(calc(var(--s) * -0.3)) rotate(-12deg);
  animation: parcours-ouvre 0.6s ease 0.2s both;
}

.parcours-etape--fin .cadeau-couvercle {
  transform-origin: 0 100%;
}

.parcours-etape--fin .cadeau-noeud {
  transform-origin: calc(var(--s) * -0.32) calc(var(--s) * 0.54);
}

@keyframes parcours-ouvre {
  from {
    transform: none;
  }
}

/* Étape 2 : une étiquette jaune s'accroche au paquet. */
.parcours-etiquette {
  position: absolute;
  left: calc(50% + var(--s) * 0.45);
  top: calc(50% - var(--s) * 0.45);
  width: calc(var(--s) * 0.42);
  height: calc(var(--s) * 0.26);
  background: var(--jaune);
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 22% 100%, 0 50%);
  transform-origin: 0 50%;
  transform: rotate(14deg);
}

.est-active .parcours-etiquette {
  animation: parcours-etiquette 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) 0.2s both;
}

@keyframes parcours-etiquette {
  from {
    opacity: 0;
    transform: translateY(calc(var(--s) * -0.5)) rotate(-30deg);
  }
}

.parcours-carte {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px;
  background: var(--blanc);
  color: var(--encre);
  text-align: left;
}

.parcours-carte a {
  color: var(--encre);
}

.parcours-actions {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 8px;
}

.lien-retour,
.lien-partage {
  align-self: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.lien-retour:hover,
.lien-partage:hover {
  color: var(--orange);
}

.partage-retour {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}

#parcours-titre-fin {
  overflow-wrap: anywhere;
}

.parcours-points {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 24px;
}

.parcours-points span {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
}

.parcours-points span.est-active {
  background: var(--orange);
}

.parcours-annonce {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.phase .phase-participe {
  margin-top: 18px;
  color: var(--orange);
  font-size: 17px;
  font-weight: 700;
}

.phase:focus {
  outline: none;
}

@media (max-width: 899px) and (max-height: 500px) {
  .parcours-cadeau {
    --s: 56px;
  }

  .parcours-titre {
    font-size: 28px;
  }
}

/* ---- Mentions d'information ---- */

.mentions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
  padding: 28px 16px 40px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.55;
}

.mentions h1 {
  margin: 0;
  color: var(--blanc);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.mentions h2 {
  margin: 8px 0 0;
  color: var(--blanc);
  font-size: 18px;
}

.mentions p {
  margin: 0;
}

.mentions section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mentions-retour {
  align-self: flex-start;
  font-size: 13px;
}

/* ---- Ordinateur ---- */

@media (min-width: 900px) {
  .parcours {
    align-items: center;
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.85);
  }

  .parcours-cadre {
    flex: none;
    width: 440px;
    margin-top: auto;
    padding: 32px;
    border: 1px solid var(--blanc);
    background: var(--noir);
  }

  .parcours-points {
    margin-bottom: auto;
    padding: 16px 0 0;
  }

  .parcours-cadeau {
    --s: 72px;
  }

  .parcours-titre {
    font-size: 34px;
  }

  .scene {
    flex-direction: row;
    align-items: stretch;
  }

  .ciel {
    flex: 1;
    min-width: 0;
    height: auto;
    min-height: 560px;
  }

  .phase {
    flex: none;
    justify-content: center;
    width: 440px;
    padding: 40px 48px 40px 24px;
  }

  .cadeau-etiquette {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
