{% extends 'base.html.twig' %}{% block title %}Faire un Don - Soutenir WA BENIN{% endblock %}{% block body %}<div class="page-header" style="height: 50vh; background-image: linear-gradient(rgba(192, 57, 43, 0.8), rgba(31, 31, 31, 0.9)), url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');"><div class="container fade-up" style="max-width: 800px;"><h1 class="page-title">Chaque Geste Compte</h1><p style="font-size: 1.2rem; color: #fff; opacity: 0.9;">Votre générosité permet de préserver notre patrimoine, de soutenir nos artistes émergents et de financer les éditions du Festival WA BENIN.</p></div></div><section class="section-padding" style="margin-top: -100px; position: relative; z-index: 10;"><div class="container"><div style="background: #fff; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-hover); padding: 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px;"><!-- Donation Form --><div><h3 style="font-size: 1.8rem; margin-bottom: 30px;">Faire un Don Sécurisé</h3><div style="display: flex; gap: 10px; margin-bottom: 25px;"><button type="button" class="btn btn-type active" data-type="unique" style="flex: 1; border-radius: 8px;">Don Unique</button><button type="button" class="btn btn-type" data-type="mensuel" style="flex: 1; border-radius: 8px;">Don Mensuel</button></div><div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px;"><div class="amount-box" data-amount="20">20€</div><div class="amount-box active" data-amount="50">50€</div><div class="amount-box" data-amount="100">100€</div><div style="border: 2px solid #eee; padding: 15px; text-align: center; border-radius: 8px; transition: var(--transition); font-weight: bold; font-size: 1.2rem; grid-column: span 3;" class="amount-custom-box"><input type="number" id="custom_amount" placeholder="Montant libre (€)" min="5" style="border: none; background: transparent; width: 100%; text-align: center; font-size: 1.2rem; outline: none;"></div></div><form action="{{ path('app_checkout') }}" method="POST" id="donationForm" target="_blank"><input type="hidden" name="donation_type" id="donation_type" value="unique"><input type="hidden" name="amount" id="amount" value="50"><div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;"><input type="text" name="firstname" placeholder="Prénom" required style="padding: 15px; border: 1px solid #ddd; border-radius: 8px; width: 100%; outline: none;"><input type="text" name="lastname" placeholder="Nom" required style="padding: 15px; border: 1px solid #ddd; border-radius: 8px; width: 100%; outline: none;"></div><input type="email" name="email" placeholder="Adresse Email" required style="padding: 15px; border: 1px solid #ddd; border-radius: 8px; width: 100%; margin-bottom: 15px; outline: none;"><div style="margin-bottom: 15px;"><label style="display: flex; align-items: center; gap: 10px; cursor: pointer;"><input type="checkbox" name="anonymous" value="1"><span style="color: #666;">Je souhaite faire un don anonyme (mon nom n'apparaîtra pas)</span></label></div><div style="margin-bottom: 25px;"><select name="project_id" style="padding: 15px; border: 1px solid #ddd; border-radius: 8px; width: 100%; outline: none;"><option value="">Soutenir un projet spécifique (Optionnel)</option>{% for project in projects %}<option value="{{ project.id }}">{{ project.title }}</option>{% endfor %}</select></div><div style="margin-bottom: 25px; padding: 15px; border: 1px solid #ddd; border-radius: 8px; display: flex; justify-content: space-between; align-items: center;"><span style="color: #666;"><i class="fas fa-lock" style="color: var(--green); margin-right: 10px;"></i> Paiement sécurisé via Stripe</span><i class="fab fa-cc-stripe fa-2x" style="color: #635bff;"></i></div><button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px; font-size: 1.1rem; border-radius: 8px; display: flex; justify-content: center; align-items: center; gap: 10px;">Valider mon don de <span id="submit_amount">50</span>€</button></form></div><!-- Impact Information & Projects --><div style="background: var(--white-off); padding: 40px; border-radius: 16px;"><h3 style="font-size: 1.8rem; margin-bottom: 30px;">Projets en cours de financement</h3>{% for project in projects|slice(0,3) %}<div style="margin-bottom: 30px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);"><h4 style="margin-bottom: 10px; font-size: 1.2rem;">{{ project.title }}</h4><p style="color: #555; font-size: 0.9rem; margin-bottom: 15px;">{{ project.description|slice(0, 80) ~ '...' }}</p><div style="width: 100%; background: #eee; height: 10px; border-radius: 5px; margin-bottom: 10px;">{% set percent = (project.currentAmount / project.targetAmount) * 100 %}<div style="width: {{ percent > 100 ? 100 : percent }}%; background: var(--green); height: 100%; border-radius: 5px;"></div></div><div style="display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: bold;"><span style="color: var(--green);">{{ project.currentAmount|number_format(0, ',', ' ') }} € collectés</span><span style="color: #888;">Objectif : {{ project.targetAmount|number_format(0, ',', ' ') }} €</span></div></div>{% endfor %}<div style="margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd;"><h4 style="color: var(--gold); margin-bottom: 10px; font-size: 1.3rem;">Pourquoi donner ?</h4><ul style="color: #555; padding-left: 20px;"><li>Transparence totale sur l'utilisation des fonds</li><li>Déduction fiscale à hauteur de 66% (selon juridiction)</li><li>Impact direct sur les artistes locaux béninois</li></ul></div></div></div></div></section><style>.btn-type {background: #f0f0f0;color: #555;}.btn-type.active {background: var(--black-dark);color: #fff;}.amount-box {border: 2px solid #eee;padding: 15px;text-align: center;border-radius: 8px;cursor: pointer;transition: var(--transition);font-weight: bold;font-size: 1.2rem;color: var(--black-dark);}.amount-box.active {border-color: var(--green);background: rgba(116, 172, 49, 0.1);color: var(--green);}.amount-custom-box:focus-within {border-color: var(--green);}</style><script>document.addEventListener('DOMContentLoaded', function() {const btnTypes = document.querySelectorAll('.btn-type');const amountBoxes = document.querySelectorAll('.amount-box');const customAmountInput = document.getElementById('custom_amount');const hiddenType = document.getElementById('donation_type');const hiddenAmount = document.getElementById('amount');const submitAmountSpan = document.getElementById('submit_amount');// Type SelectionbtnTypes.forEach(btn => {btn.addEventListener('click', function() {btnTypes.forEach(b => b.classList.remove('active'));this.classList.add('active');hiddenType.value = this.getAttribute('data-type');});});// Amount SelectionamountBoxes.forEach(box => {box.addEventListener('click', function() {amountBoxes.forEach(b => b.classList.remove('active'));this.classList.add('active');customAmountInput.value = ''; // clear customconst val = this.getAttribute('data-amount');hiddenAmount.value = val;submitAmountSpan.textContent = val;});});// Custom AmountcustomAmountInput.addEventListener('input', function() {amountBoxes.forEach(b => b.classList.remove('active'));const val = this.value;if(val && val >= 5) {hiddenAmount.value = val;submitAmountSpan.textContent = val;} else {hiddenAmount.value = 5;submitAmountSpan.textContent = "5";}});});</script>{% endblock %}