Payment Failed Page | Design Html Codepen

.amount-badge text-align: center; background: #f1f5f9; display: inline-block; width: auto; margin: 0 auto 1rem; padding: 0.3rem 1.2rem; border-radius: 40px; font-weight: 600; font-size: 1rem; color: #0f172a; background: #eef2ff; backdrop-filter: blur(2px);

.error-icon background: #fee2e2; width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.2); transition: all 0.2s;

/* action buttons */ .action-buttons display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.8rem; justify-content: center;

<!-- primary actions --> <div class="action-buttons"> <button class="btn btn-primary" id="retryBtn"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"> <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" /> <circle cx="12" cy="12" r="3" /> </svg> Retry Payment </button> <button class="btn btn-secondary" id="supportBtn"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"> <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/> </svg> Contact Support </button> </div> payment failed page design html codepen

// Retry button: simulate redirect to checkout or reload (demo) const retryBtn = document.getElementById('retryBtn'); if(retryBtn) retryBtn.addEventListener('click', (e) => e.preventDefault(); // simulate a new payment attempt with a gentle loading effect retryBtn.innerHTML = `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" style="animation: spin 1s linear infinite;"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg> Processing...`; retryBtn.disabled = true; setTimeout(() => // Demo feedback: In real world you would redirect to checkout or payment gateway. showFloatingMessage("🔁 Redirecting to secure checkout... please try a different card.", "info"); setTimeout(() => retryBtn.innerHTML = `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg> Retry Payment`; retryBtn.disabled = false; // optional: if you want to simulate a page navigation in codepen preview, we just show alert simulation. // but we don't want to break demo, instead show friendly message. showFloatingMessage("Demo: new payment window would open. (use different card)", "success"); , 1600); , 800); );

<div class="message"> We couldn't process your transaction at this time.<br> No funds have been deducted. </div>

.btn-primary background: #1e293b; color: white; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); border: 1px solid #1e293b; // but we don't want to break demo,

.btn-primary:hover background: #0f172a; transform: translateY(-2px); box-shadow: 0 8px 18px -8px #0f172a60;

/* micro-interactions */ button:active transform: translateY(1px);

.suggestion-list li display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: #1f2a44; font-weight: 500; &lt;/div&gt;

.support-link a:hover color: #b91c1c;

/* decorative top bar (error accent) */ .status-bar height: 8px; background: linear-gradient(90deg, #ef4444, #f97316, #ef4444); width: 100%;

.suggestion-list li svg width: 18px; height: 18px; stroke: #f97316; stroke-width: 2; fill: none;

.btn-secondary:hover background: #f8fafc; border-color: #94a3b8; transform: translateY(-2px);

<!-- simple interactive demo simulation (toast / feedback) --> <script> (function() // Helper to show a temporary floating message (like a mini toast) function showFloatingMessage(message, type = 'info') // remove existing toast if any const existingToast = document.querySelector('.custom-toast'); if(existingToast) existingToast.remove();