/**
 * Insurance Quote Manager Pro - tracking portal styles (Step 9).
 * Reuses the wizard's blue/white aesthetic. Scoped under .iqmp-tracking.
 */

.iqmp-tracking {
	--iqmp-primary: #0A66C2;
	--iqmp-ink: #101828;
	--iqmp-muted: #667085;
	--iqmp-line: #e4e7ec;
	--iqmp-bg: #f7f9fc;
	--iqmp-danger: #d92d20;

	max-width: 720px;
	margin: 28px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--iqmp-ink);
	box-sizing: border-box;
}

.iqmp-tracking *, .iqmp-tracking *::before, .iqmp-tracking *::after { box-sizing: border-box; }

.iqmp-tracking__head { text-align: center; margin-bottom: 24px; }

.iqmp-tracking__title { margin: 0 0 8px; font-size: 26px; font-weight: 700; }
.iqmp-tracking__desc { margin: 0; font-size: 15px; color: var(--iqmp-muted); line-height: 1.6; }

/* Search form */
.iqmp-tracking__form {
	background: #fff;
	border: 1px solid var(--iqmp-line);
	border-radius: 16px;
	padding: 26px;
	box-shadow: 0 8px 30px rgba(16, 24, 40, 0.06);
}

.iqmp-tracking .iqmp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.iqmp-tracking .iqmp-field label { font-size: 13px; font-weight: 600; }
.iqmp-tracking .iqmp-req { color: var(--iqmp-danger); }

.iqmp-tracking input[type="text"],
.iqmp-tracking input[type="email"] {
	width: 100%;
	padding: 12px 14px;
	font-size: 14px;
	font-family: inherit;
	color: var(--iqmp-ink);
	border: 1.5px solid var(--iqmp-line);
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.iqmp-tracking input:focus {
	outline: none;
	border-color: var(--iqmp-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--iqmp-primary) 10%, #fff);
}

.iqmp-tracking input.iqmp-invalid { border-color: var(--iqmp-danger); }

.iqmp-tracking .iqmp-error {
	display: block;
	min-height: 16px;
	font-size: 12px;
	font-weight: 600;
	color: var(--iqmp-danger);
}

/* Buttons */
.iqmp-tracking .iqmp-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 26px;
	border-radius: 10px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.iqmp-tracking .iqmp-btn:active { transform: translateY(1px); }
.iqmp-tracking .iqmp-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.iqmp-tracking .iqmp-btn--primary {
	width: 100%;
	background: var(--iqmp-primary);
	color: #fff;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--iqmp-primary) 30%, transparent);
}
.iqmp-tracking .iqmp-btn--ghost { background: #fff; color: var(--iqmp-ink); border: 1.5px solid var(--iqmp-line); }
.iqmp-tracking .iqmp-btn--whatsapp { background: #25d366; color: #fff; box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3); }
.iqmp-tracking .iqmp-btn--whatsapp:hover { background: #1ebe5b; }
.iqmp-tracking .iqmp-btn[hidden] { display: none; }

.iqmp-tracking__error {
	margin-top: 14px;
	padding: 12px 16px;
	border-radius: 10px;
	background: #fdecec;
	border: 1px solid #f3b4b4;
	color: #b42318;
	font-size: 14px;
	font-weight: 600;
}
.iqmp-tracking__error[hidden] { display: none; }

/* Result */
.iqmp-tracking__result[hidden] { display: none; }
.iqmp-tracking__result { margin-top: 8px; }

.iqmp-track-card {
	background: #fff;
	border: 1px solid var(--iqmp-line);
	border-radius: 16px;
	padding: 22px 24px;
	margin-bottom: 16px;
	box-shadow: 0 4px 18px rgba(16, 24, 40, 0.05);
}
.iqmp-track-card[hidden] { display: none; }

.iqmp-track-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.iqmp-track-card__title { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--iqmp-primary); }
.iqmp-track-card__head .iqmp-track-card__title { margin: 0; }

.iqmp-status-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	background: #6b7280;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

.iqmp-track-grid { display: grid; gap: 2px; }

.iqmp-track-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--iqmp-line);
	font-size: 14px;
}
.iqmp-track-row:last-child { border-bottom: 0; }
.iqmp-track-row[hidden] { display: none; }
.iqmp-track-key { color: var(--iqmp-muted); font-weight: 500; }
.iqmp-track-val { color: var(--iqmp-ink); font-weight: 600; text-align: right; word-break: break-word; }

.iqmp-track-comment {
	margin: 0;
	padding: 14px 16px;
	background: var(--iqmp-bg);
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--iqmp-ink);
}

/* Timeline */
.iqmp-timeline { list-style: none; margin: 0; padding: 0; }

.iqmp-timeline__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 0 22px 0;
}
.iqmp-timeline__item:last-child { padding-bottom: 0; }

/* Connector line */
.iqmp-timeline__item::before {
	content: "";
	position: absolute;
	left: 13px;
	top: 28px;
	bottom: -6px;
	width: 2px;
	background: var(--iqmp-line);
}
.iqmp-timeline__item:last-child::before { display: none; }

.iqmp-timeline__marker {
	position: relative;
	z-index: 1;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid var(--iqmp-line);
	background: #fff;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.iqmp-timeline__label { font-size: 14px; font-weight: 600; color: var(--iqmp-muted); }

.iqmp-timeline__item.is-done .iqmp-timeline__marker,
.iqmp-timeline__item.is-current .iqmp-timeline__marker {
	background: var(--iqmp-primary);
	border-color: var(--iqmp-primary);
}
.iqmp-timeline__item.is-done .iqmp-timeline__label,
.iqmp-timeline__item.is-current .iqmp-timeline__label { color: var(--iqmp-ink); }

.iqmp-timeline__item.is-current .iqmp-timeline__marker {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--iqmp-primary) 18%, #fff);
}

.iqmp-timeline__item.is-terminal .iqmp-timeline__marker {
	background: var(--iqmp-danger);
	border-color: var(--iqmp-danger);
}
.iqmp-timeline__item.is-terminal .iqmp-timeline__label { color: var(--iqmp-danger); }

/* Actions */
.iqmp-track-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 4px;
}
.iqmp-track-actions .iqmp-btn { flex: 1; min-width: 160px; }

/* Responsive */
@media (max-width: 600px) {
	.iqmp-tracking { margin: 14px 10px; }
	.iqmp-tracking__title { font-size: 22px; }
	.iqmp-tracking__form { padding: 20px; }
	.iqmp-track-card { padding: 18px; }
	.iqmp-track-actions .iqmp-btn { flex: 1 1 100%; }
	.iqmp-track-row { flex-direction: column; gap: 2px; }
	.iqmp-track-val { text-align: left; }
}
