:root {
  --blue: #2E48D4;
  --blue-dark: #1F33A3;
  --blue-soft: #E9EDFF;
  --sun: #FFC53D;
  --ink: #141833;
  --muted: #5E647A;
  --bg: #F4F5FA;
  --card: #FFFFFF;
  --border: #E3E6F0;
  --red: #C8323C;
  --red-soft: #FDECEE;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
a { color: var(--blue); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; border-radius: 6px; }
.hero :focus-visible { outline-color: var(--sun); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: #fff; color: var(--blue-dark); font-weight: 800; padding: 12px 18px; border-radius: 12px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 16px; }

/* ---- En-tête ---- */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(800px 400px at 85% -10%, #4660F0 0%, var(--blue) 45%, var(--blue-dark) 100%); border-radius: 0 0 36px 36px; padding: 18px 0 88px; }
.hero.small { padding-bottom: 72px; }
.hero::before { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: var(--sun); top: -120px; right: -90px; }
.hero .wrap { position: relative; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; opacity: .92; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; }
.hero > .wrap > h1 { margin-top: 28px; }
.org { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.avatar { flex: none; width: 60px; height: 60px; border-radius: 18px; background: #fff; color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.place { margin: 4px 0 0; opacity: .85; font-weight: 600; }
.object { margin: 18px 0 0; font-size: 17px; opacity: .92; max-width: 540px; }

/* ---- Carte et formulaire ---- */
main { margin-top: -56px; position: relative; padding-bottom: 32px; }
.card { background: var(--card); border-radius: 24px; padding: 24px 20px; box-shadow: 0 16px 40px rgba(27, 37, 89, .1); display: grid; gap: 22px; }
.card.center { text-align: center; justify-items: center; gap: 12px; }
.card.center h2 { font-size: 26px; }
.card.center p { margin: 0; color: var(--muted); font-size: 17px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-size: 14px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 10px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.choice span { display: grid; gap: 4px; min-width: 0; }
.choice small { color: var(--muted); font-size: 13.5px; }
.progress { display: block; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--sun); border-radius: 999px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amount { position: relative; }
.amount input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.amount span { display: grid; place-items: center; height: 58px; border: 1.5px solid var(--border); border-radius: 14px; font-weight: 800; font-size: 18px; background: #fff; }
.amount input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.amount input:focus-visible + span { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.other, .field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input[type="text"], input:not([type]), input[type="search"] { font: inherit; font-size: 16px; color: var(--ink); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; min-height: 50px; width: 100%; background: #fff; }
input:not([type]):focus, input[type="search"]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 24px; border: 0; border-radius: 16px; background: var(--blue); color: #fff; font: inherit; font-weight: 800; font-size: 17px; text-decoration: none; cursor: pointer; width: 100%; }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .7; cursor: default; }
.card.center .btn { margin-top: 10px; }
.secure { margin: -8px 0 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.secure svg { flex: none; margin-top: 3px; }
.error { margin: 0; background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.notice { margin: 0; background: var(--sun-soft, #FFF4D6); color: #6B4A00; border-radius: 12px; padding: 12px 14px; font-weight: 600; }

/* ---- Annuaire ---- */
/* Annuaire : cartes avec la photo de l'association, en grille sur grand écran. */
.orgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.org-card { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1.5px solid var(--border); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 6px 20px rgba(27, 37, 89, .06); transition: border-color .15s ease; }
.org-card:hover { border-color: var(--blue); }
.org-media { position: relative; display: block; flex: none; aspect-ratio: 16 / 9; background: var(--blue-soft); }
.org-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.org-ph { display: grid; place-items: center; height: 100%; color: var(--blue); font-size: 44px; font-weight: 800; }
.tag-demo { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .94); color: var(--blue-dark); font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.org-body { display: grid; gap: 4px; padding: 14px 16px 16px; min-width: 0; }
.org-body strong { font-size: 16.5px; line-height: 1.3; }
.org-body small { color: var(--muted); font-size: 13.5px; }
.org-body .obj { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Pied de page, comme sur le site vitrine. */
.foot { margin-top: 48px; background: var(--card); border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.foot-brand .brand { color: var(--ink); }
.foot-brand p { margin: 12px 0 0; max-width: 300px; }
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-links div { display: grid; gap: 10px; align-content: start; }
.foot-links strong { color: var(--ink); font-size: 14px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--blue); }
.foot-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; padding-bottom: 24px; font-size: 13px; }
@media (max-width: 720px) {
  .foot-inner, .foot-links { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .amounts { grid-template-columns: repeat(2, 1fr); }
}
.preview-banner { margin: 0; padding: 12px 16px; background: #FFF4D6; color: #6B4A00; text-align: center; font-size: 15px; }
.fiscal { margin: 4px 0 0; font-size: 13.5px; color: var(--muted, #5E647A); text-align: center; }

/* Logo, présentation et image de campagne */
img.avatar { object-fit: cover; padding: 0; }
.about { margin-top: 16px; }
.about h2 { margin: 0 0 8px; font-size: 18px; }
.about p { margin: 0 0 10px; color: var(--ink); line-height: 1.6; }
.campaign-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 6px; background: var(--blue-soft); }
.choice .desc { white-space: pre-line; }
.choice.with-image > span { flex: 1; }

/* Page de l'association : présentation, galerie et cagnottes à gauche, formulaire à droite */
.wrap.wide { max-width: 1080px; }
/* Téléphone : cagnotte choisie (ou présentation), formulaire juste après, puis les autres propositions.
   Ordinateur : formulaire à droite, qui reste visible pendant le défilement. */
.page-grid { display: grid; gap: 16px; grid-template-areas: "main" "form" "more"; }
.page-main { grid-area: main; display: grid; gap: 16px; align-content: start; min-width: 0; }
.page-form { grid-area: form; min-width: 0; scroll-margin-top: 80px; }
.page-more { grid-area: more; display: grid; gap: 16px; align-content: start; min-width: 0; }
.page-main:empty, .page-more:empty { display: none; }
@media (min-width: 900px) {
  .page-grid { grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "main form" "more form"; align-items: start; }
  .page-form { position: sticky; top: 80px; }
  .only-sm { display: none !important; }
}
.about { margin-top: 0; gap: 12px; }
.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts span { background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 4px 12px; font-size: 13.5px; font-weight: 700; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--blue-soft); }
.gallery a:hover img { opacity: .9; }
.section-title { font-size: 20px; margin: 8px 4px 0; }
.campaigns { display: grid; gap: 16px; }
.campaign-card { padding: 0; overflow: hidden; gap: 0; }
.campaign-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--blue-soft); }
.campaign-body { padding: 20px; display: grid; gap: 12px; }
.campaign-body h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.campaign-body .progress { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.campaign-body .progress i { display: block; height: 100%; border-radius: 999px; background: var(--sun); }
.raised { margin: 0; color: var(--muted); font-size: 14.5px; }
.raised strong { color: var(--ink); }
.campaign-desc p { margin: 0 0 8px; line-height: 1.6; }
/* Téléphone : le formulaire est sous la présentation, ce bouton y mène depuis le bandeau. */
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #FFB61F; }
.hero-cta { margin-top: 20px; }
.btn-soft { background: var(--blue-soft); color: var(--blue-dark); min-height: 48px; font-size: 16px; }
.btn-soft:hover { background: #DCE2FF; }

/* Annuaire : recherche et filtres */
/* Formulaire à côté des cagnottes illustrées : choix compacts (titre et progression seulement). */
.page-form .campaign-image, .page-form .choice .desc { display: none; }

/* ---- Barre de navigation (pages de don) ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.topbar .brand { color: var(--ink); opacity: 1; }
.topbar-links { display: flex; align-items: center; gap: 4px; }
.topbar-links a { color: var(--muted); font-weight: 700; font-size: 14.5px; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.topbar-links a:hover { color: var(--ink); background: var(--bg); }
.topbar-links .topbar-cta { background: var(--blue); color: #fff; padding: 8px 14px; }
.topbar-links .topbar-cta:hover { background: var(--blue-dark); color: #fff; }
.hero { padding-top: 8px; }
.hero .org, .hero > .wrap > h1 { margin-top: 24px; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .topbar-links a { padding: 8px 7px; font-size: 14px; }
  .topbar-links .topbar-cta { padding: 8px 10px; }
}

/* ---- Filtres de l'annuaire : recherche, cause et ville en menus déroulants ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; background: var(--card); padding: 18px; border-radius: 22px; box-shadow: 0 16px 40px rgba(27, 37, 89, .1); margin-bottom: 18px; }
.filter-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.filter-search, .filter-select { display: grid; gap: 6px; margin: 0; min-width: 0; }
.filter-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.filters input[type="search"], .filters select { min-height: 52px; border-radius: 14px; background-color: var(--bg); border-color: transparent; font-weight: 600; }
.filters input[type="search"]:focus, .filters select:focus { background-color: #fff; border-color: var(--blue); }
select { font: inherit; font-size: 16px; color: var(--ink); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 40px 12px 14px; min-height: 48px; width: 100%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E647A' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center no-repeat; appearance: none; -webkit-appearance: none; cursor: pointer; }
select:focus { outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.filter-count { margin: 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
@media (max-width: 720px) {
  .filters { padding: 14px; border-radius: 20px; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .filter-row { grid-template-columns: 1fr; }
}

/* ---- Autres cagnottes : cartes compactes ---- */
.mini-list { display: grid; gap: 10px; }
.card.mini { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 18px; color: var(--ink); text-decoration: none; box-shadow: 0 6px 20px rgba(27, 37, 89, .06); border: 1.5px solid transparent; }
.card.mini:hover { border-color: var(--blue); }
.mini img, .mini-ph { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--blue-soft); display: block; }
.mini-body { display: grid; gap: 6px; min-width: 0; }
.mini-body strong { font-size: 15.5px; line-height: 1.3; }
.mini-body .progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.mini-body .progress i { display: block; height: 100%; background: var(--sun); border-radius: 999px; }
.mini-body small { color: var(--muted); font-size: 13px; }
.mini-go { font-size: 26px; color: var(--muted); }
/* Téléphone : la barre tient sur une ligne, les pastilles défilent sans élargir la page. */
.topbar-links a { white-space: nowrap; }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* Carte de don « en verre d'eau » (animée par don-carte.js) */
.don-card { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1.586; margin: 4px auto 6px; perspective: 1100px; -webkit-tap-highlight-color: transparent; }
.dc-shadow { position: absolute; left: 8%; right: 8%; bottom: -6%; height: 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 30, 90, .32), rgba(20, 30, 90, 0)); filter: blur(14px); pointer-events: none; }
.dc-body { position: relative; width: 100%; height: 100%; border-radius: 6%/9.5%; overflow: hidden; color: #fff; transform-style: preserve-3d; will-change: transform; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.dc-water { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dc-fallback { display: none; position: absolute; inset: 0; background: linear-gradient(160deg, #4A66F5, #1A2B99); }
.dc-fallback > span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(122, 168, 255, .55); transition: height .6s ease; }
.don-card[data-gl="off"] .dc-water { display: none; }
.don-card[data-gl="off"] .dc-fallback, .don-card:not([data-gl]) .dc-fallback { display: block; }
.dc-ui { position: absolute; inset: 0; padding: 7% 7.5% 6.5%; display: flex; flex-direction: column; pointer-events: none; text-align: left; }
.dc-top { display: flex; justify-content: space-between; align-items: center; }
.dc-logo { display: inline-flex; align-items: center; gap: .45em; font-weight: 700; font-size: 1.05em; }
.dc-logo img { width: 1.5em; height: 1.5em; border-radius: .4em; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.dc-sun { width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 .3em rgba(255, 197, 61, .18); }
.dc-amount { margin-top: auto; display: grid; gap: .1em; }
.dc-amount strong { font-size: 2.4em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(10, 20, 80, .25); }
.dc-amount small { font-size: .8em; color: rgba(255, 255, 255, .86); font-weight: 600; }
.dc-amount small, .dc-lbl, .dc-val { text-shadow: 0 1px 3px rgba(10, 20, 80, .45); }
/* Libellé au-dessus du montant : la crête de la vague ne passe pas dessus pour les montants courants. */
.dc-amount small { order: -1; }
.dc-bottom { display: flex; gap: 8%; margin-top: 6%; }
.dc-field { display: grid; gap: .2em; min-width: 0; }
.dc-field:first-child { flex: 1; }
.dc-lbl { font-size: .62em; font-weight: 600; color: rgba(255, 255, 255, .82); }
.dc-val { font-size: .86em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-check { position: absolute; top: 50%; right: 9%; width: 3.4em; height: 3.4em; margin-top: -1.7em; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--blue); box-shadow: 0 6px 18px rgba(10, 20, 80, .28); animation: dcDrop .55s .15s cubic-bezier(.3, 1.5, .5, 1) both; }
.dc-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: dcDraw .5s .5s cubic-bezier(.3, 0, .2, 1) forwards; }
@keyframes dcDrop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes dcDraw { to { stroke-dashoffset: 0; } }
.card.center .don-card { margin-bottom: 8px; }

/* Bouton Donner : l'eau le remplit pendant la redirection vers le paiement */
#pay { position: relative; overflow: hidden; isolation: isolate; }
#pay::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; z-index: -1; background: linear-gradient(180deg, #5C78FF, #3D58E6); border-radius: 0 40% 40% 0 / 0 50% 50% 0; }
#pay.is-filling::before { animation: payFill 1.6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes payFill { to { width: 92%; } }

@media (prefers-reduced-motion: reduce) {
  .dc-fallback > span { transition: none; }
  .dc-check, .dc-check path { animation: none; stroke-dashoffset: 0; }
  #pay.is-filling::before { animation: none; width: 92%; }
}

/* Paiement intégré : le formulaire Stripe remplace les champs, la carte reste au-dessus */
#don-form.is-paying > :not(.don-card):not(.embedded-pay) { display: none; }
.embedded-pay { display: grid; gap: 12px; }
.embedded-pay[hidden] { display: none; }
.embedded-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-btn { border: 0; background: none; padding: 4px 0; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#embedded-checkout { min-height: 360px; }
