.error-icon .cross-fill stroke: #b91c1c;
.support-link text-align: center; margin-top: 2rem; font-size: 0.8rem; color: #5b6e8c;
.message text-align: center; color: #475569; font-weight: 500; font-size: 1rem; line-height: 1.5; margin: 1rem 0 0.6rem; background: #f8fafc; padding: 0.9rem 1rem; border-radius: 1.2rem; border: 1px solid #e9eef3;
.error-detail span:last-child font-weight: 500; word-break: break-word; flex: 1; payment failed page design html codepen
.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;
.btn-primary background: #1e293b; color: white; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); border: 1px solid #1e293b;
/* typography */ h1 font-size: 1.9rem; font-weight: 700; text-align: center; color: #1e293b; letter-spacing: -0.3px; margin-bottom: 0.75rem; .error-icon .cross-fill stroke: #b91c1c
/* suggestion box */ .suggestion-box background: #f9f9fc; border-radius: 1.2rem; padding: 1rem 1.2rem; margin: 1.5rem 0 1.8rem; border: 1px solid #eef2f8;
<!-- specific error reason (realistic) --> <div class="error-detail"> <span>⚠️ Error code: P22-04</span> <span>Your bank declined the transaction — insufficient funds or 3D secure timeout.</span> </div>
<h1>Payment Failed</h1> <!-- dynamic amount display (example) --> <div style="display: flex; justify-content: center;"> <div class="amount-badge">Attempted: $89.00 USD</div> </div> .support-link text-align: center
<!-- helpful suggestions --> <div class="suggestion-box"> <div class="suggestion-title"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#f97316" stroke-width="2"> <path d="M12 8v4l3 3M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"/> </svg> <span>TRY THESE INSTEAD</span> </div> <ul class="suggestion-list"> <li> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"> <path d="M20 12V8H4v8h8" stroke="currentColor" stroke-width="1.8"/> <path d="M16 18l2 2 4-4" stroke="currentColor" stroke-width="1.8"/> </svg> <span>Use a different card or payment method</span> </li> <li> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"> <rect x="2" y="4" width="20" height="16" rx="2" stroke="currentColor" stroke-width="1.7"/> <line x1="8" y1="10" x2="16" y2="10" stroke="currentColor" stroke-width="1.7"/> </svg> <span>Verify funds or contact your issuing bank</span> </li> <li> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"> <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" stroke="currentColor" stroke-width="1.7"/> <circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="1.7"/> </svg> <span>Check internet connection & retry after 2 minutes</span> </li> </ul> </div>
/* action buttons */ .action-buttons display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.8rem; justify-content: center;
/* main card container */ .fail-card max-width: 520px; width: 100%; background: #ffffff; border-radius: 2rem; box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.05); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease;
<!-- simple interactive demo simulation (toast / feedback) --> <script> (function() Clean UI with suggestions & retry flow"); )(); </script> </body> </html>