/* ============================================================================
   myCerfa — compléments du lot « vitrine-a » (gabarit Vitrine)
   Pages : fonctionnalites/recus-fiscaux-cerfa (.recus-*)
           fonctionnalites/crm-donateur        (.crm-*)
           fonctionnalites/campagnes-de-dons   (.camp-*)
   Chargé après assets/css/gabarits.css sur les pages à gabarit (includes/header.php).
   Mêmes principes que le socle : rien n'est masqué sans html.g-js ; html.g-fallback
   réaffiche tout ; animations en transform / opacity ; prefers-reduced-motion est
   déjà neutralisé par le bloc 6 du socle (durées ramenées à ~0).
   ============================================================================ */


/* ============================================================================
   REÇUS FISCAUX CERFA
   ============================================================================ */

/* Hero : le reçu se remplit ligne à ligne quand la scène apparaît */
.recus-stage .cerfa-preview { box-shadow: var(--shadow-lg); max-width: 440px; margin: 0 auto; }
.recus-stage { padding-bottom: 92px; }
.recus-stage .g-layer--bl { bottom: 14px; }
.recus-stage .g-layer--br { bottom: 30px; }
.recus-stage .g-layer-ic { font-family: var(--display); font-weight: 800; color: var(--pine); }
html.g-js .recus-stage .cerfa-rows > div {
  opacity: 0; translate: -14px 0;
  transition: opacity .5s var(--g-ease), translate .6s var(--g-ease-out);
}
html.g-js .recus-stage .cerfa-rows > div:nth-child(1) { transition-delay: .55s; }
html.g-js .recus-stage .cerfa-rows > div:nth-child(2) { transition-delay: .75s; }
html.g-js .recus-stage .cerfa-rows > div:nth-child(3) { transition-delay: .95s; }
html.g-js .recus-stage .cerfa-rows > div:nth-child(4) { transition-delay: 1.15s; }
html.g-js .recus-stage .cerfa-rows > div:nth-child(5) { transition-delay: 1.35s; }
html.g-js .recus-stage.is-in .cerfa-rows > div,
html.g-js.g-fallback .recus-stage .cerfa-rows > div { opacity: 1; translate: none; }
/* Le numéro du reçu « s'imprime » en dernier */
.recus-stage.is-in .cerfa-ref { animation: recus-stamp .7s var(--g-ease-out) 1.6s both; }
@keyframes recus-stamp {
  0% { opacity: 0; transform: scale(1.6); }
  60% { opacity: 1; transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
.recus-stage .cerfa-ref { display: inline-block; color: #ffe58a; font-weight: 800; }

/* Le modèle Cerfa : texte collant + mentions en cartes */
.recus-model {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start;
}
.recus-model-txt { position: sticky; top: calc(var(--g-head-h) + 40px); }
.recus-model-txt h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 16px; }
.recus-model-txt p { font-size: 16px; color: var(--ink-soft); }
.recus-mentions { grid-template-columns: 1fr 1fr; gap: 14px; counter-reset: recm; }
.recus-mentions li {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 18px 18px 16px; box-shadow: var(--shadow-sm); font-size: 14.5px;
  transition: box-shadow .3s, border-color .3s;
}
.recus-mentions li:hover { box-shadow: var(--shadow-md); border-color: #d3daea; }
.recus-mentions li:last-child { grid-column: 1 / -1; }

/* Les modèles de reçus en éventail (au-dessus de 700 px ; dessous : grille simple) */
.recus-fan .model-card { cursor: default; }
@media (min-width: 701px) {
  .recus-fan .model-card { position: relative; }
  html.g-js .recus-fan .model-card {
    transition: transform .95s var(--g-ease-out), box-shadow .3s;
  }
  html.g-js .recus-fan:not(.is-in) .model-card:nth-child(1) { transform: translateX(calc(200% + 28px)) rotate(-14deg); }
  html.g-js .recus-fan:not(.is-in) .model-card:nth-child(2) { transform: translateX(calc(100% + 14px)) rotate(-7deg); }
  html.g-js .recus-fan:not(.is-in) .model-card:nth-child(3) { transform: translateY(12px); }
  html.g-js .recus-fan:not(.is-in) .model-card:nth-child(4) { transform: translateX(calc(-100% - 14px)) rotate(7deg); }
  html.g-js .recus-fan:not(.is-in) .model-card:nth-child(5) { transform: translateX(calc(-200% - 28px)) rotate(14deg); }
  html.g-js .recus-fan .model-card:nth-child(1), html.g-js .recus-fan .model-card:nth-child(5) { transition-delay: .25s, 0s; }
  html.g-js .recus-fan .model-card:nth-child(2), html.g-js .recus-fan .model-card:nth-child(4) { transition-delay: .12s, 0s; }
  html.g-js .recus-fan .model-card:nth-child(3) { z-index: 2; }
  html.g-js .recus-fan .model-card:nth-child(2), html.g-js .recus-fan .model-card:nth-child(4) { z-index: 1; }
  html.g-js.g-fallback .recus-fan .model-card { transform: none; }
  .recus-fan.is-in .model-card:hover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: var(--shadow-lg); }
  .recus-fan.is-in .model-card-add:hover { transform: translateY(-8px); }
}

/* Workflow : fenêtre d'application collante (au lieu du téléphone de la page modèle) */
.recus-win {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-width: 380px; margin: 0 auto;
}
.recus-win-bar {
  display: flex; gap: 6px; padding: 12px 14px; background: var(--ink);
}
.recus-win-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c3d63; }
.recus-win-bar i:first-child { background: #ff5a5f; }
.recus-win-bar i:nth-child(2) { background: #ffd23f; }
.recus-win .g-scrolly-states { height: 400px; }
.recus-win .g-screen { border-radius: 0; padding: 22px 20px 20px; }
.recus-seg { flex-wrap: wrap; }
.recus-seg span { flex: 1 1 auto; }
.recus-sign {
  margin-top: 4px; border: 1.5px dashed #c5cede; border-radius: 12px; padding: 14px 12px 10px;
  font-size: 11.5px; color: var(--ink-soft); text-align: right; position: relative;
}
.recus-sign::before {           /* trait de signature (décoratif) */
  content: ""; display: block; height: 30px; margin: 0 0 6px auto; width: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M4 22c8-14 14-18 16-12s-6 14-2 12 10-16 14-14-2 12 2 12 8-10 12-10 0 8 4 8 10-8 16-8 4 6 10 4 16-6 36-8' fill='none' stroke='%232540d7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / contain;
}
.g-scrolly-state.is-active .recus-sign::before { animation: recus-ink .9s var(--g-ease-out) .2s both; }
@keyframes recus-ink { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.recus-wf .g-scrolly-dots span:not(.is-active) { background: #cfd7e6; }
.recus-wf-list { max-width: 980px; margin: 56px auto 0; }
.recus-wf-list .dive-list {
  grid-template-columns: 1fr 1fr; column-gap: 32px; row-gap: 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 36px 40px; box-shadow: var(--shadow-sm);
}

/* API : la bande garde son look */
.recus-api { position: relative; overflow: hidden; }

@media (max-width: 900px) {
  .recus-stage { padding-bottom: 0; }
  .recus-stage .g-layer--bl, .recus-stage .g-layer--br { bottom: auto; }
  .recus-model { grid-template-columns: 1fr; gap: 32px; }
  .recus-model-txt { position: static; }
  .recus-mentions { grid-template-columns: 1fr; }
  .recus-wf-list { margin-top: 36px; }
  .recus-wf-list .dive-list { grid-template-columns: 1fr; padding: 24px 20px; }
  .recus-api { padding: 44px 20px; }
}


/* ============================================================================
   CRM DONATEUR
   ============================================================================ */

/* Hero : la fiche donateur, son historique se déroule événement par événement */
.crm-stage { padding-bottom: 92px; }
.crm-stage .g-layer--bl { bottom: 12px; }
.crm-stage .g-layer--br { bottom: 44px; }
.crm-stage .donor-file { box-shadow: var(--shadow-lg); max-width: 440px; margin: 0 auto; }
html.g-js .crm-stage .df-event,
html.g-js .crm-stage .df-stat {
  opacity: 0; translate: 0 12px;
  transition: opacity .5s var(--g-ease), translate .6s var(--g-ease-out);
}
html.g-js .crm-stage .df-stat:nth-child(1) { transition-delay: .5s; }
html.g-js .crm-stage .df-stat:nth-child(2) { transition-delay: .62s; }
html.g-js .crm-stage .df-stat:nth-child(3) { transition-delay: .74s; }
html.g-js .crm-stage .df-event:nth-of-type(1) { transition-delay: 1s; }
html.g-js .crm-stage .df-event:nth-of-type(2) { transition-delay: 1.2s; }
html.g-js .crm-stage .df-event:nth-of-type(3) { transition-delay: 1.4s; }
html.g-js .crm-stage.is-in .df-event, html.g-js .crm-stage.is-in .df-stat,
html.g-js.g-fallback .crm-stage .df-event, html.g-js.g-fallback .crm-stage .df-stat { opacity: 1; translate: none; }
.crm-stage.is-in .df-head .av { animation: g-pop .7s var(--g-ease-out) .35s both; }

/* Bénéfices : bento clair, pictogramme qui bascule au survol */
.crm-benefits .feat h2 { font-size: 20px; margin-bottom: 9px; }
.crm-benefits .feat .ic { transition: transform .45s var(--g-ease-out); }
.crm-benefits .feat:hover .ic { transform: scale(1.1) rotate(-6deg); }

/* La fiche donateur : texte collant + liste en cartes */
.crm-fiche {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start;
}
.crm-fiche-txt { position: sticky; top: calc(var(--g-head-h) + 40px); }
.crm-fiche-txt h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 16px; }
.crm-fiche-txt p { font-size: 16px; color: var(--ink-soft); }
.crm-fiche-list { gap: 14px; }
.crm-fiche-list li {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow-sm); font-size: 15px; align-items: flex-start;
  transition: box-shadow .3s, border-color .3s, transform .3s var(--g-ease-out);
}
.crm-fiche-list li:hover { box-shadow: var(--shadow-md); border-color: #d3daea; transform: translateX(4px); }

/* Segmentation : liste d'exemple */
.crm-seg { position: relative; }
.crm-seg > .g-example { margin-bottom: 12px; }
.crm-seg .segment-item { transition: box-shadow .3s, transform .3s var(--g-ease-out); }
.crm-seg .segment-item:hover { box-shadow: var(--shadow-md); transform: translateX(-4px); }

/* Reprise de données : onglets verticaux (≥ 901 px), horizontaux dessous */
.crm-import .g-tab-ink { display: none; }
.crm-import .g-tablist:not([hidden]) {
  gap: 4px; padding: 6px; background: var(--white); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-sm);
}
.crm-import .g-tab {
  text-align: left; padding: 12px 16px; border-radius: 11px; font-size: 15px;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  transition: color .25s, background-color .25s;
}
.crm-import .g-tab:hover { color: var(--pine); background: var(--paper-2); }
.crm-import .g-tab[aria-selected="true"] { color: var(--white); background: var(--pine); box-shadow: 0 6px 18px rgba(37,64,215,.3); }
.crm-tab-ic {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--paper-2); color: var(--pine); font-size: 14px;
}
.crm-import .g-tab[aria-selected="true"] .crm-tab-ic { background: rgba(255,255,255,.18); color: var(--white); }
.crm-imp {
  display: grid; grid-template-columns: 120px 1fr; gap: 36px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 44px; box-shadow: var(--shadow-sm); min-height: 100%;
}
.crm-imp-ic {
  width: 120px; height: 120px; border-radius: 32px; display: grid; place-items: center;
  font-size: 52px; font-weight: 800;
}
.crm-import .g-tabpanel.is-entering .crm-imp-ic { animation: g-pop .6s var(--g-ease-out); }
.crm-imp-txt h3 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 12px; }
.crm-imp-txt p { font-size: 16.5px; color: var(--ink-soft); }
@media (min-width: 901px) {
  html.g-js:not(.g-fallback) .crm-import.is-ready {
    display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: stretch;
  }
  html.g-js:not(.g-fallback) .crm-import.is-ready .g-tablist { flex-direction: column; align-self: start; }
}

/* Comparatif : interrupteur sur fond sombre */
.crm-cmp .g-tabs--switch .g-tablist { background: #101d3a; border: 1px solid #1f3157; box-shadow: none; }
.crm-cmp .g-tabpanel { max-width: 620px; margin-left: auto; margin-right: auto; }
.crm-cmp .ps-col { padding: 34px 36px; }
.crm-cmp .g-tabpanel.is-entering .ps-item { animation: g-li-in .5s var(--g-ease-out) both; }
.crm-cmp .g-tabpanel.is-entering .ps-item:nth-of-type(2) { animation-delay: .06s; }
.crm-cmp .g-tabpanel.is-entering .ps-item:nth-of-type(3) { animation-delay: .12s; }
.crm-cmp .g-tabpanel.is-entering .ps-item:nth-of-type(4) { animation-delay: .18s; }
.crm-cmp .g-tabpanel.is-entering .ps-item:nth-of-type(5) { animation-delay: .24s; }
/* Sans JS : les deux colonnes côte à côte, comme avant */
.crm-cmp .g-tabpanel + .g-tabpanel { margin-top: 20px; }

@media (max-width: 900px) {
  .crm-stage { padding-bottom: 0; }
  .crm-stage .g-layer--bl, .crm-stage .g-layer--br { bottom: auto; }
  .crm-fiche { grid-template-columns: 1fr; gap: 32px; }
  .crm-fiche-txt { position: static; }
  .crm-import .g-tablist:not([hidden]) { overflow-x: auto; scrollbar-width: none; margin-bottom: 22px; }
  .crm-import .g-tablist::-webkit-scrollbar { display: none; }
  .crm-import .g-tab { padding: 10px 12px; font-size: 14px; gap: 8px; }
  .crm-tab-ic { width: 24px; height: 24px; }
  .crm-imp { grid-template-columns: 1fr; gap: 18px; padding: 26px 22px; }
  .crm-imp-ic { width: 72px; height: 72px; border-radius: 22px; font-size: 32px; }
  .crm-cmp .ps-col { padding: 26px 22px; }
  .crm-cmp .g-tabs--switch .g-tab { padding: 10px 12px; font-size: 12.5px; gap: 6px; white-space: nowrap; }
}


/* ============================================================================
   CAMPAGNES DE DONS
   ============================================================================ */

/* Hero : la jauge se remplit, le dernier don « arrive » */
.camp-stage { padding-bottom: 92px; }
.camp-stage .g-layer--bl { bottom: 10px; }
.camp-stage .g-layer--br { bottom: 40px; }
.camp-stage .campaign-card { box-shadow: var(--shadow-lg); max-width: 380px; }
.camp-stage .campaign-btn { display: block; text-align: center; cursor: default; }
.camp-stage .progress-fill { transform-origin: 0 50%; }
html.g-js .camp-stage .progress-fill { transform: scaleX(0); transition: transform 1.6s var(--g-ease-out) .6s; }
html.g-js .camp-stage.is-in .progress-fill, html.g-js.g-fallback .camp-stage .progress-fill { transform: none; }
html.g-js .camp-stage .campaign-donors li {
  opacity: 0; translate: 0 -10px;
  transition: opacity .5s var(--g-ease), translate .6s var(--g-ease-out);
}
html.g-js .camp-stage .campaign-donors li:nth-child(3) { transition-delay: 1.1s; }
html.g-js .camp-stage .campaign-donors li:nth-child(2) { transition-delay: 1.35s; }
html.g-js .camp-stage .campaign-donors li:nth-child(1) { transition-delay: 2.3s; }
html.g-js .camp-stage.is-in .campaign-donors li,
html.g-js.g-fallback .camp-stage .campaign-donors li { opacity: 1; translate: none; }
.camp-stage .campaign-donors li { border-radius: 8px; padding: 3px 6px; margin: 0 -6px; }
.camp-stage.is-in .campaign-donors li:first-child { animation: camp-new 1.6s var(--g-ease) 2.5s both; }
@keyframes camp-new { 0%, 100% { background: transparent; } 25% { background: var(--g-sky-soft); } }
.camp-stage .campaign-tag::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #7ff0c8; margin-right: 6px; vertical-align: 1px;
}
.camp-stage.is-in .campaign-tag::before { animation: camp-live 1.6s ease-in-out 3; }
@keyframes camp-live { 50% { opacity: .2; } }

/* Bénéfices : pictogrammes à la place des chiffres */
.camp-keys .g-key-fig { display: block; font-size: 46px; margin-bottom: 18px; }
.camp-keys.is-in .g-key .g-key-fig { animation: g-pop .7s var(--g-ease-out) both; animation-delay: calc(.2s + var(--g-i, 0) * .12s); }

/* La page de campagne : 6 atouts en cartes */
.camp-page {
  max-width: 1080px; margin: 0 auto; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.camp-page li {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px 22px 20px; box-shadow: var(--shadow-sm); font-size: 15px; align-items: flex-start;
  transition: box-shadow .3s, border-color .3s;
}
.camp-page li:hover { box-shadow: var(--shadow-md); border-color: #d3daea; }
.camp-page a { color: var(--pine); font-weight: 600; }

/* Pilotage : barres qui se remplissent */
.camp-board .cb-head { display: flex; align-items: center; gap: 10px; }
.camp-board .cb-head .g-example { margin-left: auto; background: rgba(255,255,255,.1); color: #c7d0e8; border-color: rgba(255,255,255,.3); }
.camp-board .progress-fill { transform-origin: 0 50%; }
html.g-js .camp-board .progress-fill { transform: scaleX(0); transition: transform 1.4s var(--g-ease-out) .3s; }
html.g-js .camp-board .cb-item:nth-child(2) .progress-fill { transition-delay: .55s; }
html.g-js .camp-board.is-in .progress-fill, html.g-js.g-fallback .camp-board .progress-fill { transform: none; }
.camp-board.is-in .cb-item-done { animation: camp-done .8s var(--g-ease-out) 1.6s both; }
@keyframes camp-done { 0% { transform: scale(.96); opacity: .4; } 60% { transform: scale(1.02); opacity: 1; } 100% { transform: none; } }

/* La page de l'association : maquette de navigateur */
.camp-browser {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-width: 480px; margin: 0 auto;
}
.camp-browser-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.camp-browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d5dcea; }
.camp-browser-bar .g-example { margin-left: auto; }
.camp-browser-body { padding: 22px; display: grid; gap: 14px; }
.camp-asso-head { display: flex; gap: 14px; align-items: center; }
.camp-asso-logo {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--pine-soft); color: var(--pine); font-family: var(--display); font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em;
}
.camp-asso-intro { flex: 1; display: grid; gap: 6px; }
.camp-asso-name { font-family: var(--display); font-weight: 800; font-size: 17px; }
.camp-bar { display: block; height: 7px; border-radius: 6px; background: var(--paper-2); }
.camp-bar.w90 { width: 90%; } .camp-bar.w70 { width: 70%; } .camp-bar.w60 { width: 60%; } .camp-bar.w40 { width: 40%; }
.camp-asso-ctas { display: flex; flex-wrap: wrap; gap: 8px; }
.camp-asso-btn {
  background: var(--pine); color: var(--white); border-radius: 10px; padding: 10px 14px;
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.camp-asso-btn.is-ghost { background: var(--white); color: var(--pine); box-shadow: inset 0 0 0 1.5px var(--pine); }
.camp-asso-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.camp-asso-items { display: grid; gap: 8px; }
.camp-asso-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: grid; gap: 8px; font-size: 13px; }
.camp-asso-item b { font-family: var(--display); }
.camp-asso-item .progress-bar { display: block; }
.camp-asso-item .progress-fill { display: block; }
.camp-asso-item.is-ph { gap: 7px; }
.camp-asso-item .progress-fill { transform-origin: 0 50%; }
html.g-js .camp-asso-items.is-in .progress-fill { animation: g-fill 1.3s var(--g-ease-out) .5s both; }
.camp-asso-visual { position: relative; }
.camp-asso-visual::before {
  content: ""; position: absolute; inset: -18px 26px 26px -18px; border-radius: var(--r-xl); z-index: 0;
  background: var(--apricot-soft);
}
.camp-asso-visual > * { position: relative; z-index: 1; }

/* Comparatif cagnotte : séparateur « vs » entre les colonnes */
.camp-cmp .ps-grid { position: relative; }
.camp-cmp .ps-grid::after {
  content: "vs"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--apricot); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 15px;
  box-shadow: 0 0 0 6px var(--ink); z-index: 2;
}

@media (max-width: 900px) {
  .camp-stage { padding-bottom: 0; }
  .camp-stage .g-layer--bl, .camp-stage .g-layer--br { bottom: auto; }
  .camp-page { grid-template-columns: 1fr; }
  .camp-asso .camp-asso-visual { order: 2; }
  .camp-asso-visual::before { inset: -10px 18px 18px -10px; }
  .camp-cmp .ps-grid::after { display: none; }
  .camp-browser-body { padding: 18px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .camp-page { grid-template-columns: repeat(2, 1fr); }
}
