/**
 * TikTok Health Scan.
 *
 * Loads after pfp.css and inherits its tokens, form and button styling.
 * Self-contained on width so it works inside the front page's own sections as
 * well as on a centred tool page.
 */

.tkf-scan {
	position: relative;
	width: min(52rem, 100%);
	margin-inline: auto;
}

.tkf-scan-heading {
	margin: 0 0 .5rem;
	text-align: center;
	font-size: clamp(1.6rem, 3.4vw, 2.2rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--tkf-ink, #1E1233);
}

.tkf-scan-lede {
	margin: 0 auto 1.4rem;
	max-width: 40rem;
	text-align: center;
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.55;
	color: var(--tkf-ink-2, #4C3D66);
}

/* ---------------- progress ---------------- */

.tkf-scan-progress {
	margin-top: 1.4rem;
	padding: clamp(1.1rem, 3vw, 1.6rem);
	background: var(--tkf-surface, #FFFFFF);
	border: 1px solid var(--tkf-hairline, #E7D8F2);
	border-radius: var(--tkf-radius, 16px);
	box-shadow: var(--sh-md, 0 2px 6px #1E123312, 0 14px 34px -10px #1E123326);
}

.tkf-scan-progress[hidden] {
	display: none;
}

.tkf-scan-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .15rem;
}

.tkf-scan-step {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 2.6rem;
	padding: .25rem .6rem .25rem 2.5rem;
	border-radius: var(--r-sm, 10px);
	font-size: .97rem;
	font-weight: 550;
	color: var(--tkf-muted, #7C6B94);
	opacity: .5;
	transition: opacity .3s ease, color .3s ease, background .3s ease;
}

/* The ring: hairline while pending, violet while working, solid green once
   the step is done, at which point the tick inside it draws. */
.tkf-scan-step::before {
	content: "";
	position: absolute;
	left: .55rem;
	top: 50%;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: -.625rem;
	border-radius: 50%;
	border: 2px solid var(--tkf-hairline-2, #D8C2E8);
	background: transparent;
	transition: border-color .3s ease, background .3s ease, transform .3s cubic-bezier(.2,1.4,.4,1);
}

/* The tick, drawn from two borders so there is no SVG per step. Sized and
   positioned against the ring above, then rotated into a check. */
.tkf-scan-step::after {
	content: "";
	position: absolute;
	left: 1.02rem;
	top: 50%;
	width: .32rem;
	height: .6rem;
	margin-top: -.36rem;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg) scale(.2);
	transform-origin: center;
	opacity: 0;
	transition: transform .3s cubic-bezier(.2,1.6,.4,1), opacity .2s ease;
}

.tkf-scan-step.is-active {
	opacity: 1;
	color: var(--tkf-ink, #1E1233);
	background: var(--violet-soft, #9B23D414);
}

.tkf-scan-step.is-active::before {
	border-color: var(--tkf-violet, #9B23D4);
	animation: tkf-pulse 1.1s ease-in-out infinite;
}

.tkf-scan-step.is-done {
	opacity: 1;
	color: var(--tkf-ink-2, #4C3D66);
	background: transparent;
}

.tkf-scan-step.is-done::before {
	border-color: var(--green, #0A8A72);
	background: var(--green, #0A8A72);
	animation: tkf-pop .34s cubic-bezier(.2,1.5,.4,1);
}

.tkf-scan-step.is-done::after {
	transform: rotate(45deg) scale(1);
	opacity: 1;
}

@keyframes tkf-pulse {
	0%, 100% { box-shadow: 0 0 0 0 #9B23D440; }
	50%      { box-shadow: 0 0 0 .34rem #9B23D400; }
}

@keyframes tkf-pop {
	0%   { transform: scale(.6); }
	60%  { transform: scale(1.14); }
	100% { transform: scale(1); }
}

.tkf-scan-bar {
	position: relative;
	margin-top: 1.15rem;
	height: 6px;
	border-radius: 999px;
	background: var(--wash, #F3E7FA);
	overflow: hidden;
}

.tkf-scan-bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: var(--grad, linear-gradient(120deg, #E056FD 0%, #E530B5 100%));
	transition: width .5s cubic-bezier(.3,.8,.3,1);
}

/* A sheen travelling along the filled part, so the bar reads as working
   rather than as a static measurement. */
.tkf-scan-bar span::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #FFFFFF00 20%, #FFFFFF66 50%, #FFFFFF00 80%);
	transform: translateX(-100%);
	animation: tkf-sheen 1.4s ease-in-out infinite;
}

@keyframes tkf-sheen {
	to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.tkf-scan-step::before,
	.tkf-scan-step::after,
	.tkf-scan-bar span {
		transition-duration: .01ms;
		animation: none;
	}

	.tkf-scan-bar span::after {
		display: none;
	}
}

/* ---------------- result ---------------- */

.tkf-scan-result {
	margin-top: 1.4rem;
	display: grid;
	gap: 1rem;
}

.tkf-scan-result[hidden] {
	display: none;
}

.tkf-scan-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(1rem, 3vw, 1.75rem);
	padding: clamp(1.1rem, 3vw, 1.6rem);
	background: var(--tkf-surface, #FFFFFF);
	border: 1px solid var(--tkf-hairline, #E7D8F2);
	border-radius: var(--tkf-radius, 16px);
	box-shadow: var(--sh-md, 0 2px 6px #1E123312, 0 14px 34px -10px #1E123326);
}

.tkf-scan-identity {
	display: flex;
	align-items: center;
	gap: .9rem;
	min-width: 0;
}

.tkf-scan-avatar {
	flex: 0 0 auto;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 50%;
	object-fit: cover;
	background: var(--wash, #F3E7FA);
	box-shadow: inset 0 0 0 1px #1E123314;
}

.tkf-scan-avatar[hidden] {
	display: none;
}

.tkf-scan .tkf-handle {
	justify-content: flex-start;
	margin: 0;
	font-size: clamp(1.1rem, 2.4vw, 1.35rem);
}

.tkf-scan-nickname {
	margin: .15rem 0 0;
	font-size: .92rem;
	color: var(--tkf-muted, #7C6B94);
}

.tkf-scan-nickname[hidden] {
	display: none;
}

.tkf-scan-stats {
	margin: 0 0 0 auto;
	gap: 1.5rem;
}

/* ---------------- verdict ---------------- */

.tkf-verdict {
	padding: clamp(1.2rem, 3vw, 1.75rem);
	border-radius: var(--tkf-radius, 16px);
	border: 1px solid var(--tkf-hairline, #E7D8F2);
	background: var(--tkf-surface, #FFFFFF);
	text-align: center;
}

/* A pass and a hold must be distinguishable at a glance, and not by colour
   alone: the badge text says which it is. */
.tkf-verdict.is-pass {
	border-color: #0A8A7240;
	background: linear-gradient(160deg, #FFFFFF 0%, #EAF7F3 100%);
}

.tkf-verdict.is-hold {
	border-color: #B0651F40;
	background: linear-gradient(160deg, #FFFFFF 0%, #FDF3E8 100%);
}

.tkf-verdict-badge {
	display: inline-block;
	margin: 0 0 .55rem;
	padding: .28rem .7rem;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 750;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.is-pass .tkf-verdict-badge {
	background: #0A8A7218;
	color: var(--green, #0A8A72);
}

.is-hold .tkf-verdict-badge {
	background: #B0651F1A;
	color: var(--amber, #B0651F);
}

.tkf-verdict-title {
	margin: 0 0 .5rem;
	font-size: clamp(1.25rem, 2.8vw, 1.6rem);
	font-weight: 800;
	line-height: 1.2;
	color: var(--tkf-ink, #1E1233);
}

.tkf-verdict-body {
	margin: 0 auto;
	max-width: 40rem;
	font-size: 1rem;
	line-height: 1.62;
	color: var(--tkf-ink-2, #4C3D66);
}

/* ---------------- offer ---------------- */

.tkf-offer {
	margin-top: 1.35rem;
	padding-top: 1.25rem;
	border-top: 1px dashed var(--tkf-hairline-2, #D8C2E8);
}

.tkf-offer[hidden] {
	display: none;
}

.tkf-offer-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: .45rem;
	margin: 0 0 .9rem;
}

.tkf-offer-qty {
	font-size: clamp(1.5rem, 3.4vw, 2rem);
	font-weight: 800;
	line-height: 1;
	color: var(--tkf-ink, #1E1233);
}

.tkf-offer-unit {
	font-size: 1rem;
	color: var(--tkf-ink-2, #4C3D66);
}

.tkf-offer-price {
	font-size: 1.15rem;
	font-weight: 750;
	color: var(--tkf-violet, #9B23D4);
}

.tkf-offer-price::before {
	content: "\00b7";
	margin-right: .45rem;
	color: var(--tkf-muted, #7C6B94);
	font-weight: 400;
}

.tkf-offer-note {
	margin: .8rem 0 0;
	font-size: .84rem;
	color: var(--tkf-muted, #7C6B94);
}

.tkf-verdict-alt {
	display: inline-block;
	margin-top: .9rem;
	font-size: .9rem;
	font-weight: 600;
	color: var(--tkf-violet, #9B23D4);
}

.tkf-verdict-alt[hidden] {
	display: none;
}

/* ---------------- confetti ---------------- */

.tkf-confetti {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 3;
}

.tkf-confetti[hidden] {
	display: none;
}

/* An academic citation, set apart from body copy so it reads as a source line
   rather than as a sentence. */
.tkf-tool-page .entry .tkf-cite {
	font-size: .9rem;
	color: var(--tkf-muted, #7C6B94);
	border-left: 3px solid var(--tkf-hairline-2, #D8C2E8);
	padding-left: .9rem;
}

/* ---------------- homepage placement ---------------- */

/*
 * The scan and the services grid below it are one thought: check the account,
 * then pick what it needs. Dropping the `band` tint and closing the gap makes
 * them read as a single block rather than two unrelated sections.
 *
 * `.home-section` is clamp(3rem, 7vw, 5.5rem) top and bottom, so this only
 * trims the facing edges and leaves the outer rhythm of the page intact.
 */
#health-scan {
	padding-bottom: clamp(1rem, 2vw, 1.75rem);
}

#health-scan + .home-section {
	padding-top: clamp(1.25rem, 2.5vw, 2rem);
}

/* ---------------- narrow ---------------- */

@media (max-width: 640px) {
	.tkf-scan-card {
		justify-content: center;
		text-align: center;
	}

	.tkf-scan-identity {
		flex-direction: column;
		text-align: center;
	}

	.tkf-scan .tkf-handle {
		justify-content: center;
	}

	.tkf-scan-stats {
		margin: 0 auto;
		gap: 1.25rem;
	}
}
