/* =========================================================================
   MOT History Lookup — "Civic" theme
   Inspired by the layout of a government service page, with an original
   palette (deep teal-ink + warm paper + teal action + amber focus) and type.
   All scoped under .mhl-widget so it never bleeds into the host theme.
   ========================================================================= */

.mhl-widget, .mhl-widget *, .mhl-widget *::before, .mhl-widget *::after {
	box-sizing: border-box;
}

.mhl-widget {
	--mhl-ink:        #15201d;   /* near-black warm charcoal: bar + text  */
	--mhl-paper:      #f4f1ea;   /* warm off-white panel background       */
	--mhl-card:       #ffffff;
	--mhl-primary:    #0a6a6a;   /* teal action                          */
	--mhl-primary-d:  #064f4f;   /* button bottom shadow / hover         */
	--mhl-focus:      #ffc400;   /* amber focus ring                     */
	--mhl-link:       #155fae;
	--mhl-line:       #d8d3c7;   /* warm hairline                        */
	--mhl-muted:      #5d655f;
	--mhl-pass:       #1f7a3d;
	--mhl-fail:       #b3261e;
	--mhl-plate:      #f6d000;   /* number-plate yellow (vehicle convention) */
	--mhl-font: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;

	max-width: 680px;
	margin: 1.5em 0;
	font-family: var(--mhl-font);
	color: var(--mhl-ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(21, 32, 29, 0.06), 0 8px 28px rgba(21, 32, 29, 0.08);
	border: 1px solid var(--mhl-line);
}

/* --- Brand bar --- */
.mhl-brandbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 22px;
	background: var(--mhl-ink);
	color: #fff;
	border-bottom: 4px solid var(--mhl-primary);
}
.mhl-brand-logo {
	display: inline-flex;
	width: 34px;
	height: 34px;
	color: #fff;          /* currentColor → white logo on the dark bar */
	flex: 0 0 auto;
}
.mhl-brand-logo svg { width: 100%; height: 100%; }
.mhl-brand-name {
	font-weight: 800;
	font-size: 19px;
	letter-spacing: 0.3px;
}
.mhl-brand-name b { font-weight: 800; }
.mhl-brand-name span { font-weight: 500; opacity: 0.85; }

/* --- Panel --- */
.mhl-panel {
	padding: 26px 22px 28px;
	background: var(--mhl-paper);
}
.mhl-h1 {
	margin: 0 0 10px;
	font-size: 30px;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.4px;
	color: var(--mhl-ink);
}
.mhl-intro {
	margin: 0 0 20px;
	font-size: 17px;
	color: #2b332f;
	max-width: 46ch;
}

/* --- Search form --- */
.mhl-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.mhl-form-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: stretch;
}
.mhl-input {
	flex: 1 1 220px;
	padding: 13px 16px;
	font-family: var(--mhl-font);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #111;
	background: var(--mhl-plate);
	border: 3px solid var(--mhl-ink);
	border-radius: 7px;
}
.mhl-input::placeholder { color: #6b5e00; font-weight: 600; letter-spacing: 1px; }
.mhl-input:focus {
	outline: none;
	box-shadow: 0 0 0 4px var(--mhl-focus);
	border-color: var(--mhl-ink);
}

/* Primary action — solid teal with a pressed-style bottom edge */
.mhl-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 13px 22px;
	font-family: var(--mhl-font);
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	background: var(--mhl-primary);
	border: 0;
	border-radius: 7px;
	box-shadow: 0 3px 0 var(--mhl-primary-d);
	cursor: pointer;
	transition: background 0.12s ease, transform 0.05s ease;
}
.mhl-button:hover { background: #0b7676; }
.mhl-button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--mhl-primary-d); }
.mhl-button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--mhl-focus), 0 3px 0 var(--mhl-primary-d); }
.mhl-button:disabled { opacity: 0.6; cursor: progress; }
.mhl-arrow { font-size: 19px; line-height: 1; transform: translateY(-1px); }

/* --- Ownership disclaimer --- */
.mhl-disclaimer {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 12px 14px;
	font-size: 14.5px;
	line-height: 1.45;
	color: #2b332f;
	background: var(--mhl-card);
	border: 1px solid var(--mhl-line);
	border-radius: 8px;
	cursor: pointer;
}
.mhl-disclaimer input[type="checkbox"] {
	margin-top: 2px;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	accent-color: var(--mhl-primary);
}

/* --- Status line --- */
.mhl-status {
	min-height: 1.2em;
	margin: 14px 2px 0;
	font-size: 15px;
}
.mhl-status--loading { color: var(--mhl-muted); }
.mhl-status--error { color: var(--mhl-fail); font-weight: 700; }

/* --- Colour challenge --- */
.mhl-challenge {
	margin-top: 18px;
	padding: 20px;
	background: var(--mhl-card);
	border: 1px solid var(--mhl-line);
	border-left: 5px solid var(--mhl-primary);
	border-radius: 8px;
}
.mhl-challenge-prompt { margin: 0 0 14px; font-weight: 700; font-size: 16px; }
.mhl-colour-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
	gap: 9px;
	margin-bottom: 16px;
}
.mhl-colour {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 13px;
	font-family: var(--mhl-font);
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	color: var(--mhl-ink);
	background: var(--mhl-paper);
	border: 2px solid var(--mhl-line);
	border-radius: 8px;
	cursor: pointer;
}
.mhl-colour:hover { border-color: var(--mhl-primary); }
.mhl-colour.is-selected {
	border-color: var(--mhl-primary);
	box-shadow: inset 0 0 0 1px var(--mhl-primary);
}
.mhl-swatch {
	width: 20px; height: 20px; flex: 0 0 auto;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.18);
}

/* --- Result card --- */
.mhl-card {
	margin-top: 20px;
	padding: 22px;
	border: 1px solid var(--mhl-line);
	border-radius: 10px;
	background: var(--mhl-card);
}
.mhl-plate {
	display: inline-block;
	padding: 7px 16px;
	background: var(--mhl-plate);
	border: 2px solid #111;
	border-radius: 6px;
	font-weight: 800;
	font-size: 23px;
	letter-spacing: 2px;
}
.mhl-vehicle { margin: 14px 0 8px; font-size: 23px; font-weight: 800; }
.mhl-meta {
	list-style: none; margin: 0 0 8px; padding: 0;
	display: flex; flex-wrap: wrap; gap: 8px 22px; color: #222;
}
.mhl-meta li { margin: 0; }
.mhl-meta span {
	display: block; font-size: 12px; text-transform: uppercase;
	letter-spacing: 0.5px; color: var(--mhl-muted);
}
.mhl-history-title {
	margin: 20px 0 12px; padding-top: 16px;
	border-top: 1px solid var(--mhl-line);
	font-size: 14px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--mhl-muted);
}

/* --- Individual test --- */
.mhl-test {
	padding: 13px 15px; margin-bottom: 12px;
	border-left: 5px solid var(--mhl-line);
	background: var(--mhl-paper);
	border-radius: 0 7px 7px 0;
}
.mhl-test--pass { border-left-color: var(--mhl-pass); }
.mhl-test--fail { border-left-color: var(--mhl-fail); }
.mhl-test-head { display: flex; align-items: baseline; gap: 12px; }
.mhl-result { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.4px; }
.mhl-test--pass .mhl-result { color: var(--mhl-pass); }
.mhl-test--fail .mhl-result { color: var(--mhl-fail); }
.mhl-date { font-weight: 700; }
.mhl-test-meta {
	list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px;
	margin: 6px 0 0; padding: 0; font-size: 14px; color: var(--mhl-muted);
}
.mhl-testno { font-variant-numeric: tabular-nums; }

/* --- Defects / advisories --- */
.mhl-defects { list-style: none; margin: 10px 0 0; padding: 0; }
.mhl-defect {
	margin: 5px 0; padding: 7px 11px; font-size: 14px;
	border-radius: 6px; background: var(--mhl-card); border: 1px solid var(--mhl-line);
}
.mhl-defect-type {
	display: inline-block; margin-right: 8px; padding: 1px 8px;
	font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
	border-radius: 4px; color: #fff; background: var(--mhl-muted);
}
.mhl-defect--dangerous .mhl-defect-type,
.mhl-defect--major .mhl-defect-type { background: var(--mhl-fail); }
.mhl-defect--minor .mhl-defect-type { background: #b45309; }
.mhl-defect--advisory .mhl-defect-type { background: var(--mhl-primary); }

.mhl-empty { color: var(--mhl-muted); }
.mhl-source { margin: 16px 0 0; font-size: 12px; color: var(--mhl-muted); }

/* --- Small screens --- */
@media (max-width: 480px) {
	.mhl-h1 { font-size: 25px; }
	.mhl-button { width: 100%; justify-content: center; }
}

/* --- Expiry hero + countdown --- */
.mhl-expiry {
	margin: 18px 0 4px;
	padding: 16px 18px;
	border-radius: 10px;
	border: 1px solid var(--mhl-line);
	background: var(--mhl-card);
	border-left: 6px solid var(--mhl-pass);
}
.mhl-expiry--expired { border-left-color: var(--mhl-fail); }
.mhl-expiry-label {
	display: block;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: var(--mhl-muted);
}
.mhl-expiry-date {
	display: block;
	margin: 3px 0 8px;
	font-size: 32px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.5px;
	color: var(--mhl-ink);
}
.mhl-expiry--expired .mhl-expiry-date { color: var(--mhl-fail); }
.mhl-countdown {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 14px;
	color: var(--mhl-muted);
}
.mhl-cd {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	padding: 5px 10px;
	background: var(--mhl-paper);
	border: 1px solid var(--mhl-line);
	border-radius: 7px;
	font-variant-numeric: tabular-nums;
}
.mhl-cd b {
	font-size: 19px;
	font-weight: 800;
	color: var(--mhl-ink);
}
.mhl-expiry--expired .mhl-countdown { color: var(--mhl-fail); font-weight: 700; }

/* --- Mileage chart --- */
.mhl-chart-wrap { margin-top: 8px; }
.mhl-chart {
	width: 100%;
	height: auto;
	display: block;
}
.mhl-axis-note {
	margin: 6px 2px 0;
	font-size: 12px;
	color: var(--mhl-muted);
}

/* --- Status success state + reminder form --- */
.mhl-status--success { color: var(--mhl-pass); font-weight: 700; }

.mhl-reminder-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.mhl-reminder-widget { max-width: 460px; }

/* Alert toggle + progressive-disclosure dropdown */
.mhl-alert-toggle {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 12px 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--mhl-ink);
	background: var(--mhl-card);
	border: 1px solid var(--mhl-line);
	border-radius: 8px;
	cursor: pointer;
}
.mhl-alert-check {
	margin-top: 1px;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	accent-color: var(--mhl-primary);
}
.mhl-reminder-more {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.mhl-reminder-form.mhl-collapsible .mhl-reminder-more,
.mhl-collapsible .mhl-reminder-more {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.2s ease;
}
.mhl-reminder-form.mhl-collapsible.is-open .mhl-reminder-more,
.mhl-collapsible.is-open .mhl-reminder-more {
	max-height: 520px;
	opacity: 1;
}

/* Inline reminder section inside the lookup box */
.mhl-remind { margin-top: 4px; }
.mhl-remind-sep { border-top: 1px solid var(--mhl-line); margin: 20px 0 16px; }
.mhl-remind-heading { margin: 0 0 12px; font-size: 18px; font-weight: 800; color: var(--mhl-ink); }
.mhl-remind-form { display: flex; flex-direction: column; gap: 14px; }
.mhl-remind-button { align-self: flex-start; }

/* Duplicate / warning status */
.mhl-status--warning {
	color: #8a5300;
	font-weight: 700;
	background: #fff6e0;
	border: 1px solid #f0c674;
	border-radius: 7px;
	padding: 10px 12px;
}
.mhl-reminder-form .mhl-input {
	font-size: 20px;
	flex: none;
	width: 100%;
}
.mhl-email,
.mhl-remind-email {
	width: 100%;
	padding: 13px 16px;
	font-family: var(--mhl-font);
	font-size: 17px;
	color: var(--mhl-ink);
	background: var(--mhl-card);
	border: 2px solid var(--mhl-primary);
	border-radius: 7px;
	box-shadow: 0 4px 0 var(--mhl-focus);
}
.mhl-email:focus,
.mhl-remind-email:focus {
	outline: none;
	border-color: var(--mhl-primary);
	box-shadow: 0 4px 0 var(--mhl-focus), 0 0 0 4px rgba(255, 196, 0, 0.30);
}
.mhl-reminder-form .mhl-button { align-self: flex-start; }
@media (max-width: 480px) {
	.mhl-reminder-form .mhl-button { width: 100%; justify-content: center; }
}
