/* Compléments au style d'origine : cagnotte, formulaires, administration. */
:root {
  --green: #46665a;
  --green-dark: #2f4a42;
  --ink: #344d48;
  --muted: #69766d;
  --paper: #fbf9f3;
  --card: #fffefa;
  --sand: #f2eee5;
  --line: #d9dfd1;
  --line-strong: #a7b49e;
  --accent: #b8895f;
  --ok: #4f7a55;
  --warn: #9a6b2f;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--paper); }
.muted { color: var(--muted); }
.fineprint { font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.button { cursor: pointer; font-weight: 500; transition: background .15s, color .15s, transform .05s; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: default; }
.button.secondary:hover { background: #46665a0d; }
.button.wide { width: 100%; }
.linklike { background: none; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 4px; font-size: 14px; }
.linklike:disabled { opacity: .5; }

/* ---------- Cagnotte ---------- */
.fund { background: var(--sand); border: 1px solid var(--line); border-radius: 14px; margin: 65px 0 35px; padding: 38px clamp(16px, 5vw, 48px); scroll-margin-top: 12px; }
.fund > .eyebrow, .fund > h2, .fund-intro { text-align: center; }
.fund > h2 { margin-top: 6px; }
.fund-intro { color: #64706a; max-width: 560px; margin: 0 auto 28px; line-height: 1.55; }
.fund-body { max-width: 560px; margin: 0 auto; scroll-margin-top: 16px; }
.fund-step { background: var(--card); border: 1px solid #e3e5dc; border-radius: 12px; padding: clamp(20px, 5vw, 32px); }

.fund fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.fund legend, .field label { display: block; font-size: 13px; letter-spacing: .04em; color: var(--ink); margin-bottom: 10px; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.field { margin-bottom: 22px; }
.fund input:not([type=radio]), .fund select, .fund textarea,
.admin input:not([type=radio]):not([type=checkbox]), .admin select, .admin textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
  padding: 13px 14px; font-size: 16px; color: var(--ink); line-height: 1.4;
}
.fund select, .admin select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.fund input:focus, .fund select:focus, .fund textarea:focus, .admin input:focus, .admin select:focus, .admin textarea:focus { outline: 3px solid #b8895f55; outline-offset: 1px; border-color: var(--green); }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.chip { min-height: 48px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font-size: 16px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.amount-field { position: relative; display: block; }
.amount-field span[aria-hidden] { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.methods { display: grid; gap: 10px; }
.method { position: relative; display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; row-gap: 2px; align-items: start; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; padding: 15px 16px; cursor: pointer; }
.method[hidden] { display: none; }
.method input { grid-row: span 2; margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--green); }
.method-title { font-weight: 600; font-size: 15px; }
.method-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.method:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); background: #f7f9f3; }

.field-error { color: #9b3b2c; font-size: 13px; margin: 8px 0 0; }
.privacy { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 16px 0 0; text-align: center; }

/* Étape paiement */
.pay-head { text-align: center; margin-bottom: 18px; }
.pay-amount { font-family: Georgia, serif; font-size: 44px; color: var(--green-dark); line-height: 1.1; }
.pay-head p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.pay-steps { padding-left: 20px; margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.pay-card { border: 1px solid #e3e5dc; border-radius: 10px; overflow: hidden; }
.pay-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label copy" "value copy"; column-gap: 12px; padding: 12px 14px; border-top: 1px solid #ecede6; align-items: center; }
.pay-row:first-child { border-top: 0; }
.pay-label { grid-area: label; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #778372; }
.pay-value { grid-area: value; font-size: 16px; overflow-wrap: anywhere; margin-top: 3px; }
.pay-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .02em; }
.copy { grid-area: copy; border: 1px solid var(--line-strong); background: #fff; color: var(--green); border-radius: 6px; padding: 9px 12px; font-size: 13px; cursor: pointer; min-width: 78px; min-height: 40px; }
.copy.copied { background: var(--green); border-color: var(--green); color: #fff; }
.pay-sepa { display: grid; gap: 18px; }
.qr { margin: 0; text-align: center; }
.qr-code { width: min(220px, 70vw); margin: 0 auto; background: #fff; padding: 14px; border-radius: 10px; border: 1px solid #e3e5dc; }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.pay-actions { display: grid; gap: 6px; justify-items: center; margin-top: 22px; }
.status-line { font-size: 14px; text-align: center; padding: 12px 14px; border-radius: 8px; margin: 0 0 6px; width: 100%; box-sizing: border-box; }
.status-line.declared { background: #f6efe2; color: var(--warn); }

.done { text-align: center; }
.done h3 { font-size: 30px; }
.done p { color: var(--muted); line-height: 1.55; }

.mine { max-width: 560px; margin: 26px auto 0; }
.mine h3 { font-size: 20px; margin: 0 0 10px; }
.mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mine li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--card); border: 1px solid #e3e5dc; border-radius: 10px; padding: 12px 14px; }
.mine-main { display: grid; flex: 1 1 160px; }
.mine-meta { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }

.status { display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #eef0e8; color: var(--muted); white-space: nowrap; }
.status.pending { background: #eef0e8; color: var(--muted); }
.status.declared { background: #f6efe2; color: var(--warn); }
.status.received { background: #e5efe3; color: var(--ok); }
.status.cancelled { background: #f1e9e7; color: #8a5a50; }

/* Sur mobile, on ne peut pas scanner son propre écran : IBAN d'abord, QR ensuite. */
@media (max-width: 640px) {
  .fund { margin: 45px -8px 30px; border-radius: 12px; }
  .pay-sepa .qr { order: 2; }
  .pay-amount { font-size: 38px; }
  .chips { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .fund-body:has(.pay-sepa:not([hidden])) { max-width: 760px; }
  #fund-pay:not([hidden]) .pay-sepa { grid-template-columns: 240px 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
