.test-bmi,
.test-bmi__controls,
.test-bmi-field,
.test-bmi__result,
.test-bmi__goal-card {
	display: flex;
	flex-direction: column;
}

.test-bmi {
	gap: 24px;
}

.test-bmi__controls {
	align-items: center;
	gap: 24px;
	padding: 24px 12px 12px;
	border-radius: 16px;
	background: rgb(255 255 255 / 60%);
	box-shadow: var(--shadow-block);
	-webkit-backdrop-filter: blur(98px);
	backdrop-filter: blur(98px);
}

.test-bmi-field {
	gap: 12px;
	width: 100%;
}

.test-bmi-field__heading,
.test-bmi__result-heading,
.test-bmi-scale__labels,
.test-bmi__goal {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.test-bmi-field__heading {
	font-size: 16px;
	line-height: 1.2;
}

.test-bmi-field__label {
	font-weight: 600;
}

.test-bmi-field__value {
	color: var(--color-secondary);
	font-weight: 800;
}

.test-bmi-field input[type="range"] {
	--range-progress: 50%;

	width: 100%;
	height: 14px;
	margin: 0;
	appearance: none;
	background: transparent;
	cursor: pointer;
}

.test-bmi-field input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 10px;
	background: linear-gradient(
		to right,
		var(--color-secondary) 0,
		var(--color-gradient-end) var(--range-progress),
		#f4f3ff var(--range-progress),
		#f4f3ff 100%
	);
}

.test-bmi-field input[type="range"]::-moz-range-track {
	height: 6px;
	border-radius: 10px;
	background: #f4f3ff;
}

.test-bmi-field input[type="range"]::-moz-range-progress {
	height: 6px;
	border-radius: 10px;
	background: var(--primary-gradient);
}

.test-bmi-field input[type="range"]::-webkit-slider-thumb {
	width: 14px;
	height: 14px;
	margin-top: -4px;
	appearance: none;
	border: 0;
	border-radius: 50%;
	background: var(--color-gradient-end);
}

.test-bmi-field input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: var(--color-gradient-end);
}

.test-bmi-field input[type="range"]:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 4px;
}

.test-bmi__target-summary {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.test-bmi__target-summary strong {
	color: #4ebc23;
	font-weight: 700;
}

.test-bmi__target-summary strong[data-category="underweight"] {
	color: #688eff;
}

.test-bmi__target-summary strong[data-category="overweight"] {
	color: #c89300;
}

.test-bmi__target-summary strong[data-category^="obesity"] {
	color: #ed3330;
}

.test-bmi__result {
	gap: 12px;
}

.test-bmi__result-heading {
	gap: 12px;
}

.test-bmi__result-heading p {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.test-bmi__result-heading strong {
	margin-left: clamp(8px, 8vw, 80px);
	color: var(--color-secondary);
	font-size: 20px;
	font-weight: 800;
}

.test-bmi__category {
	padding: 4px 17px;
	border-radius: 30px;
	background: rgb(255 209 41 / 20%);
	box-shadow: 0 2px 4px rgb(0 0 0 / 7%);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

.test-bmi__category[data-category="underweight"] {
	background: rgb(104 142 255 / 18%);
}

.test-bmi__category[data-category="normal"] {
	background: rgb(78 188 35 / 18%);
}

.test-bmi__category[data-category^="obesity"] {
	background: rgb(237 51 48 / 16%);
}

.test-bmi-scale__bar {
	position: relative;
	height: 15px;
	border-radius: 50px;
	background: linear-gradient(
		90deg,
		#688eff 0%,
		#a7bb64 16.67%,
		#edc700 28.57%,
		#f38500 40.48%,
		#ed3330 52.38%,
		#ed3330 100%
	);
	box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
}

.test-bmi-scale__bar i {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--bmi-position, 50%);
	width: 4px;
	border-radius: 20px;
	background: var(--color-white);
	transform: translateX(-50%);
}

.test-bmi-scale__labels {
	position: relative;
	height: 10px;
	margin-top: 4px;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
}

.test-bmi-scale__labels span {
	position: absolute;
	left: var(--bmi-label-position);
	transform: translateX(-50%);
}

.test-bmi-scale__labels span:first-child {
	transform: none;
}

.test-bmi-scale__labels span:last-child {
	transform: translateX(-100%);
}

.test-bmi__goal {
	align-items: stretch;
	gap: 12px;
}

.test-bmi__goal-card {
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 50%;
	min-height: 86px;
	padding: 20px 12px;
	border-radius: 16px;
	background: rgb(255 255 255 / 60%);
	box-shadow: var(--shadow-block);
	text-align: center;
}

.test-bmi__goal-card span {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
}

.test-bmi__goal-card strong {
	color: var(--color-secondary);
	font-size: 20px;
	line-height: 1.2;
}

@media (max-width: 768px) {
	.test-bmi__result-heading strong {
		margin-left: clamp(4px, 5vw, 20px);
	}

	.test-bmi__goal-card {
		padding-inline: 8px;
	}
}

@media (max-width: 370px) {
	.test-bmi__result-heading {
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.test-bmi__result-heading strong {
		margin-left: 4px;
	}
}
