/* Pledgo Campagnes — composants. Les variables peuvent être surchargées par le thème. */
:root {
	--pg-primary: #5b3fe0;
	--pg-primary-dark: #3a22a8;
	--pg-primary-soft: #ece8ff;
	--pg-sun: #ffc93c;
	--pg-sun-dark: #f5b400;
	--pg-coral: #ff5a6e;
	--pg-mint: #2ec4a6;
	--pg-sky: #38bdf8;
	--pg-ink: #1b1340;
	--pg-muted: #5e5b78;
	--pg-line: #e6dff5;
	--pg-bg: #fff8ee;
	--pg-card: #ffffff;
	--pg-ok: #12805c;
	--pg-ok-soft: #ddf6ec;
	--pg-warn: #b4540a;
	--pg-error: #b3261e;
	--pg-error-soft: #fde8e6;
	--pg-radius: 18px;
	--pg-shadow: 0 2px 4px rgba(27, 19, 64, .06), 0 12px 28px rgba(91, 63, 224, .12);
}

.pg-campaign *, .pg-grid *, .pg-submit * { box-sizing: border-box; }

/* ---------- Boutons ---------- */
.pg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 46px; padding: .7em 1.4em; border-radius: 999px; border: 2px solid transparent;
	font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.pg-btn:focus-visible { outline: 3px solid var(--pg-primary); outline-offset: 2px; }
.pg-btn--primary { background: var(--pg-sun); color: var(--pg-ink); }
.pg-btn--primary:hover { background: var(--pg-sun-dark); }
.pg-btn--ghost { background: transparent; color: var(--pg-primary-dark); border-color: var(--pg-primary); }
.pg-btn--ghost:hover { background: var(--pg-primary-soft); }
.pg-btn--block { display: flex; width: 100%; }
.pg-btn[disabled] { opacity: .65; cursor: progress; }

/* ---------- Mise en page d'une campagne ---------- */
.pg-campaign {
	display: grid; gap: 32px 48px; align-items: start; margin: 8px 0 40px;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
	grid-template-areas: "stats side" "main side";
	color: var(--pg-ink);
}
.pg-stats { grid-area: stats; }
.pg-main { grid-area: main; }
.pg-side { grid-area: side; position: sticky; top: 24px; }
@media (max-width: 880px) {
	.pg-campaign { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stats" "side" "main"; }
	.pg-side { position: static; }
}

.pg-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pg-badge {
	display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
	background: var(--pg-primary-soft); color: var(--pg-primary-dark);
}
.pg-badge--open { background: #fff0c2; color: #6b4a00; }
.pg-badge--ok { background: var(--pg-ok-soft); color: var(--pg-ok); }
.pg-badge--ended { background: #eeeaf7; color: var(--pg-muted); }
.pg-badge--place { background: transparent; border: 1px solid var(--pg-line); color: var(--pg-muted); }
.pg-owner { margin: 0 0 12px; color: var(--pg-muted); }

.pg-amount { margin: 6px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.pg-amount strong { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.1; color: var(--pg-primary-dark); }
.pg-amount span { color: var(--pg-muted); }

.pg-bar { height: 14px; border-radius: 999px; background: #ebe6fa; overflow: hidden; }
.pg-bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--pg-primary); transition: width .6s ease; }
.pg-bar.is-reached .pg-bar__fill { background: var(--pg-ok); }
.pg-bar__legend { margin: 8px 0 0; color: var(--pg-muted); font-size: .92rem; }

.pg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0 0; }
.pg-facts > div { background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); padding: 12px 14px; }
.pg-facts dt { font-size: .8rem; color: var(--pg-muted); margin: 0 0 2px; }
.pg-facts dd { margin: 0; font-size: 1.25rem; font-weight: 800; }

/* ---------- Contenu ---------- */
.pg-description { margin: 0 0 8px; line-height: 1.65; }
.pg-block { margin: 32px 0 0; }
.pg-block h2 { font-size: 1.35rem; margin: 0 0 14px; }

.pg-tiers { list-style: none; margin: 0; padding: 0 0 0 4px; }
.pg-tier { position: relative; padding: 0 0 18px 30px; color: var(--pg-muted); }
.pg-tier:last-child { padding-bottom: 0; }
.pg-tier::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--pg-line); }
.pg-tier:last-child::before { display: none; }
.pg-tier__dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pg-line); background: var(--pg-card); }
.pg-tier.is-reached { color: var(--pg-ink); }
.pg-tier.is-reached .pg-tier__dot { background: var(--pg-ok); border-color: var(--pg-ok); }
.pg-tier.is-next { color: var(--pg-ink); font-weight: 700; }
.pg-tier.is-next .pg-tier__dot { border-color: var(--pg-sun-dark); background: var(--pg-sun); }
.pg-tier__ok { margin-left: 8px; font-size: .75rem; font-weight: 700; color: var(--pg-ok); background: var(--pg-ok-soft); border-radius: 999px; padding: 2px 10px; }
.pg-tier-hint { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff0c2; color: #5a3d00; font-weight: 600; }

.pg-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pg-checklist li { position: relative; padding-left: 32px; }
.pg-checklist li::before { content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%; background: var(--pg-ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%232e7d4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }

.pg-funds { width: 100%; border-collapse: collapse; background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; }
.pg-funds th, .pg-funds td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--pg-line); }
.pg-funds td { text-align: right; font-weight: 700; white-space: nowrap; }
.pg-funds tr:last-child th, .pg-funds tr:last-child td { border-bottom: 0; }

.pg-supporters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pg-supporters li { background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: 999px; padding: 4px 14px; font-size: .92rem; }

/* ---------- Formulaires ---------- */
.pg-form-card { background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: 20px; padding: 24px; box-shadow: var(--pg-shadow); }
.pg-form__title { margin: 0 0 14px; font-size: 1.3rem; }
.pg-form .pg-field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.pg-form label, .pg-form legend { display: block; font-weight: 700; font-size: .92rem; margin: 0 0 6px; padding: 0; }
.pg-form input[type=text], .pg-form input[type=email], .pg-form input[type=tel], .pg-form input[type=number], .pg-form select, .pg-form textarea {
	width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid #c9bfe6; border-radius: 12px; background: #fff; color: var(--pg-ink); font: inherit;
}
.pg-form textarea { min-height: 140px; resize: vertical; }
.pg-form input:focus, .pg-form select:focus, .pg-form textarea:focus { outline: 3px solid rgba(91, 63, 224, .35); border-color: var(--pg-primary); }
.pg-form .pg-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; margin: 0 0 12px; }
.pg-form .pg-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--pg-primary); }
.pg-form__total { margin: 0 0 6px; padding: 12px 16px; border-radius: 12px; background: var(--pg-primary-soft); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pg-form__total strong { font-size: 1.3rem; color: var(--pg-primary-dark); }
.pg-form__hint, .pg-form__fine { margin: 6px 0 14px; color: var(--pg-muted); font-size: .88rem; }
.pg-form__fine { margin: 14px 0 0; }

.pg-amounts { display: grid; gap: 8px; }
.pg-amounts legend { margin-bottom: 8px; }
.pg-amount-option { display: flex !important; align-items: center; gap: 10px; border: 1.5px solid var(--pg-line); border-radius: 12px; padding: 10px 14px; margin: 0 !important; cursor: pointer; font-weight: 700; }
.pg-amount-option:has(input[type=radio]:checked) { border-color: var(--pg-primary); background: var(--pg-primary-soft); }
.pg-amount-option input[type=radio] { width: 18px; height: 18px; accent-color: var(--pg-primary); flex: none; }
.pg-amount-option--custom input[type=number] { margin-left: auto; width: 110px; min-height: 38px; padding: 6px 10px; }

.pg-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pg-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .pg-row { grid-template-columns: minmax(0, 1fr); } }
.pg-form--wide { max-width: 720px; }

.pg-notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.pg-notice--ok { background: var(--pg-ok-soft); color: #1d5a37; }
.pg-notice--error { background: var(--pg-error-soft); color: var(--pg-error); }
.pg-notice--info { background: var(--pg-primary-soft); color: var(--pg-primary-dark); }

/* ---------- Grille et cartes ---------- */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin: 16px 0; }
.pg-empty { padding: 28px; border: 1.5px dashed var(--pg-line); border-radius: var(--pg-radius); color: var(--pg-muted); text-align: center; }
.pg-card { display: flex; flex-direction: column; background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: 18px; overflow: hidden; box-shadow: var(--pg-shadow); transition: transform .2s ease; }
.pg-card:hover { transform: translateY(-3px); }
.pg-card__media { display: block; aspect-ratio: 16 / 9; background: var(--pg-primary-soft); overflow: hidden; }
.pg-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-card__ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 3.2rem; font-weight: 800; color: var(--pg-primary); background: linear-gradient(135deg, var(--pg-primary-soft), #fff0c2); }
.pg-card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.pg-card__body .pg-btn { margin-top: auto; align-self: flex-start; }
.pg-card__title { margin: 4px 0 0; font-size: 1.15rem; line-height: 1.3; }
.pg-card__title a { color: inherit; text-decoration: none; }
.pg-card__title a:hover { text-decoration: underline; }
.pg-card .pg-owner { margin: 0 0 6px; font-size: .9rem; }
.pg-card__amounts { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.pg-card__amounts strong { font-size: 1.15rem; color: var(--pg-primary-dark); }
.pg-card__amounts span, .pg-card__meta { color: var(--pg-muted); font-size: .9rem; margin: 0; }
.pg-card__meta { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
	.pg-bar__fill, .pg-card, .pg-btn { transition: none; }
	.pg-card:hover { transform: none; }
}

/* ---- Espace membre, contact, chat ---- */
.pg-narrow { max-width: 480px; }
.pg-account h2 { margin-top: 0; }
.pg-code { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; max-width: 12em; font-variant-numeric: tabular-nums; }
.pg-links, .pg-fineprint { font-size: .92rem; color: var(--pg-muted); }
.pg-inline-forms { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.pg-linkbtn { background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 700; color: var(--pg-primary-dark); text-decoration: underline; cursor: pointer; min-height: 44px; }
.pg-table-wrap { overflow-x: auto; }
.pg-table { width: 100%; border-collapse: collapse; background: var(--pg-card); border-radius: 14px; overflow: hidden; }
.pg-table th, .pg-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--pg-line); font-size: .95rem; }
.pg-table th { background: var(--pg-primary-soft); font-weight: 800; }
.pg-captcha { margin: 0 0 14px; }

.pg-chat { position: fixed; right: 18px; bottom: 18px; z-index: 60; font-family: inherit; }
.pg-chat__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 12px; border-radius: 999px; border: 0; cursor: pointer; background: var(--pg-primary); color: #fff; font: inherit; font-weight: 800; box-shadow: 0 4px 0 rgba(27, 19, 64, .25), 0 10px 24px rgba(91, 63, 224, .35); }
.pg-chat__btn:hover { background: #6d52ee; }
.pg-chat__panel { position: absolute; right: 0; bottom: 66px; width: min(340px, calc(100vw - 36px)); background: #fff; border: 3px solid var(--pg-line); border-radius: 24px; box-shadow: var(--pg-shadow); overflow: hidden; }
.pg-chat__panel[hidden] { display: none; }
.pg-chat__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--pg-primary-soft); color: var(--pg-ink); }
.pg-chat__close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; width: 44px; height: 44px; color: var(--pg-ink); }
.pg-chat__body { padding: 16px; }
.pg-chat__bubble { margin: 0 0 12px; padding: 12px 14px; border-radius: 18px 18px 18px 4px; background: #fff3d1; color: var(--pg-ink); }
.pg-chat__links { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.pg-chat__links a { display: block; padding: 10px 0; font-weight: 700; }
@media (max-width: 880px) { body.single-pledgo_campaign .pg-chat { bottom: 92px; } }
@media (prefers-reduced-motion: reduce) { .pg-chat__btn { transition: none; } }
