/**
 * Hair Porosity Test — front-end styles.
 *
 * Design tokens are lifted from the colour season analysis quiz: Jost, a near
 * white page, near black ink, a raspberry accent, hairline rules, pill buttons
 * and 12px cards. Everything is namespaced under .hpt and driven by custom
 * properties, so a theme can restyle the test by redefining the variables
 * rather than fighting specificity.
 *
 * It is the same design system as the Hair Type Quiz plugin, under its own
 * .hpt namespace so both can sit on one page without clashing.
 *
 * This is a deliberately light-only design, to match the reference. All
 * colours are set explicitly, so it holds up inside a dark theme rather than
 * inheriting a background it was not designed for.
 */

.hpt {
	--hpt-font: "Jost", "Century Gothic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--hpt-page: #f7f8f9;
	--hpt-card: #ffffff;
	--hpt-ink: #101322;
	--hpt-body: #2a2e30;
	--hpt-muted: #646b7d;
	--hpt-line: #e8eaef;
	--hpt-accent: #be1e4e;
	--hpt-accent-tint: #fdf1f5;

	--hpt-radius: 12px;
	--hpt-pill: 100px;

	box-sizing: border-box;
	max-width: 62rem;
	margin: 0 auto;
	padding: 2rem 1.25rem 2.5rem;
	background: var(--hpt-page);
	color: var(--hpt-body);
	font-family: var(--hpt-font);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

.hpt *,
.hpt *::before,
.hpt *::after {
	box-sizing: inherit;
}

.hpt__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Type
 * ------------------------------------------------------------------------ */

.hpt__eyebrow {
	margin: 0 0 0.75rem;
	color: var(--hpt-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.6;
	text-transform: uppercase;
}

.hpt__eyebrow--accent {
	color: var(--hpt-accent);
}

.hpt__display {
	margin: 0 0 0.75rem;
	color: var(--hpt-ink);
	font-family: var(--hpt-font);
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.04;
}

.hpt__question {
	margin: 0 0 0.75rem;
	color: var(--hpt-ink);
	font-family: var(--hpt-font);
	font-size: clamp(1.5rem, 3.2vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.12;
}

.hpt__lede {
	max-width: 34rem;
	margin: 0 0 1rem;
	color: var(--hpt-body);
	font-size: 1.125rem;
	font-weight: 300;
}

.hpt__help {
	margin: 0;
	color: var(--hpt-muted);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.65;
}

.hpt__meta {
	margin: 0 0 2rem;
	color: var(--hpt-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * Progress — a 2px hairline, no radius
 * ------------------------------------------------------------------------ */

.hpt__progress {
	display: none;
	margin-bottom: 2.75rem;
}

.hpt--js .hpt__progress {
	display: block;
}

.hpt--js.hpt--start .hpt__progress {
	visibility: hidden;
}

.hpt__progress-track {
	height: 2px;
	background: var(--hpt-line);
}

.hpt__progress-fill {
	width: 0;
	height: 2px;
	background: var(--hpt-accent);
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------------
 * Screens
 * ------------------------------------------------------------------------ */

.hpt--js .hpt__screen {
	display: none;
}

.hpt--js .hpt__screen.is-active {
	display: block;
	animation: hpt-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hpt-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hpt--js .hpt__screen.is-active {
		animation: none;
	}

	.hpt__progress-fill,
	.hpt__scale-marker,
	.hpt__option,
	.hpt__btn {
		transition: none;
	}
}

.hpt__screen--start {
	padding: 1rem 0 2rem;
}

.hpt__screen--result:focus {
	outline: none;
}

/* The 320px / 1fr split: question on the left, answers on the right. */
.hpt__split {
	display: grid;
	gap: 2rem;
}

@media (min-width: 56rem) {
	.hpt__split {
		grid-template-columns: 20rem minmax(0, 1fr);
		gap: 2.4rem;
		align-items: start;
	}

	.hpt__aside {
		position: sticky;
		top: 2rem;
	}
}

/* ---------------------------------------------------------------------------
 * Options
 * ------------------------------------------------------------------------ */

.hpt__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.hpt__options {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 34rem) {
	.hpt__options--grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.hpt__option {
	position: relative;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 1rem 1.125rem;
	background: var(--hpt-card);
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-radius);
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hpt__option:hover {
	border-color: #c9cdd8;
	transform: translateY(-1px);
}

.hpt__option:focus-within {
	outline: 2px solid var(--hpt-accent);
	outline-offset: 2px;
}

.hpt__option:has(.hpt__radio:checked) {
	background: var(--hpt-accent-tint);
	border-color: var(--hpt-accent);
	box-shadow: inset 0 0 0 1px var(--hpt-accent);
}

.hpt__option-body {
	flex: 1;
	min-width: 0;
}

.hpt__option-label {
	display: block;
	color: var(--hpt-ink);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
}

.hpt__option-note {
	display: block;
	margin-top: 0.15rem;
	color: var(--hpt-muted);
	font-size: 0.8125rem;
	font-weight: 300;
	line-height: 1.45;
}

/* The tick sits in a ring that fills in once the option is chosen. */
.hpt__tick {
	display: grid;
	flex: none;
	place-items: center;
	width: 1.375rem;
	height: 1.375rem;
	color: transparent;
	background: transparent;
	border: 1px solid var(--hpt-line);
	border-radius: 50%;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hpt__option:has(.hpt__radio:checked) .hpt__tick {
	color: #ffffff;
	background: var(--hpt-accent);
	border-color: var(--hpt-accent);
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */

.hpt__nav {
	display: none;
	gap: 0.5rem;
	align-items: center;
	margin-top: 1.75rem;
}

.hpt--js .hpt__nav {
	display: flex;
}

.hpt__btn {
	padding: 1rem 1.875rem;
	font-family: var(--hpt-font);
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.01em;
	border: 1px solid transparent;
	border-radius: var(--hpt-pill);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.hpt__btn:focus-visible {
	outline: 2px solid var(--hpt-accent);
	outline-offset: 3px;
}

.hpt__btn--primary {
	background: var(--hpt-accent);
	color: #ffffff;
}

.hpt__btn--primary:hover {
	background: #a5183f;
}

.hpt__btn--ghost {
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	background: transparent;
	color: var(--hpt-muted);
}

.hpt__btn--ghost:hover {
	color: var(--hpt-ink);
}

.hpt__btn--ghost[hidden] {
	display: none;
}

.hpt__error {
	margin: 1rem 0 0;
	color: var(--hpt-accent);
	font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
 * Result
 * ------------------------------------------------------------------------ */

.hpt--js .hpt__nojs,
.hpt--js .hpt__display--all {
	display: none;
}

.hpt--js .hpt__result {
	display: none;
}

.hpt--js .hpt__result.is-active {
	display: block;
}

.hpt__results {
	display: grid;
	gap: 1.5rem;
}

.hpt__result {
	padding: 2rem;
	background: var(--hpt-card);
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-radius);
}

@media (min-width: 40rem) {
	.hpt__result {
		padding: 2.75rem;
	}
}

.hpt__result-head {
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--hpt-line);
}

.hpt__result-name {
	margin-bottom: 0.25rem;
}

.hpt__result-label {
	margin: 0 0 1rem;
	color: var(--hpt-accent);
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.hpt__result-summary {
	max-width: 40rem;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 300;
}

.hpt__result-detail {
	max-width: 40rem;
	margin: 0;
	color: var(--hpt-muted);
	font-weight: 300;
}

/* The scale: three hairline bands with the visitor's position marked on it.
 * Only meaningful once scored, so it is hidden without JavaScript. */
.hpt__scale {
	display: none;
	max-width: 30rem;
	margin-top: 1.75rem;
}

.hpt--js .hpt__scale {
	display: block;
}

.hpt__scale-track {
	position: relative;
	display: grid;
	grid-template-columns: 35fr 33fr 32fr;
	gap: 4px;
	height: 6px;
}

.hpt__scale-band {
	background: var(--hpt-line);
	border-radius: var(--hpt-pill);
}

.hpt__scale-band.is-current {
	background: var(--hpt-accent);
}

.hpt__scale-marker {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	background: var(--hpt-card);
	border: 3px solid var(--hpt-accent);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(16, 19, 34, 0.18);
	transform: translate(-50%, -50%);
	transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hpt__scale-labels {
	display: grid;
	grid-template-columns: 35fr 33fr 32fr;
	gap: 4px;
	margin-top: 0.6rem;
	color: var(--hpt-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.hpt__scale-labels span:nth-child(2) {
	text-align: center;
}

.hpt__scale-labels span:nth-child(3) {
	text-align: right;
}

.hpt__lean {
	margin: 0.9rem 0 0;
	color: var(--hpt-ink);
	font-size: 0.9375rem;
	font-weight: 500;
}

.hpt__lean[hidden] {
	display: none;
}

/* What gave it away: the visitor's own answers, quoted back. */
.hpt__signals {
	padding: 1.25rem 1.5rem;
	margin-top: 1.75rem;
	background: var(--hpt-accent-tint);
	border-radius: var(--hpt-radius);
}

.hpt__signals[hidden] {
	display: none;
}

.hpt__signals .hpt__eyebrow {
	margin-bottom: 0.5rem;
	color: var(--hpt-accent);
}

.hpt__signals-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt__signals-list li {
	padding: 0.35rem 0.85rem;
	color: var(--hpt-ink);
	font-size: 0.875rem;
	line-height: 1.4;
	background: var(--hpt-card);
	border: 1px solid #f3cbd8;
	border-radius: var(--hpt-pill);
}

/* Look for / Go easy on */
.hpt__pair {
	display: grid;
	gap: 1rem;
	margin-top: 1.75rem;
}

@media (min-width: 40rem) {
	.hpt__pair {
		grid-template-columns: 1fr 1fr;
	}
}

.hpt__card {
	padding: 1.5rem;
	background: var(--hpt-page);
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-radius);
}

.hpt__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt__list li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.5rem;
	color: var(--hpt-body);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.55;
}

.hpt__list li:last-child {
	margin-bottom: 0;
}

.hpt__list li::before {
	position: absolute;
	top: 0.62em;
	left: 0;
	width: 5px;
	height: 5px;
	background: var(--hpt-accent);
	border-radius: 50%;
	content: "";
}

.hpt__list--avoid li::before {
	top: 0.75em;
	width: 9px;
	height: 1.5px;
	background: var(--hpt-muted);
	border-radius: 0;
}

.hpt__tips {
	padding-top: 1.5rem;
	margin-top: 1.75rem;
	border-top: 1px solid var(--hpt-line);
}

.hpt__tips-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: hpt-tip;
}

.hpt__tips-list li {
	position: relative;
	padding-left: 2.25rem;
	margin-bottom: 0.85rem;
	font-size: 0.9375rem;
	font-weight: 300;
	counter-increment: hpt-tip;
}

.hpt__tips-list li::before {
	position: absolute;
	top: 0.1em;
	left: 0;
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	color: var(--hpt-accent);
	font-size: 0.75rem;
	font-weight: 600;
	border: 1px solid var(--hpt-accent);
	border-radius: 50%;
	content: counter(hpt-tip);
}

.hpt__mixed {
	padding: 1.5rem;
	margin-top: 1.75rem;
	background: var(--hpt-card);
	border: 1px solid var(--hpt-line);
	border-left: 3px solid var(--hpt-accent);
	border-radius: var(--hpt-radius);
}

.hpt__mixed[hidden] {
	display: none;
}

.hpt__mixed .hpt__eyebrow {
	margin-bottom: 0.4rem;
	color: var(--hpt-accent);
}

.hpt__mixed-text {
	margin: 0;
	color: var(--hpt-muted);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.65;
}

.hpt__again {
	margin-top: 1.75rem;
}

.hpt__again[hidden] {
	display: none;
}

/* ---------------------------------------------------------------------------
 * FAQ
 * ------------------------------------------------------------------------ */

.hpt--faq {
	padding-top: 1rem;
}

.hpt__display--faq {
	margin-bottom: 2rem;
	font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hpt__faq {
	display: grid;
	gap: 1rem;
}

.hpt__faq-item {
	padding: 1.75rem;
	background: var(--hpt-card);
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-radius);
}

.hpt__faq-q {
	margin: 0 0 0.6rem;
	color: var(--hpt-ink);
	font-family: var(--hpt-font);
	font-size: 1.1875rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.3;
}

.hpt__faq-a {
	max-width: 44rem;
	margin: 0;
	color: var(--hpt-muted);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.7;
}
