/* Quête numérique — page de don (mobile d'abord). */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-normal.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-italic.woff2") format("woff2");
  font-weight: 300 700; font-style: italic; font-display: swap;
}

:root {
  --fond: #fbf7ef;
  --fond-2: #f4ecdc;
  --carte: #ffffff;
  --encre: #1c2d4a;
  --texte: #1f2430;
  --texte-doux: #5b6170;
  --or: #c39a3b;
  --or-texte: #8a6a1f;
  --or-clair: #f3e2b3;
  --bord: #e5dccb;
  --page-logo: #fffdf7;
  --sur-encre: #fbf7ef;
  --ombre: 0 1px 2px rgba(28, 45, 74, .06), 0 6px 18px rgba(28, 45, 74, .07);
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f1626;
    --fond-2: #141d31;
    --carte: #18223a;
    --encre: #e6ecf7;
    --texte: #eef0f5;
    --texte-doux: #a9b1c2;
    --or: #d6b25e;
    --or-texte: #e2c47a;
    --or-clair: #3a3220;
    --bord: #2b3858;
    --page-logo: #1f2b47;
    --sur-encre: #0f1626;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

/* Logo : couleurs pilotées par le thème (le fichier SVG porte des couleurs par défaut). */
.logo-svg { display: block; width: 100%; height: auto; }
.logo-svg .lg-livre, .logo-svg .lg-croix { stroke: var(--encre); }
.logo-svg .lg-page { fill: var(--page-logo); }
.logo-svg .lg-halo, .logo-svg .lg-rayons, .logo-svg .lg-lignes { stroke: var(--or); }

.ecran {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

/* ---------- écran de don ---------- */

.ecran-don { padding-bottom: 210px; }

.entete { text-align: center; padding: 8px 0 6px; }
.entete-logo { width: 84px; margin: 0 auto 8px; }
.surtitre {
  margin: 0; color: var(--or-texte);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
}
.nom { margin: 2px 0 0; font: 600 34px/1.05 var(--serif); color: var(--encre); letter-spacing: .005em; }
.ville { margin: 4px 0 0; color: var(--texte-doux); font-size: 15px; }

.bloc { margin-top: 22px; }
.bloc-titre {
  margin: 0 0 10px; font: 600 22px/1.2 var(--serif); color: var(--encre);
}
.aide { margin: 8px 2px 0; font-size: 14px; color: var(--texte-doux); }
.aide.alerte { color: var(--or-texte); font-weight: 600; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  min-height: 44px; padding: 9px 16px;
  border: 1.5px solid var(--bord); border-radius: 999px;
  background: var(--carte); box-shadow: var(--ombre);
  font-size: 15px; font-weight: 500; line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.puce:active { transform: scale(.97); }
.puce[aria-checked="true"] { background: var(--encre); border-color: var(--encre); color: var(--sur-encre); }
.puce small { display: block; font-size: 11px; opacity: .75; font-weight: 400; }

.montants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.montant {
  height: 68px; border-radius: 16px;
  border: 1.5px solid var(--bord); background: var(--carte); box-shadow: var(--ombre);
  font: 600 32px/1 var(--serif); color: var(--encre);
  display: flex; align-items: center; justify-content: center; gap: 3px;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.montant .devise { font-size: 22px; }
.montant.autre { font: 600 17px/1.1 var(--sans); }
.montant:active { transform: scale(.97); }
.montant[aria-checked="true"] {
  background: var(--encre); border-color: var(--encre); color: var(--sur-encre);
  box-shadow: 0 0 0 3px var(--or-clair), var(--ombre);
}

.eglise-fixee {
  margin: 16px auto 0; padding: 8px 8px 8px 16px; width: fit-content; max-width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: var(--carte); border: 1.5px solid var(--bord); border-radius: 999px; box-shadow: var(--ombre);
  font-size: 15px; font-weight: 600; color: var(--encre);
}
.eglise-fixee::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--or); flex: none;
}
.btn-changer {
  border: 0; background: transparent; padding: 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--texte-doux); text-decoration: underline; text-underline-offset: 3px;
}

.libre { margin-top: 14px; }
.libre-ligne { display: flex; gap: 10px; align-items: stretch; }
.libre-ligne .libre-champ { flex: 1; min-width: 0; }
.btn-libre {
  flex: none; padding: 0 22px; border: 0; border-radius: 16px;
  background: var(--encre); color: var(--sur-encre); font-size: 17px; font-weight: 600;
  transition: opacity .2s;
}
.btn-libre[disabled] { opacity: .35; }
.libre label { display: block; font-size: 14px; color: var(--texte-doux); margin: 0 2px 6px; }
.libre-champ {
  display: flex; align-items: center; gap: 6px;
  background: var(--carte); border: 1.5px solid var(--bord); border-radius: 16px;
  padding: 6px 18px; box-shadow: var(--ombre);
}
.libre-champ:focus-within { border-color: var(--or); }
.libre-champ input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--encre);
  font: 600 36px/1.2 var(--serif); text-align: right;
}
.libre-champ span { font: 600 28px var(--serif); color: var(--encre); }

.demo {
  margin: 20px 0 0; padding: 10px 14px;
  background: var(--or-clair); border-radius: 12px;
  font-size: 14px; color: var(--texte);
  border-left: 4px solid var(--or);
}
.demo strong { white-space: nowrap; }

/* Zone de paiement, fixée en bas de l'écran. */
.paiement {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 18px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, transparent, var(--fond) 26px);
}
.paiement > * { max-width: 448px; margin-left: auto; margin-right: auto; }
.consigne {
  margin-top: 0; margin-bottom: 0; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--bord); color: var(--texte-doux); font-size: 15px;
}
.apple-pay {
  display: block; width: 100%; height: 54px; border: 0; padding: 0;
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: plain;
  -apple-pay-button-style: black;
  border-radius: 14px;
}
@media (prefers-color-scheme: dark) { .apple-pay { -apple-pay-button-style: white; } }
.google-pay { height: 54px; }
.google-pay button { border-radius: 14px !important; }
.btn-donner {
  display: block; width: 100%; height: 54px; border: 0; border-radius: 14px;
  background: var(--encre); color: var(--sur-encre);
  font-size: 18px; font-weight: 600; letter-spacing: .01em;
  box-shadow: var(--ombre);
  transition: transform .1s, opacity .2s;
}
.btn-donner:active { transform: scale(.98); }
.btn-donner[disabled] { opacity: .6; }
.btn-donner.secondaire {
  height: 40px; margin-top: 6px; background: transparent; color: var(--texte-doux);
  box-shadow: none; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.assurance {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; margin-bottom: 0; font-size: 12.5px; color: var(--texte-doux);
}
.assurance svg { width: 14px; height: 14px; fill: var(--or); }

.pied { margin-top: 26px; text-align: center; font-size: 12.5px; color: var(--texte-doux); }
.pied a { color: var(--or-texte); }

/* ---------- écrans centrés (attente, merci, échec) ---------- */

.ecran-centre {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.attente-anneau {
  width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid var(--or-clair); border-top-color: var(--or);
  animation: tourne 1s linear infinite;
}
.attente-texte { margin-top: 18px; font: 500 22px var(--serif); color: var(--encre); }
@keyframes tourne { to { transform: rotate(360deg); } }

.echec-icone svg { width: 64px; height: 64px; fill: none; stroke: var(--or); stroke-width: 3; stroke-linecap: round; }
.echec-titre { margin: 14px 0 6px; font: 600 28px/1.15 var(--serif); color: var(--encre); }
.echec-texte { margin: 0 0 24px; color: var(--texte-doux); max-width: 320px; }
#btn-reessayer { max-width: 320px; }

/* ---------- merci : le logo se dessine, la lumière se lève ---------- */

.ecran-merci {
  background: radial-gradient(120% 70% at 50% 28%, var(--fond-2), var(--fond) 70%);
  max-width: none;
}
.merci-scene { position: relative; width: 230px; height: 230px; }
.merci-logo { position: absolute; inset: 0; }
.merci-lueur {
  position: absolute; inset: -30%;
  background: radial-gradient(circle at 50% 36%, rgba(214, 178, 94, .55), rgba(214, 178, 94, .18) 32%, transparent 62%);
  opacity: 0;
}
.merci-etincelles { position: absolute; inset: 0; pointer-events: none; }
.etincelle {
  position: absolute; left: 50%; top: 34%;
  width: var(--s, 5px); height: var(--s, 5px); border-radius: 50%;
  background: var(--or); box-shadow: 0 0 10px 2px rgba(214, 178, 94, .7);
  opacity: 0;
}
.merci-titre { margin: 18px 0 4px; font: 600 48px/1 var(--serif); color: var(--encre); }
.merci-texte { margin: 6px 0 0; font-size: 17px; max-width: 340px; }
.merci-demo { margin: 10px 0 0; font-size: 13.5px; color: var(--texte-doux); max-width: 320px; }
.merci-verset {
  margin: 26px 0 0; padding: 0 12px; max-width: 340px;
  font: italic 500 21px/1.35 var(--serif); color: var(--or-texte);
}
.merci-verset cite { display: block; margin-top: 4px; font: normal 13px var(--sans); color: var(--texte-doux); letter-spacing: .04em; }
.btn-lien {
  margin-top: 30px; padding: 10px 16px; border: 0; background: transparent;
  color: var(--texte-doux); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}

.anime .lg-halo, .anime .lg-page, .anime .lg-lignes path, .anime .lg-croix path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.anime .lg-halo { animation: trace 1.2s cubic-bezier(.6, .1, .3, 1) .15s forwards; }
.anime .lg-page { fill-opacity: 0; animation: trace .9s ease-out .55s forwards, remplit .8s ease 1.3s forwards; }
.anime .lg-lignes path { animation: trace .5s ease-out 1.35s forwards; }
.anime .lg-croix path:first-child { animation: trace .7s cubic-bezier(.5, 0, .3, 1) 1s forwards; }
.anime .lg-croix path:last-child { animation: trace .45s ease-out 1.5s forwards; }
.anime .lg-rayon {
  opacity: 0; transform-box: view-box; transform-origin: 100px 70px; transform: scale(.55);
  animation: rayon .7s cubic-bezier(.2, 1.4, .4, 1) forwards, scintille 2.6s ease-in-out infinite;
}
.anime .lg-rayon:nth-child(1), .anime .lg-rayon:nth-child(8) { animation-delay: 1.95s, 2.9s; }
.anime .lg-rayon:nth-child(2), .anime .lg-rayon:nth-child(7) { animation-delay: 1.85s, 3.2s; }
.anime .lg-rayon:nth-child(3), .anime .lg-rayon:nth-child(6) { animation-delay: 1.75s, 3.5s; }
.anime .lg-rayon:nth-child(4), .anime .lg-rayon:nth-child(5) { animation-delay: 1.65s, 3.8s; }
.anime .merci-lueur { animation: leve 1.4s ease-out 1.6s forwards, respire 4s ease-in-out 3s infinite; }
.anime .etincelle { animation: monte var(--t, 3s) ease-out var(--d, 2s) infinite; }
.anime .merci-titre, .anime .merci-texte, .anime .merci-demo, .anime .merci-verset, .anime .btn-lien {
  opacity: 0; transform: translateY(10px); animation: apparait .7s ease-out forwards;
}
.anime .merci-titre { animation-delay: 2.1s; }
.anime .merci-texte { animation-delay: 2.35s; }
.anime .merci-demo { animation-delay: 2.5s; }
.anime .merci-verset { animation-delay: 2.8s; }
.anime .btn-lien { animation-delay: 3.4s; }

@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes remplit { to { fill-opacity: 1; } }
@keyframes rayon { to { opacity: 1; transform: scale(1); } }
@keyframes scintille { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .45; } }
@keyframes leve { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes respire { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }
@keyframes apparait { to { opacity: 1; transform: none; } }
@keyframes monte {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x, 0px)), -120px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .anime *, .anime *::before, .anime *::after { animation: none !important; }
  .anime .lg-halo, .anime .lg-page, .anime .lg-lignes path, .anime .lg-croix path { stroke-dashoffset: 0; fill-opacity: 1; }
  .anime .lg-rayon, .anime .merci-lueur, .anime .merci-titre, .anime .merci-texte, .anime .merci-demo,
  .anime .merci-verset, .anime .btn-lien { opacity: 1; transform: none; }
  .anime .etincelle { display: none; }
}

.noscript { padding: 24px; text-align: center; }

/* Très petits écrans (iPhone SE 1re génération) */
@media (max-width: 350px) {
  .nom { font-size: 30px; }
  .montant { height: 60px; font-size: 28px; }
}

/* Cormorant dessine des chiffres elzéviriens (« 1 » ≈ « ı », « 10 » ≈ « IO ») : chiffres alignés partout. */
.nom, .montant, .libre-champ input, .libre-champ span, .merci-titre, .attente-texte, .bloc-titre { font-variant-numeric: lining-nums; }
