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

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

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

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

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

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

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

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

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

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

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

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

/* Buttons */
.rkim-tracking .rkim-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;
}
.rkim-tracking .rkim-btn:active { transform: translateY(1px); }
.rkim-tracking .rkim-btn:disabled { opacity: 0.65; cursor: not-allowed; }

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

.rkim-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;
}
.rkim-tracking__error[hidden] { display: none; }

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

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

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

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

.rkim-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;
}

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

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

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

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

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

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

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

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

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

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

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

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

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