/* ==========================================================================
   DP MOT Checker – Front-end styles
   Designed to be self-contained and not interfere with theme styles.
   ========================================================================== */

/* Wrapper */
.dp-mot-wrapper {
	max-width: 680px;
	margin: 0 auto;
	padding: 24px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #333;
	box-sizing: border-box;
}

.dp-mot-wrapper *,
.dp-mot-wrapper *::before,
.dp-mot-wrapper *::after {
	box-sizing: inherit;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.dp-mot-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 32px 28px;
	margin-bottom: 20px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.dp-mot-header {
	text-align: center;
	margin-bottom: 28px;
}

.dp-mot-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: #1a6abf;
	border-radius: 50%;
	color: #fff;
	margin-bottom: 12px;
}

.dp-mot-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 6px;
	color: #1a1a1a;
	letter-spacing: -0.3px;
}

.dp-mot-subtitle {
	font-size: 0.95rem;
	color: #666;
	margin: 0;
}

/* ── Registration input ───────────────────────────────────────────────────── */
.dp-mot-reg-wrap {
	margin-bottom: 12px;
}

.dp-mot-reg-input {
	display: block;
	width: 100%;
	padding: 18px 20px;
	font-size: 1.9rem;
	font-weight: 800;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 4px;
	background: #f5c518;   /* UK number plate yellow */
	border: 3px solid #d4a900;
	border-radius: 8px;
	color: #1a1a1a;
	line-height: 1;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	caret-color: #1a1a1a;
	font-family: "UK Number Plate", "Highway Gothic", "Arial Black", sans-serif;
}

.dp-mot-reg-input::placeholder {
	color: rgba(26, 26, 26, 0.45);
	letter-spacing: 3px;
}

.dp-mot-reg-input:focus {
	border-color: #b08d00;
	box-shadow: 0 0 0 3px rgba(212, 169, 0, 0.35);
}

/* ── Error message ────────────────────────────────────────────────────────── */
.dp-mot-error {
	color: #c0392b;
	font-size: 0.9rem;
	margin: 8px 0;
	font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.dp-mot-btn {
	display: block;
	width: 100%;
	padding: 16px 20px;
	font-size: 1rem;
	font-weight: 600;
	text-align: center;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s, transform 0.1s;
	margin-top: 10px;
	line-height: 1.4;
}

.dp-mot-btn:hover {
	opacity: 0.88;
}

.dp-mot-btn:active {
	transform: translateY(1px);
}

/* Check MOT (grey, inactive state before results) */
.dp-mot-btn-check {
	background: #d4d4d4;
	color: #666;
}

/* Active state when reg is entered */
.dp-mot-btn-check.is-active {
	background: #e8e8e8;
	color: #333;
}

/* Book an MOT — colour set via JS from admin settings */
.dp-mot-btn-book {
	color: #fff;
	/* background-color set by JS */
}

/* View history — outlined version of the book button colour */
.dp-mot-btn-history {
	background: transparent;
	color: #1a1a1a;
	border: 2px solid #1a1a1a;
	/* border-color & color set by JS */
}

/* ── Loading state ────────────────────────────────────────────────────────── */
.dp-mot-btn-check.is-loading {
	pointer-events: none;
	opacity: 0.7;
}

.dp-mot-btn-check.is-loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(0, 0, 0, 0.3);
	border-top-color: #333;
	border-radius: 50%;
	animation: dp-mot-spin 0.7s linear infinite;
	margin-left: 10px;
	vertical-align: middle;
}

@keyframes dp-mot-spin {
	to { transform: rotate(360deg); }
}

/* ── Results card ─────────────────────────────────────────────────────────── */
.dp-mot-results-card {
	animation: dp-mot-fadein 0.3s ease;
}

@keyframes dp-mot-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Vehicle header */
.dp-mot-vehicle-heading {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #999;
	margin: 0 0 10px;
}

/* Mini registration plate badge */
.dp-mot-plate {
	display: inline-block;
	background: #f5c518;
	border: 2px solid #d4a900;
	border-radius: 4px;
	padding: 4px 12px;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 3px;
	color: #1a1a1a;
	margin-bottom: 14px;
	font-family: "UK Number Plate", "Highway Gothic", "Arial Black", sans-serif;
}

/* Vehicle details list */
.dp-mot-vehicle-details {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	font-size: 0.92rem;
}

.dp-mot-vehicle-details li {
	margin-bottom: 4px;
	color: #444;
}

.dp-mot-vehicle-details strong {
	color: #1a1a1a;
}

.dp-mot-edit-link {
	font-size: 0.85rem;
	color: #1a6abf;
	text-decoration: underline;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	margin-bottom: 20px;
	display: inline-block;
}

.dp-mot-edit-link:hover {
	color: #0d4e8f;
}

/* MOT status banner */
.dp-mot-status-banner {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px;
	border-radius: 8px;
	margin-bottom: 20px;
}

.dp-mot-status-banner.status-valid {
	background: #eaf7ed;
	border-left: 4px solid #27ae60;
}

.dp-mot-status-banner.status-expiring {
	background: #fff8e1;
	border-left: 4px solid #f39c12;
}

.dp-mot-status-banner.status-expired {
	background: #fdecea;
	border-left: 4px solid #c0392b;
}

.dp-mot-status-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.status-valid   .dp-mot-status-icon { background: #27ae60; color: #fff; }
.status-expiring .dp-mot-status-icon { background: #f39c12; color: #fff; }
.status-expired  .dp-mot-status-icon { background: #c0392b; color: #fff; }

.dp-mot-status-text {
	flex: 1;
}

.dp-mot-status-text h3 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 4px;
	color: #1a1a1a;
}

.dp-mot-status-text p {
	font-size: 0.88rem;
	margin: 0;
	color: #555;
}

/* ── MOT history modal ────────────────────────────────────────────────────── */

/* Ensure the HTML `hidden` attribute always wins, even against display:flex rules. */
.dp-mot-modal-overlay[hidden],
.dp-mot-results-card[hidden] {
	display: none !important;
}

.dp-mot-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: dp-mot-fadein 0.2s ease;
}

.dp-mot-modal-box {
	background: #fff;
	border-radius: 10px;
	width: 100%;
	max-width: 520px;
	max-height: 80vh;
	overflow-y: auto;
	padding: 28px 24px;
	position: relative;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dp-mot-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: #f0f0f0;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.dp-mot-modal-close:hover {
	background: #e0e0e0;
}

.dp-mot-modal-title {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 20px;
	padding-right: 36px;
	color: #1a1a1a;
}

/* History rows */
.dp-mot-history-row {
	border-bottom: 1px solid #eee;
}

.dp-mot-history-row:last-child {
	border-bottom: none;
}

.dp-mot-history-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	cursor: pointer;
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	font-family: inherit;
}

.dp-mot-history-summary:hover .dp-mot-history-date {
	color: #1a6abf;
}

.dp-mot-history-date {
	font-size: 0.95rem;
	font-weight: 600;
	color: #333;
	flex: 1;
	transition: color 0.15s;
}

.dp-mot-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.dp-mot-badge.pass {
	background: #eaf7ed;
	color: #1e8449;
	border: 1px solid #a9dfba;
}

.dp-mot-badge.fail {
	background: #fdecea;
	color: #c0392b;
	border: 1px solid #f5b7b1;
}

.dp-mot-badge .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.dp-mot-badge.pass .dot { background: #27ae60; }
.dp-mot-badge.fail .dot { background: #c0392b; }

.dp-mot-history-chevron {
	font-size: 0.8rem;
	color: #aaa;
	transition: transform 0.2s;
	flex-shrink: 0;
}

.dp-mot-history-row.is-open .dp-mot-history-chevron {
	transform: rotate(90deg);
}

/* History detail panel */
.dp-mot-history-detail {
	padding: 0 0 16px 4px;
	font-size: 0.88rem;
	color: #555;
}

.dp-mot-history-detail ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

.dp-mot-history-detail li {
	margin-bottom: 4px;
	line-height: 1.4;
}

.dp-mot-detail-section {
	margin-bottom: 10px;
}

.dp-mot-detail-section h4 {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
	margin: 0 0 4px;
}

.dp-mot-mileage {
	font-size: 0.85rem;
	color: #888;
	margin-bottom: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.dp-mot-card {
		padding: 24px 18px;
	}

	.dp-mot-reg-input {
		font-size: 1.5rem;
		padding: 14px 16px;
		letter-spacing: 2px;
	}

	.dp-mot-title {
		font-size: 1.4rem;
	}
}
