:root {
  --encre: #0f0d0a;
  --encre-2: #1a1712;
  --voile: rgba(15, 13, 10, .8);
  --ivoire: #f5efe4;
  --ivoire-doux: #ddd4c4;
  --gris: #b3a998;
  --or: #c9a76a;
  --or-clair: #e4cf9f;
  --or-fonce: #8a6a32;
  --trait: rgba(201, 167, 106, .38);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Jost", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--encre);
  color: var(--ivoire);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 500; }

/* Photo de fond fixe derrière toute la page (fonctionne aussi sur iPhone) */
.fond {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--encre);
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
}
.fond::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .5) 100%),
    rgba(15, 13, 10, .22);
}

.page { position: relative; max-width: 520px; margin: 0 auto; padding: 0 16px; }

.surtitre {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--or-clair);
}

/* ── Couverture (comme le modèle) ─────────── */
.couverture {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 22px 0 70px;
  text-align: center;
  position: relative;
}
.couverture__titre {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(54px, 16vw, 74px);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
  animation: lever 1.2s ease-out both;
}
.ornement { display: block; color: #fff; }
.couverture__ornement { width: min(76%, 290px); margin: -2px auto 26px; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .6)); animation: lever 1.2s .15s ease-out both; }

.cadre {
  position: relative;
  width: min(82%, 410px);
  aspect-ratio: 410 / 575;
  overflow: hidden;
  border-top-right-radius: 50% 36%;
  background: var(--encre-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: lever 1.4s .3s ease-out both;
}
.cadre img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.cadre::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 68%, rgba(0, 0, 0, .88) 100%);
}
.cadre__texte { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 12px 10px; color: #fff; }
.prenom {
  width: fit-content;
  margin: 0;
  font-family: var(--script);
  font-size: clamp(40px, 12vw, 58px);
  line-height: .95;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.prenom span {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.prenom--1 { margin-left: 8%; }
.prenom--2 { margin-left: auto; margin-right: 8%; }
.cadre__et { margin: -10px 0 -8px; font-family: var(--script); font-size: clamp(30px, 9vw, 42px); line-height: 1; }
.cadre__date {
  margin: 8px 6px 0 0;
  text-align: right;
  font-family: var(--script);
  font-size: clamp(24px, 7.2vw, 34px);
  line-height: 1.1;
}
.cadre__ornement { width: 66%; margin: 0 0 0 auto; }

.invite-nom {
  width: min(82%, 410px);
  margin: 30px auto 0;
  padding: 8px 14px 9px;
  background: #fff;
  color: #3a3631;
  font-family: var(--sans);
  font-size: clamp(22px, 6.6vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  animation: lever 1.2s .6s ease-out both;
}
.alerte {
  width: min(82%, 410px);
  margin: 26px auto 0;
  padding: 12px 14px;
  border: 1px solid #b4574f;
  background: rgba(40, 14, 12, .85);
  font-family: var(--sans);
  font-size: 15px;
}
.defiler {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 8px 4px 22px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.defiler::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 9px;
  height: 9px;
  margin-left: -5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  animation: rebond 2.2s ease-in-out infinite;
}

/* ── Sections : panneaux sombres sur la photo de fond ── */
.section {
  margin: 0 0 22px;
  padding: 52px 20px;
  border: 1px solid var(--trait);
  background: var(--voile);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-align: center;
}
.section h2 { margin: 0 0 28px; font-size: 30px; line-height: 1.2; }
.section__ornement { width: 200px; margin: 0 auto 22px; color: var(--or); }
.mot { max-width: 30ch; margin: 0 auto; font-size: 22px; font-style: italic; line-height: 1.55; color: var(--ivoire-doux); }
.signature { margin: 22px 0 0; font-family: var(--script); font-size: 42px; color: var(--or-clair); }

.rebours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.rebours div { padding: 16px 2px 12px; border: 1px solid var(--trait); background: rgba(15, 13, 10, .6); }
.rebours span { display: block; font-size: 38px; font-weight: 500; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.rebours small {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gris);
}
.rebours__fin { margin: 0; font-size: 26px; font-style: italic; color: var(--or-clair); }

.programme { max-width: 420px; margin: 0 auto; padding: 0; list-style: none; }
.etape { position: relative; padding: 26px 18px 24px; border: 1px solid var(--trait); background: rgba(15, 13, 10, .6); }
.etape + .etape { margin-top: 44px; }
.etape + .etape::before {
  content: "";
  position: absolute;
  top: -45px;
  left: 50%;
  width: 1px;
  height: 44px;
  background: var(--trait);
}
.etape time { display: block; font-family: var(--sans); font-size: 14px; letter-spacing: .3em; color: var(--or); }
.etape h3 { margin: 6px 0 12px; font-size: 27px; line-height: 1.2; }
.etape__lieu { margin: 0; font-size: 20px; line-height: 1.35; }
.etape__adresse { margin: 4px 0 20px; font-size: 17px; color: var(--gris); }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid var(--or);
  border-radius: 2px;
  background: var(--or);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.bouton:hover { background: var(--or-clair); }
.bouton--contour { background: transparent; color: var(--or-clair); }
.bouton--contour:hover { background: rgba(201, 167, 106, .14); }
.bouton:focus-visible, .defiler:focus-visible, .wa-flottant:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 3px; }
.bouton:disabled { opacity: .6; cursor: progress; }

/* ── Carte d'entrée ───────────────────────── */
.billet {
  position: relative;
  max-width: 330px;
  margin: 0 auto 26px;
  padding: 28px 22px 20px;
  border-radius: 4px;
  background: var(--ivoire);
  color: var(--encre);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
}
.billet::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--or); pointer-events: none; }
.billet__couple { margin: 0; font-family: var(--script); font-size: 38px; line-height: 1.1; color: var(--or-fonce); }
.billet__nom { margin: 8px 0 14px; font-size: 25px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.billet__infos {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 18px;
  padding: 10px 0;
  border-top: 1px solid rgba(15, 13, 10, .14);
  border-bottom: 1px solid rgba(15, 13, 10, .14);
}
.billet__infos small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #6d6458;
}
.billet__infos strong { font-size: 23px; font-weight: 600; line-height: 1.25; }
.billet__qr { display: grid; place-items: center; min-height: 200px; }
.billet__qr canvas { width: 200px; height: 200px; image-rendering: pixelated; }
.billet__qr p { margin: 0; font-family: var(--sans); font-size: 14px; color: #6d6458; }
.billet__code { margin: 12px 0 0; font-family: var(--sans); font-size: 11px; letter-spacing: .3em; color: #6d6458; }
.aide { max-width: 32ch; margin: 14px auto 0; font-size: 17px; color: var(--gris); }
.apercu { margin: 26px auto 0; max-width: 330px; }
.apercu img { width: 100%; border-radius: 4px; }
.apercu figcaption { margin-top: 10px; font-size: 16px; color: var(--gris); }

.merci__titre { margin: 0 0 10px; font-family: var(--script); font-size: 64px; line-height: 1.1; color: var(--or-clair); }
.merci p:last-child { max-width: 30ch; margin: 0 auto; font-size: 21px; color: var(--ivoire-doux); }
.pied {
  padding: 8px 16px 40px;
  text-align: center;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ivoire-doux);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

/* Bouton WhatsApp flottant (si un numéro est indiqué dans config.php) */
.wa-flottant {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.wa-flottant svg { width: 34px; height: 34px; }

/* ── Page de vérification (scan du QR à l'entrée) ── */
.verif { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100svh; padding: 24px 16px; }
.verif__carte {
  width: 100%;
  max-width: 420px;
  padding: 34px 22px 30px;
  border: 2px solid var(--etat);
  background: var(--encre-2);
  text-align: center;
}
.verif--ok { --etat: #4fb27f; }
.verif--deja { --etat: #e2a53c; }
.verif--inconnu { --etat: #d9584f; }
.verif__icone {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--etat);
  color: #fff;
}
.verif__icone svg { width: 46px; height: 46px; }
.verif__etat {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--etat);
}
.verif__nom { margin: 12px 0 6px; font-size: 34px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.verif__details { margin: 0; font-size: 22px; color: var(--ivoire-doux); }
.verif__details strong { color: var(--ivoire); }
.verif__note { margin: 22px 0 0; font-family: var(--sans); font-size: 14px; color: var(--gris); }
.verif__note a { color: var(--or-clair); }

/* ── Animations ───────────────────────────── */
.js .apparait { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.js .apparait.visible { opacity: 1; transform: none; }
@keyframes lever { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rebond { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(5px) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .couverture__titre, .couverture__ornement, .cadre, .invite-nom, .defiler::after { animation: none; }
  .js .apparait { opacity: 1; transform: none; transition: none; }
}
