/**
 * ImmITalents Onboarding Tour
 * Every rule is prefixed with #imt-onb-root so theme selectors
 * (buttons, links, headings) cannot bleed into the widget.
 */

#imt-onb-root {
	--imt-orange: #f26f21;
	--imt-orange-soft: #fff2e9;
	--imt-blue: #1b3fd4;
	--imt-navy: #1c2f6e;
	--imt-link: #6d3ef5;
	--imt-ink: #1f2a37;
	--imt-muted: #7a869a;
	--imt-line: #e6e9ef;
	--imt-pill: #d9e1f4;
	--imt-surface: #ffffff;
	--imt-row: #eef2fb;
	--imt-row-line: #e2e8f7;
	--imt-radius: 16px;
	--imt-radius-sm: 12px;
	--imt-shadow: 0 24px 60px rgba(20, 30, 60, 0.28);
	--imt-ease: cubic-bezier(0.16, 1, 0.3, 1);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

/* Neutralise theme button/link styling inside the widget. */
#imt-onb-root button {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	box-shadow: none;
	outline: none;
	margin: 0;
	line-height: 1.3;
}
#imt-onb-root button:focus-visible {
	outline: 3px solid var(--imt-blue);
	outline-offset: 2px;
}

/* ---------- Launcher (always-on, bottom-right) ---------- */
#imt-onb-root .imt-onb-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--imt-surface);
	box-shadow: 0 10px 30px rgba(20, 30, 60, 0.22);
	cursor: pointer;
	transition: transform var(--imt-ease) 260ms, box-shadow var(--imt-ease) 260ms;
}
#imt-onb-root .imt-onb-launcher:hover {
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 16px 40px rgba(20, 30, 60, 0.3);
	background: var(--imt-surface);
}
#imt-onb-root .imt-onb-launcher img {
	width: 38px;
	height: 38px;
	object-fit: contain;
}
#imt-onb-root .imt-onb-launcher .imt-onb-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--imt-orange);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}
#imt-onb-root .imt-onb-launcher[data-complete="1"] .imt-onb-badge { display: none; }

/* ---------- Docked panel (right side, non-blocking) ----------
   The wrapper spans the viewport but lets every click pass through
   (pointer-events: none) so the user can keep filling the form behind.
   Only the card itself captures input. */
#imt-onb-root .imt-onb-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	/* Dock the panel to the bottom-right, just above the floating launcher,
	   so it reads as popping out of the logo button. */
	align-items: flex-end;
	justify-content: flex-end;
	padding: 24px 24px 98px; /* right = launcher right (24); bottom clears the 60px launcher + 14px gap */
	background: transparent;
	pointer-events: none;
	opacity: 0;
	transition: opacity 200ms ease;
}
#imt-onb-root .imt-onb-overlay.is-open { opacity: 1; }

#imt-onb-root .imt-onb-card {
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 122px);
	display: flex;
	flex-direction: column;
	background: var(--imt-surface);
	border: 1px solid var(--imt-line);
	border-radius: var(--imt-radius);
	box-shadow: var(--imt-shadow);
	overflow: hidden;
	pointer-events: auto;
	transform-origin: bottom right;
	transform: translateY(16px) scale(0.98);
	transition: transform 260ms var(--imt-ease);
}
#imt-onb-root .imt-onb-overlay.is-open .imt-onb-card { transform: translateY(0) scale(1); }

/* ---------- Header ---------- */
#imt-onb-root .imt-onb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--imt-line);
}
#imt-onb-root .imt-onb-screen {
	font-size: 13px;
	font-weight: 600;
	color: var(--imt-muted);
}
#imt-onb-root .imt-onb-progress {
	display: flex;
	gap: 6px;
	margin-left: auto;
}
#imt-onb-root .imt-onb-progress span {
	width: 26px;
	height: 6px;
	border-radius: 999px;
	background: var(--imt-pill);
	transition: background 240ms var(--imt-ease);
}
#imt-onb-root .imt-onb-progress span.is-done { background: #f6c9a8; }
#imt-onb-root .imt-onb-progress span.is-active { background: var(--imt-orange); }
#imt-onb-root .imt-onb-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 8px;
	color: var(--imt-ink);
	font-size: 20px;
	cursor: pointer;
	transition: background 160ms ease;
}
#imt-onb-root .imt-onb-close:hover {
	background: var(--imt-row);
	color: var(--imt-ink);
	border: none;
}

/* ---------- Body ---------- */
#imt-onb-root .imt-onb-body {
	padding: 20px 22px 8px;
	overflow-y: auto;
}
#imt-onb-root .imt-onb-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 2px auto 14px;
	border: 2px solid var(--imt-orange);
	border-radius: 15px;
	background: #fff;
	box-sizing: border-box;
}
#imt-onb-root .imt-onb-logo img { width: 38px; height: 38px; object-fit: contain; }

#imt-onb-root .imt-onb-headline {
	margin: 0 0 8px;
	padding: 0;
	text-align: center;
	font-size: 21px;
	line-height: 1.25;
	font-weight: 800;
	color: var(--imt-navy);
	letter-spacing: -0.01em;
}
#imt-onb-root .imt-onb-text {
	margin: 0 auto 20px;
	padding: 0;
	max-width: 420px;
	text-align: center;
	font-size: 15px;
	line-height: 1.55;
	color: var(--imt-muted);
}

/* ---------- Checklist ---------- */
#imt-onb-root .imt-onb-items { display: flex; flex-direction: column; gap: 12px; }
#imt-onb-root .imt-onb-item {
	display: flex;
	gap: 14px;
	margin: 0;
	padding: 13px 16px;
	border: 1px solid var(--imt-row-line);
	border-radius: var(--imt-radius-sm);
	background: var(--imt-row);
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
	transition: border-color 180ms var(--imt-ease), background 180ms var(--imt-ease), box-shadow 180ms var(--imt-ease);
}
#imt-onb-root .imt-onb-item:hover { border-color: #c3cfeb; }
#imt-onb-root .imt-onb-item.is-checked {
	border-color: var(--imt-orange);
	background: var(--imt-orange-soft);
	box-shadow: inset 3px 0 0 var(--imt-orange);
}
#imt-onb-root .imt-onb-item:focus-within { box-shadow: 0 0 0 3px rgba(27, 63, 212, 0.18); }

#imt-onb-root .imt-onb-check {
	flex: 0 0 auto;
	position: relative;
	width: 22px;
	height: 22px;
	margin-top: 1px;
}
#imt-onb-root .imt-onb-check input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}
#imt-onb-root .imt-onb-dot {
	display: block;
	width: 22px;
	height: 22px;
	border: 2px solid #9aa5bd;
	border-radius: 50%;
	box-sizing: border-box;
	transition: border-color 160ms ease, background 160ms ease;
}
#imt-onb-root .imt-onb-item.is-checked .imt-onb-dot {
	border-color: var(--imt-orange);
	background: var(--imt-orange);
	box-shadow: inset 0 0 0 4px #fff;
}
#imt-onb-root .imt-onb-item-body { flex: 1 1 auto; }
#imt-onb-root .imt-onb-item-title {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--imt-navy);
	line-height: 1.35;
}
#imt-onb-root .imt-onb-item-desc {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--imt-muted);
}
#imt-onb-root .imt-onb-item-note {
	display: block;
	margin-top: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	background: rgba(27, 63, 212, 0.07);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--imt-blue);
}

/* ---------- Direct page links ---------- */
#imt-onb-root .imt-onb-links {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}
#imt-onb-root .imt-onb-link {
	display: block;
	padding: 10px 14px;
	border: 1.5px solid var(--imt-blue);
	border-radius: 10px;
	background: #fff;
	color: var(--imt-blue);
	font-size: 13.5px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background 160ms ease, color 160ms ease;
}
#imt-onb-root .imt-onb-link:hover {
	background: var(--imt-blue);
	color: #fff;
	text-decoration: none;
}

/* ---------- Footer ---------- */
#imt-onb-root .imt-onb-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px 18px;
	padding: 14px 24px 18px;
	background: #fbfcff;
	border-top: 1px solid #f0f3fb;
}
#imt-onb-root .imt-onb-gate {
	flex: 1 1 100%;
	order: -1;
	font-size: 12.5px;
	color: var(--imt-muted);
	text-align: center;
}
#imt-onb-root .imt-onb-gate:empty { display: none; }
#imt-onb-root .imt-onb-prev {
	margin-right: auto;
	border: none;
	background: transparent;
	color: var(--imt-muted);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 4px;
	border-radius: 0;
}
#imt-onb-root .imt-onb-prev:hover {
	color: var(--imt-ink);
	background: transparent;
	text-decoration: underline;
	border: none;
}
#imt-onb-root .imt-onb-skip {
	border: none;
	background: transparent;
	color: var(--imt-link);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 4px;
	border-radius: 0;
}
#imt-onb-root .imt-onb-skip:hover {
	text-decoration: underline;
	background: transparent;
	color: var(--imt-link);
	border: none;
}
#imt-onb-root .imt-onb-next {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border: none;
	border-radius: 10px;
	background: var(--imt-orange);
	color: #fff;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 160ms var(--imt-ease), background 160ms ease, opacity 160ms ease;
}
#imt-onb-root .imt-onb-next:hover:not(:disabled) {
	transform: translateY(-1px);
	background: #e5641a;
	color: #fff;
	border: none;
}
#imt-onb-root .imt-onb-next:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	background: var(--imt-orange);
	color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	/* Bottom sheet on mobile, still non-blocking. */
	#imt-onb-root .imt-onb-overlay { align-items: flex-end; justify-content: center; padding: 12px 12px 86px; }
	#imt-onb-root .imt-onb-card { max-width: 100%; max-height: 70vh; transform: translateY(16px); }
	#imt-onb-root .imt-onb-overlay.is-open .imt-onb-card { transform: translateY(0); }
	#imt-onb-root .imt-onb-body { padding: 18px 16px 6px; }
	#imt-onb-root .imt-onb-headline { font-size: 19px; }
	#imt-onb-root .imt-onb-progress span { width: 18px; }
	#imt-onb-root .imt-onb-foot { gap: 12px; }
	#imt-onb-root .imt-onb-launcher { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#imt-onb-root *,
	#imt-onb-root *::before {
		transition: none !important;
	}
}
