Insurance — Policy Detail
A single insurance policy detail page showing policy header, insured items, a coverage breakdown table with limits and deductibles, premium and payment schedule, downloadable documents, plus renew and cancel actions with a confirmation dialog.
MCP
Code
:root {
--blue: #2563eb;
--blue-d: #1d4ed8;
--blue-50: #eef4ff;
--green: #15a06b;
--ink: #0f1a2b;
--muted: #5a6b82;
--bg: #f3f7fc;
--white: #ffffff;
--line: #e3ebf6;
--danger: #d4433b;
--radius: 16px;
--shadow: 0 1px 2px rgba(15, 26, 43, .04), 0 8px 24px rgba(15, 26, 43, .06);
--font: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: var(--font);
color: var(--ink);
background: var(--bg);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
.page {
max-width: 980px;
margin: 0 auto;
padding: 32px 20px 64px;
}
.back {
display: inline-block;
margin-bottom: 18px;
color: var(--blue-d);
font-weight: 600;
font-size: .9rem;
text-decoration: none;
}
.back:hover { text-decoration: underline; }
.card {
background: var(--white);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 22px;
}
.card + .card { margin-top: 18px; }
h2 {
font-size: 1.05rem;
font-weight: 700;
margin-bottom: 14px;
}
/* Policy header */
.policy-head {
display: flex;
justify-content: space-between;
gap: 24px;
flex-wrap: wrap;
margin-bottom: 18px;
background: linear-gradient(135deg, var(--white), var(--blue-50));
}
.policy-head__main { display: flex; gap: 16px; align-items: flex-start; }
.shield {
flex: none;
width: 52px; height: 52px;
display: grid; place-items: center;
border-radius: 14px;
background: var(--blue);
color: #fff;
}
.eyebrow {
text-transform: uppercase;
letter-spacing: .06em;
font-size: .72rem;
font-weight: 700;
color: var(--blue-d);
margin-bottom: 4px;
}
.policy-head h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.policy-head__sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.policy-head__status { text-align: right; }
.term {
display: flex;
gap: 22px;
margin-top: 14px;
justify-content: flex-end;
}
.term dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.term dd { font-weight: 700; font-size: .95rem; }
.badge {
display: inline-block;
font-size: .75rem;
font-weight: 700;
padding: 5px 12px;
border-radius: 999px;
}
.badge--active { background: rgba(21, 160, 107, .12); color: var(--green); }
.badge--cancel { background: rgba(212, 67, 59, .12); color: var(--danger); }
/* Grid */
.grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.grid__side { display: grid; gap: 18px; }
/* Insured list */
.insured { list-style: none; display: grid; gap: 10px; }
.insured li {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 14px;
border: 1px solid var(--line);
border-radius: 12px;
}
.insured__ic { font-size: 1.4rem; }
.insured__name { font-weight: 600; }
.insured__meta { font-size: .82rem; color: var(--muted); }
.chip {
margin-left: auto;
font-size: .72rem;
font-weight: 600;
color: var(--blue-d);
background: var(--blue-50);
padding: 4px 10px;
border-radius: 999px;
white-space: nowrap;
}
/* Coverage table */
.table-wrap { overflow-x: auto; }
.cov { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cov th, .cov td { text-align: left; padding: 12px 10px; }
.cov thead th {
font-size: .72rem;
text-transform: uppercase;
letter-spacing: .04em;
color: var(--muted);
border-bottom: 2px solid var(--line);
}
.cov tbody tr { border-bottom: 1px solid var(--line); }
.cov tbody tr:last-child { border-bottom: 0; }
.cov tbody th { font-weight: 600; }
.cov td:nth-child(2) { font-weight: 700; font-variant-numeric: tabular-nums; }
.dot {
display: inline-block;
width: 8px; height: 8px;
border-radius: 50%;
margin-right: 7px;
vertical-align: middle;
}
.dot--on { background: var(--green); }
.dot--off { background: #c3cedd; }
/* Documents */
.docs { list-style: none; display: grid; gap: 8px; }
.docs li {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 14px;
border: 1px solid var(--line);
border-radius: 12px;
}
.docs__ic { font-size: 1.3rem; }
.docs__name { font-weight: 600; font-size: .92rem; }
.docs__meta { font-size: .8rem; color: var(--muted); }
.docs__dl {
margin-left: auto;
font-weight: 600;
font-size: .85rem;
color: var(--blue-d);
text-decoration: none;
padding: 6px 12px;
border-radius: 8px;
border: 1px solid var(--line);
transition: background .15s, border-color .15s;
}
.docs__dl:hover { background: var(--blue-50); border-color: var(--blue); }
/* Premium */
.premium__amount {
font-size: 2.6rem;
font-weight: 800;
line-height: 1;
letter-spacing: -.02em;
margin: 4px 0 6px;
font-variant-numeric: tabular-nums;
}
.premium__currency { font-size: 1.4rem; vertical-align: super; color: var(--muted); margin-right: 2px; }
.premium__per { font-size: .95rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.premium__split { color: var(--muted); font-size: .9rem; }
.premium__pay {
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid var(--line);
font-size: .85rem;
color: var(--ink);
display: flex;
align-items: center;
}
/* Schedule */
.sched { list-style: none; display: grid; gap: 4px; }
.sched li {
display: flex;
justify-content: space-between;
align-items: center;
padding: 11px 12px;
border-radius: 10px;
}
.sched__date { font-weight: 600; font-size: .9rem; }
.sched__meta { font-size: .78rem; color: var(--muted); }
.sched__amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.sched--paid { opacity: .7; }
.sched--paid .sched__meta { color: var(--green); }
.sched--due { background: var(--blue-50); border: 1px solid #d6e2fb; }
.sched--due .sched__meta { color: var(--blue-d); font-weight: 600; }
/* Actions */
.actions { display: grid; gap: 10px; }
.btn {
font-family: inherit;
font-size: .95rem;
font-weight: 700;
padding: 12px 16px;
border-radius: 12px;
border: 1px solid transparent;
cursor: pointer;
transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .25); }
.btn--primary:hover { background: var(--blue-d); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #b8362f; }
.actions__note { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 4px; }
/* Modal */
.modal {
border: none;
border-radius: var(--radius);
padding: 26px;
max-width: 420px;
width: calc(100% - 32px);
box-shadow: 0 24px 60px rgba(15, 26, 43, .3);
color: var(--ink);
}
.modal::backdrop { background: rgba(15, 26, 43, .45); backdrop-filter: blur(2px); }
.modal h2 { margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: .92rem; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
/* Toast */
.toast {
position: fixed;
left: 50%;
bottom: 24px;
transform: translate(-50%, 20px);
background: var(--ink);
color: #fff;
padding: 12px 20px;
border-radius: 12px;
font-size: .9rem;
font-weight: 600;
opacity: 0;
pointer-events: none;
transition: opacity .25s, transform .25s;
box-shadow: 0 10px 30px rgba(15, 26, 43, .35);
z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Responsive */
@media (max-width: 520px) {
.page { padding: 20px 14px 48px; }
.grid { grid-template-columns: 1fr; }
.policy-head { flex-direction: column; }
.policy-head__status { text-align: left; }
.term { justify-content: flex-start; gap: 28px; }
.policy-head h1 { font-size: 1.2rem; }
.premium__amount { font-size: 2.2rem; }
.chip { display: none; }
}(function () {
'use strict';
var toast = document.getElementById('toast');
var toastTimer;
function showToast(msg) {
if (!toast) return;
toast.textContent = msg;
toast.classList.add('show');
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toast.classList.remove('show');
}, 2800);
}
// Renew policy: bump the renewal date forward one year and confirm.
var renewBtn = document.getElementById('renewBtn');
var renewDate = document.getElementById('renewDate');
if (renewBtn) {
renewBtn.addEventListener('click', function () {
if (renewDate) renewDate.textContent = 'Jan 15, 2028';
renewBtn.textContent = 'Renewal confirmed ✓';
renewBtn.disabled = true;
renewBtn.style.opacity = '.7';
renewBtn.style.cursor = 'default';
showToast('Policy renewed through Jan 15, 2028.');
});
}
// Cancel flow with an accessible confirmation dialog.
var cancelBtn = document.getElementById('cancelBtn');
var dialog = document.getElementById('cancelDialog');
var dlgKeep = document.getElementById('dlgKeep');
var dlgConfirm = document.getElementById('dlgConfirm');
var statusBadge = document.getElementById('statusBadge');
function openDialog() {
if (!dialog) return;
if (typeof dialog.showModal === 'function') dialog.showModal();
else dialog.setAttribute('open', '');
if (dlgKeep) dlgKeep.focus();
}
function closeDialog() {
if (!dialog) return;
if (typeof dialog.close === 'function') dialog.close();
else dialog.removeAttribute('open');
if (cancelBtn) cancelBtn.focus();
}
if (cancelBtn) cancelBtn.addEventListener('click', openDialog);
if (dlgKeep) dlgKeep.addEventListener('click', closeDialog);
if (dlgConfirm) {
dlgConfirm.addEventListener('click', function () {
if (statusBadge) {
statusBadge.textContent = 'Cancellation pending';
statusBadge.classList.remove('badge--active');
statusBadge.classList.add('badge--cancel');
}
if (cancelBtn) {
cancelBtn.textContent = 'Cancellation requested';
cancelBtn.disabled = true;
cancelBtn.style.opacity = '.7';
cancelBtn.style.cursor = 'default';
}
closeDialog();
showToast('Cancellation requested — an agent will follow up.');
});
}
// Close on backdrop click for <dialog> support.
if (dialog) {
dialog.addEventListener('click', function (e) {
if (e.target === dialog) closeDialog();
});
}
// Download buttons: lightweight feedback only (illustrative UI).
var dls = document.querySelectorAll('.docs__dl');
Array.prototype.forEach.call(dls, function (a) {
a.addEventListener('click', function (e) {
e.preventDefault();
var name = a.closest('li').querySelector('.docs__name').textContent;
showToast('Preparing “' + name + '” for download…');
});
});
})();<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Policy Detail — Northbridge Insurance</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="page">
<a class="back" href="#">← Back to my policies</a>
<!-- Policy header -->
<header class="card policy-head">
<div class="policy-head__main">
<span class="shield" aria-hidden="true">
<svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="m9 12 2 2 4-4"/></svg>
</span>
<div>
<p class="eyebrow">Auto Insurance · Comprehensive</p>
<h1>Policy <span class="mono">NB-AU-4471-209</span></h1>
<p class="policy-head__sub">Northbridge Insurance · 2024 Honda Civic Sport</p>
</div>
</div>
<div class="policy-head__status">
<span class="badge badge--active" id="statusBadge">Active</span>
<dl class="term">
<div><dt>Term start</dt><dd>Jan 15, 2026</dd></div>
<div><dt>Renews on</dt><dd id="renewDate">Jan 15, 2027</dd></div>
</dl>
</div>
</header>
<div class="grid">
<div class="grid__main">
<!-- Insured items / people -->
<section class="card" aria-labelledby="insured-h">
<h2 id="insured-h">Who & what is covered</h2>
<ul class="insured">
<li>
<span class="insured__ic" aria-hidden="true">🚗</span>
<div>
<p class="insured__name">2024 Honda Civic Sport</p>
<p class="insured__meta">VIN ····7741 · Primary vehicle</p>
</div>
<span class="chip">Insured item</span>
</li>
<li>
<span class="insured__ic" aria-hidden="true">👤</span>
<div>
<p class="insured__name">Daniela Restrepo</p>
<p class="insured__meta">Policyholder · Driver since 2011</p>
</div>
<span class="chip">Primary driver</span>
</li>
<li>
<span class="insured__ic" aria-hidden="true">👤</span>
<div>
<p class="insured__name">Marco Restrepo</p>
<p class="insured__meta">Additional driver · Age 27</p>
</div>
<span class="chip">Listed driver</span>
</li>
</ul>
</section>
<!-- Coverage breakdown -->
<section class="card" aria-labelledby="coverage-h">
<h2 id="coverage-h">Coverage breakdown</h2>
<div class="table-wrap">
<table class="cov">
<thead>
<tr>
<th scope="col">Coverage</th>
<th scope="col">Limit</th>
<th scope="col">Deductible</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Bodily injury liability</th>
<td>$250,000 / $500,000</td>
<td>—</td>
<td><span class="dot dot--on"></span>Included</td>
</tr>
<tr>
<th scope="row">Property damage liability</th>
<td>$100,000</td>
<td>—</td>
<td><span class="dot dot--on"></span>Included</td>
</tr>
<tr>
<th scope="row">Collision</th>
<td>Actual cash value</td>
<td>$500</td>
<td><span class="dot dot--on"></span>Included</td>
</tr>
<tr>
<th scope="row">Comprehensive</th>
<td>Actual cash value</td>
<td>$250</td>
<td><span class="dot dot--on"></span>Included</td>
</tr>
<tr>
<th scope="row">Uninsured motorist</th>
<td>$250,000 / $500,000</td>
<td>—</td>
<td><span class="dot dot--on"></span>Included</td>
</tr>
<tr>
<th scope="row">Roadside assistance</th>
<td>Up to 100 mi tow</td>
<td>—</td>
<td><span class="dot dot--off"></span>Not added</td>
</tr>
</tbody>
</table>
</div>
</section>
<!-- Documents -->
<section class="card" aria-labelledby="docs-h">
<h2 id="docs-h">Documents</h2>
<ul class="docs">
<li>
<span class="docs__ic" aria-hidden="true">📄</span>
<div><p class="docs__name">Declarations page</p><p class="docs__meta">PDF · 248 KB · Jan 15, 2026</p></div>
<a class="docs__dl" href="#" aria-label="Download declarations page">Download</a>
</li>
<li>
<span class="docs__ic" aria-hidden="true">📄</span>
<div><p class="docs__name">Proof of insurance card</p><p class="docs__meta">PDF · 96 KB · Jan 15, 2026</p></div>
<a class="docs__dl" href="#" aria-label="Download proof of insurance card">Download</a>
</li>
<li>
<span class="docs__ic" aria-hidden="true">📄</span>
<div><p class="docs__name">Policy terms & conditions</p><p class="docs__meta">PDF · 1.2 MB · Jan 15, 2026</p></div>
<a class="docs__dl" href="#" aria-label="Download policy terms and conditions">Download</a>
</li>
</ul>
</section>
</div>
<!-- Sidebar: premium & schedule -->
<aside class="grid__side">
<section class="card premium" aria-labelledby="premium-h">
<h2 id="premium-h">Premium</h2>
<p class="premium__amount"><span class="premium__currency">$</span>1,488<span class="premium__per">/ year</span></p>
<p class="premium__split">Billed monthly · <strong>$124.00</strong>/mo</p>
<div class="premium__pay">
<span class="dot dot--on"></span>
<span>Autopay on · Visa ····4218</span>
</div>
</section>
<section class="card" aria-labelledby="sched-h">
<h2 id="sched-h">Payment schedule</h2>
<ul class="sched">
<li class="sched--paid">
<div><p class="sched__date">May 15, 2026</p><p class="sched__meta">Paid · Autopay</p></div>
<span class="sched__amt">$124.00</span>
</li>
<li class="sched--due" id="nextPayment">
<div><p class="sched__date">Jun 15, 2026</p><p class="sched__meta">Upcoming · in 3 days</p></div>
<span class="sched__amt">$124.00</span>
</li>
<li>
<div><p class="sched__date">Jul 15, 2026</p><p class="sched__meta">Scheduled</p></div>
<span class="sched__amt">$124.00</span>
</li>
<li>
<div><p class="sched__date">Aug 15, 2026</p><p class="sched__meta">Scheduled</p></div>
<span class="sched__amt">$124.00</span>
</li>
</ul>
</section>
<section class="card actions" aria-label="Policy actions">
<button class="btn btn--primary" id="renewBtn" type="button">Renew policy</button>
<button class="btn btn--ghost" id="cancelBtn" type="button">Cancel policy</button>
<p class="actions__note">Questions? Call your agent at <strong>1-800-555-0182</strong>.</p>
</section>
</aside>
</div>
</main>
<!-- Cancel confirmation dialog -->
<dialog class="modal" id="cancelDialog" aria-labelledby="dlg-title">
<h2 id="dlg-title">Cancel this policy?</h2>
<p>Your coverage will end on the next renewal date. This cannot be undone from the portal — an agent will follow up to confirm.</p>
<div class="modal__actions">
<button class="btn btn--ghost" id="dlgKeep" type="button">Keep policy</button>
<button class="btn btn--danger" id="dlgConfirm" type="button">Yes, cancel</button>
</div>
</dialog>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>A reassuring, trust-forward policy detail page for an insurance customer portal. The header shows the policy number, type, status badge and term dates, followed by the people and items covered, a clear coverage breakdown table with limits and deductibles, the premium and upcoming payment schedule, and a documents list.
Built with calm blues and a trust-green accent, big confident numbers, and rounded cards. The renew and cancel actions are wired with vanilla JS: renewing toggles the policy into a confirmed state and the cancel button opens an accessible confirmation dialog before any change is applied.
Everything is plain HTML, CSS custom properties and dependency-free JavaScript, with focus styles, labelled controls, and a mobile breakpoint so it adapts down to small screens.
Illustrative UI only — not for real insurance use.