Payment Form Pattern¶
The single payment form is the most common MetrePay pattern. It uses a blue hero header and a centered white card with a clean form layout.
Structure¶
┌─────────────────────────────────────┐
│ Page background (#F1F1F1) │
│ │
│ ┌─────────────────────────────┐ │
│ │ Blue hero header │ │
│ │ Merchant name + amount │ │
│ ├─────────────────────────────┤ │
│ │ White form body │ │
│ │ │ │
│ │ [Step indicator] │ │
│ │ [Form fields] │ │
│ │ [Error alert] │ │
│ │ [Submit button] │ │
│ │ │ │
│ │ [MetrePay footer] │ │
│ └─────────────────────────────┘ │
│ │
└─────────────────────────────────────┘
Live Preview¶
Full HTML Implementation¶
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment — Acme Corp</title>
<link href="https://fonts.googleapis.com/css2?family=Cabin:wght@400;600;700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Cabin', sans-serif;
background: #F1F1F1;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.checkout-card {
width: 100%;
max-width: 480px;
border-radius: 20px;
overflow: hidden;
box-shadow: 0px 10px 16px rgba(0, 14, 45, 0.1);
}
/* Hero */
.checkout-hero {
background: #6E96FF;
padding: 24px 32px;
color: white;
}
.checkout-hero__merchant { font-size: 13px; opacity: 0.8; margin-bottom: 4px; }
.checkout-hero__title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.checkout-hero__amount { font-size: 28px; font-weight: 700; }
/* Form body */
.checkout-body { background: white; padding: 28px 32px; }
/* Step indicator */
.step-label {
font-size: 12px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #6E96FF;
display: block;
margin-bottom: 4px;
}
.step-title {
font-size: 20px;
font-weight: 700;
color: #333;
margin-bottom: 20px;
}
/* Fields */
.field { margin-bottom: 16px; }
.label {
display: block;
font-size: 14px;
font-weight: 600;
color: #333;
margin-bottom: 6px;
}
.input {
width: 100%;
height: 42px;
padding: 0 14px;
border: 1.5px solid #92A3C8;
border-radius: 8px;
font-family: 'Cabin', sans-serif;
font-size: 15px;
color: #555;
}
.input:focus {
outline: none;
border-color: #6E96FF;
box-shadow: 0 0 0 3px rgba(110, 150, 255, 0.15);
}
/* Error alert */
.alert-error {
padding: 12px 16px;
border-radius: 4px;
border: 1px solid rgba(220, 53, 69, 1);
background: rgba(248, 215, 218, 1);
color: rgba(114, 28, 36, 1);
font-size: 14px;
margin-bottom: 16px;
display: none;
}
/* Submit */
.btn-submit {
width: 100%;
height: 42px;
background: #6E96FF;
color: white;
border: none;
border-radius: 8px;
font-family: 'Cabin', sans-serif;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
margin-top: 4px;
}
.btn-submit:hover { background: #6687DC; }
/* Footer */
.checkout-footer {
text-align: center;
font-size: 12px;
color: #999;
margin-top: 16px;
}
</style>
</head>
<body>
<div class="checkout-card">
<!-- Hero -->
<div class="checkout-hero">
<p class="checkout-hero__merchant">Acme Corp</p>
<p class="checkout-hero__title">Monthly Invoice</p>
<p class="checkout-hero__amount">$150.00</p>
</div>
<!-- Form -->
<div class="checkout-body">
<span class="step-label">STEP 1 OF 2</span>
<h2 class="step-title">Your information</h2>
<!-- Error alert (shown on validation failure) -->
<div class="alert-error" id="error-alert">
⚠️ Please check your information and try again.
</div>
<div class="field">
<label class="label" for="name">Full name</label>
<input class="input" id="name" type="text" placeholder="John Smith" required>
</div>
<div class="field">
<label class="label" for="email">Email</label>
<input class="input" id="email" type="email" placeholder="john@example.com" required>
</div>
<div class="field" style="margin-bottom:20px;">
<label class="label" for="doc">Document number</label>
<input class="input" id="doc" type="text" placeholder="12345678" required>
</div>
<button class="btn-submit" type="button">Continue →</button>
<p class="checkout-footer">Powered by MetrePay · Secure payment</p>
</div>
</div>
</body>
</html>
Key Decisions¶
| Decision | Value | Reason |
|---|---|---|
| Hero color | #6E96FF (blue) |
Single payment context |
| Card radius | 20px |
Main form card uses --mp-radius-2xl |
| Card shadow | --mp-shadow-form |
Most prominent element on page |
| Max width | 480px |
Narrow enough to feel focused |
| Step label | Uppercase, blue, 12px | Stripe-inspired step indicator |
| Submit button | Full width, blue | Primary action, maximum visibility |