/**
 * Training Quiz
 *
 * Every value here was measured off this site's own referral form rather
 * than chosen: 52px fields with 14/16 padding and an 8px radius, 15px
 * labels at weight 500 seven pixels above their field, 16px/26px body text,
 * and #CF232B buttons at 12/24 padding. The one value that is not from the
 * site is --cl-tq-tint, the wash behind the card, which exists only to give
 * a white panel on a white page an edge.
 *
 * Three things here are deliberate and easy to undo by accident:
 *
 * 1. THERE ARE NO FONT SIZES FOR BODY TEXT, and only one font family.
 *    Type on this site is set in Salient > Typography and nowhere else, so
 *    the options, the labels and the paragraphs all inherit. The serif on
 *    the heading and the questions is the exception, and it is a setting
 *    (--cl-tq-display-font) rather than a hard-coded face. The other
 *    exception is the input font size at phone widths, below: that is not
 *    a design choice, it stops iOS zooming the page when a field is
 *    tapped, and the contact forms already carry the same rule.
 *
 * 2. EVERY STEP IS VISIBLE UNTIL THE SCRIPT SAYS OTHERWISE. The stepping
 *    is added by .cl-tq--stepped, which only the script sets. Without
 *    JavaScript the quiz is one long form that still submits and still
 *    marks — hiding the steps in CSS first would leave a visitor with no
 *    script looking at one question and no way to reach the rest.
 *
 * 3. THE CARD IS A MODIFIER, not the default shape. .cl-tq--card paints
 *    it; without that class the quiz sits straight on the page, which is
 *    what the Card toggle turns off.
 */

.cl-tq {
	--cl-tq-radius: 8px;
	--cl-tq-option-gap: 10px;
	--cl-tq-width: 720px;
	--cl-tq-text: #061e21;
	--cl-tq-muted: rgba(6, 30, 33, 0.7);
	--cl-tq-rule: rgba(6, 30, 33, 0.16);
	--cl-tq-accent: #cf232b;
	--cl-tq-panel: #ffffff;
	--cl-tq-display: #0e2422;
	--cl-tq-tint: #f8f7f5;

	color: var(--cl-tq-text);
}

/* ------------------------------------------------------------------ */
/* Page header                                                         */
/* ------------------------------------------------------------------ */

.cl-tq__header {
	max-width: var(--cl-tq-width);
	margin: 0 auto 44px;
	text-align: center;
}

.cl-tq__eyebrow {
	/* No gap of its own. The eyebrow carries nectar-inherit-h6, so Salient
	   sizes it like the hero eyebrows (13px), and at that size the leading
	   above the heading is the whole gap - 18px optically, matching the
	   17px on Referrals and Training. A margin on top of that reads as a
	   break between two things rather than one label above a title. */
	margin: 0;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--cl-tq-muted);
}

.cl-tq__heading {
	margin: 0 0 20px;
	font-family: var(--cl-tq-display-font, inherit);
	font-weight: 400;
	/* 1.03 is what the hero titles on the rest of the site use. At 1.08 the
	   extra leading sat above the first line, so the eyebrow above it read
	   2px further away than on every other page. */
	line-height: 1.03;
	letter-spacing: -0.5px;
	color: var(--cl-tq-display);
	/* Stops a heading breaking with one word stranded on the last line. */
	text-wrap: balance;
}

.cl-tq__intro {
	margin: 0 auto;
	max-width: 540px;
	color: var(--cl-tq-muted);
	text-wrap: pretty;
}

/* ------------------------------------------------------------------ */
/* The panel                                                           */
/* ------------------------------------------------------------------ */

.cl-tq__panel {
	max-width: var(--cl-tq-width);
	margin: 0 auto;
	box-sizing: border-box;
}

.cl-tq--card .cl-tq__panel {
	background: var(--cl-tq-panel);
	border: 1px solid rgba(6, 30, 33, 0.14);
	border-radius: 14px;
	padding: 40px;
}

/* ------------------------------------------------------------------ */
/* Progress                                                            */
/* ------------------------------------------------------------------ */

.cl-tq__progress {
	margin-bottom: 36px;
}

.cl-tq__progress-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 12px;
}

.cl-tq__stepname {
	font-weight: 500;
}

.cl-tq__count {
	margin: 0;
	color: var(--cl-tq-muted);
	white-space: nowrap;
}

.cl-tq__track {
	display: flex;
	gap: 6px;
}

/**
 * One segment per step rather than one sliding bar, so how many steps are
 * left is as legible as how far in you are.
 */
.cl-tq__seg {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: rgba(6, 30, 33, 0.12);
	transition: background-color 0.3s ease;
}

.cl-tq__seg.is-on {
	background: var(--cl-tq-accent);
}

/* ------------------------------------------------------------------ */
/* Steps                                                               */
/* ------------------------------------------------------------------ */

.cl-tq__step {
	margin-bottom: 32px;
}

/* Set by the script only. See note 2 at the top. */
.cl-tq--stepped .cl-tq__step {
	display: none;
	margin-bottom: 0;
}

.cl-tq--stepped .cl-tq__step.is-current {
	display: block;
}

.cl-tq__step-title,
.cl-tq__question {
	margin: 0 0 8px;
	padding: 0;
	font-family: var(--cl-tq-display-font, inherit);
	font-weight: 400;
	line-height: 1.25;
	color: var(--cl-tq-display);
	text-wrap: pretty;
}

.cl-tq__question {
	margin-bottom: 28px;
}

.cl-tq__step-note {
	margin: 0 0 32px;
	color: var(--cl-tq-muted);
}

/**
 * The script moves focus to the step's heading so a screen reader reads the
 * question before its options. Those headings carry tabindex="-1", so they
 * can only ever be focused programmatically — never by tabbing — and the
 * browser's focus ring round them is therefore noise to a sighted visitor,
 * who has not moved focus anywhere. Every control inside the step keeps its
 * own visible ring.
 */
.cl-tq__step-title:focus,
.cl-tq__question:focus,
.cl-tq__result:focus {
	outline: none;
}

.cl-tq__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Details                                                             */
/* ------------------------------------------------------------------ */

.cl-tq__fields {
	display: flex;
	flex-wrap: wrap;
	/* 18px down, 20px across: with the 25px label and its 7px margin that
	   puts 50px between one field and the next, which is what the referral
	   form measures. */
	gap: 18px 20px;
}

/**
 * Salient puts 24px of bottom PADDING (not margin) on every paragraph, and
 * each field is a paragraph. Left alone it stacks on top of the flex gap
 * and pushes the rows 24px further apart than the site's own forms.
 */
.cl-tq__field {
	flex: 1 1 200px;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* Email and pharmacy name are the two that regularly run long. */
.cl-tq__field:nth-child(3),
.cl-tq__field:nth-child(4) {
	flex-basis: 100%;
}

.cl-tq__label {
	display: block;
	margin-bottom: 7px;
	font-weight: 500;
}

.cl-tq__required {
	color: var(--cl-tq-accent);
}

.cl-tq__input {
	width: 100%;
	/* No height: the site's own fields take theirs from padding plus the
	   line-height, so setting one here only makes this field the odd one
	   out. */
	box-sizing: border-box;
	padding: 14px 16px;
	border: 1px solid var(--cl-tq-rule);
	border-radius: var(--cl-tq-radius);
	background: var(--cl-tq-panel);
	color: var(--cl-tq-text);
	/* An <input> does not inherit the page font on its own. */
	font-family: inherit;
}

/**
 * Salient styles every native input inside .container-wrap — a grey fill, a
 * transparent 2px border, a 4px radius and a margin underneath — and that
 * selector (one class, one attribute, one element) outweighs a single class
 * of ours, so the plain rule above loses on this site. These are the same
 * properties the site's own contact forms restate in Salient's Custom CSS;
 * here they stay scoped to this element rather than going global.
 *
 * FONT SIZE IS DELIBERATELY NOT SET. The site's own form fields are sized
 * in rem off Salient's fluid root, so they are about 13–14px on a desktop,
 * and a hard 16px here made the quiz's fields four pixels taller than every
 * other form on the site. Letting it inherit keeps them the same height.
 * The phone rule further down is the one exception, and it is the same
 * exception the contact forms already make.
 *
 * The margin has to go too: Salient puts 24px under every input, which
 * stacks on top of the grid gap and pushed the rows 26px further apart than
 * the referral form's.
 */
.cl-tq .cl-tq__input[type] {
	padding: 14px 16px !important;
	margin: 0 !important;
	/* The body line-height is 24px and an input inherits it, which made the
	   field four pixels taller than the site's. Its own controls leave this
	   at normal. */
	line-height: normal !important;
	/* 0.98rem is what the Referrals, Contact and Pharmacy fields use, and it
	   is a rem on purpose: Salient's root is fluid, so the field grows and
	   shrinks with everything else. A fixed px here made this field the only
	   one on the site that did not. */
	font-size: 0.98rem !important;
	background: var(--cl-tq-panel) !important;
	border: 1px solid var(--cl-tq-rule) !important;
	border-radius: var(--cl-tq-radius) !important;
}

.cl-tq .cl-tq__input[type]:focus,
.cl-tq .cl-tq__input[type]:focus-visible {
	outline: 2px solid var(--cl-tq-accent);
	outline-offset: 1px;
	border-color: var(--cl-tq-rule) !important;
}

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

.cl-tq__options {
	display: flex;
	flex-direction: column;
	gap: var(--cl-tq-option-gap);
}

.cl-tq__option {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 58px;
	padding: 16px 20px;
	box-sizing: border-box;
	border: 1px solid var(--cl-tq-rule);
	border-radius: calc(var(--cl-tq-radius) + 2px);
	background: var(--cl-tq-panel);
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cl-tq__option:hover {
	border-color: var(--cl-tq-text);
}

/* :has() styles the whole row from the radio inside it, so the selected
   option reads as a selected card rather than only a filled circle.
   Browsers without :has() still show the radio itself — nothing is lost. */
.cl-tq__option:has(input:checked) {
	border-color: var(--cl-tq-accent);
	background: color-mix(in srgb, var(--cl-tq-accent) 4.5%, var(--cl-tq-panel));
}

.cl-tq__option:has(input:checked) .cl-tq__option-text {
	font-weight: 500;
}

.cl-tq__option:has(input:focus-visible) {
	outline: 2px solid var(--cl-tq-accent);
	outline-offset: 1px;
}

.cl-tq__option input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--cl-tq-accent);
}

.cl-tq__option-text {
	flex: 1 1 auto;
}

/* ------------------------------------------------------------------ */
/* Actions                                                             */
/* ------------------------------------------------------------------ */

.cl-tq__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.cl-tq__btn {
	/* The site's submit buttons are 12px/24px with NO border, giving a 46px
	   box. Ours carry a 1px border so the outline variant can exist, so the
	   vertical padding gives that pixel back and both land on 46px too. */
	padding: 11px 24px;
	box-sizing: border-box;
	border: 1px solid var(--cl-tq-accent);
	border-radius: var(--cl-tq-radius);
	background: var(--cl-tq-accent);
	color: #ffffff;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	/* A <button> does not inherit the page font either, and Salient forces
	   its own 4px radius onto native buttons, so both are restated. */
	font-family: inherit;
	font-weight: 500;
	/* Same reason as the fields: the inherited 24px made these taller than
	   every other submit button on the site. */
	line-height: normal;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Salient's button radius is an !important of its own, so matching the
   site's 8px takes one back. Scoped to this element. */
.cl-tq button.cl-tq__btn,
.cl-tq a.cl-tq__btn {
	border-radius: var(--cl-tq-radius) !important;
	font-size: 16px;
}

.cl-tq__btn:hover {
	transform: translateY(-2px);
	color: #ffffff;
}

.cl-tq__btn[disabled] {
	opacity: 0.55;
	cursor: default;
	transform: none;
}

/* The forward button takes the room; Previous stays the width of its text. */
.cl-tq__btn--next,
.cl-tq__btn--submit {
	flex: 1 1 220px;
}

.cl-tq__btn--back,
.cl-tq__btn--ghost {
	flex: 0 0 auto;
	background: transparent;
	color: var(--cl-tq-text);
	border-color: rgba(6, 30, 33, 0.22);
}

.cl-tq__btn--back:hover,
.cl-tq__btn--ghost:hover {
	color: var(--cl-tq-text);
	border-color: var(--cl-tq-text);
}

/* ------------------------------------------------------------------ */
/* Errors                                                              */
/* ------------------------------------------------------------------ */

.cl-tq__error {
	margin: 20px 0 0;
	padding: 12px 16px;
	border-radius: var(--cl-tq-radius);
	background: color-mix(in srgb, var(--cl-tq-accent) 8%, #ffffff);
	color: var(--cl-tq-accent);
}

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

.cl-tq__result {
	text-align: center;
}

.cl-tq__ring {
	position: relative;
	width: 132px;
	height: 132px;
	margin: 0 auto 32px;
}

.cl-tq__ring-svg {
	display: block;
	width: 132px;
	height: 132px;
}

.cl-tq__ring-track {
	stroke: rgba(6, 30, 33, 0.10);
}

.cl-tq__ring-value {
	stroke: var(--cl-tq-display);
	transition: stroke-dashoffset 0.9s ease;
}

/* Not passed: the ring is part filled AND a lighter weight, so pass and
   fail differ in more than one way. */
.cl-tq__result.is-fail .cl-tq__ring-value {
	stroke: rgba(6, 30, 33, 0.45);
}

.cl-tq__ring-nums {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.cl-tq__ring-percent {
	font-size: 30px;
	font-weight: 500;
	line-height: 1;
}

.cl-tq__ring-score {
	font-size: 13px;
	color: var(--cl-tq-muted);
}

.cl-tq__result-title {
	margin: 0 0 20px;
	font-family: var(--cl-tq-display-font, inherit);
	font-weight: 400;
	line-height: 1.03;
	letter-spacing: -0.5px;
	color: var(--cl-tq-display);
	text-wrap: balance;
}

.cl-tq__result-text {
	margin: 0 auto 36px;
	max-width: 480px;
	color: var(--cl-tq-muted);
	text-wrap: pretty;
}

.cl-tq__next {
	text-align: left;
	background: var(--cl-tq-tint);
	border-radius: calc(var(--cl-tq-radius) + 2px);
	padding: 28px 30px;
	margin-bottom: 36px;
}

.cl-tq__next-title {
	margin: 0 0 18px;
	font-weight: 500;
}

.cl-tq__next-list {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: cl-tq-next;
}

.cl-tq__next-item {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	color: var(--cl-tq-muted);
	counter-increment: cl-tq-next;
}

.cl-tq__next-item + .cl-tq__next-item {
	margin-top: 16px;
}

/* The number is drawn rather than left to the list marker so it can sit in
   a circle, the same as the numbered steps on the referrals page. */
.cl-tq__next-item::before {
	content: counter(cl-tq-next);
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	border: 1px solid rgba(6, 30, 33, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
}

.cl-tq__result-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.cl-tq__result-actions .cl-tq__btn {
	flex: 0 0 auto;
}

.cl-tq__notice {
	padding: 12px 16px;
	border: 1px dashed var(--cl-tq-rule);
	border-radius: var(--cl-tq-radius);
	color: var(--cl-tq-muted);
}

/* ------------------------------------------------------------------ */
/* Honeypot                                                            */
/* ------------------------------------------------------------------ */

/* Not display:none — some bots skip fields that are hidden that way, and
   the point is that they fill it in. */
.cl-tq__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Phones                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 690px) {

	.cl-tq__header {
		margin-bottom: 32px;
	}

	.cl-tq--card .cl-tq__panel {
		padding: 24px 20px;
	}

	.cl-tq__fields {
		gap: 16px;
	}

	/* The site's own forms do exactly this, and for the same reason: 0.98rem
	   falls to about 11px on a phone, and 16px is the threshold below which
	   iOS zooms the page in when a field is tapped. */
	.cl-tq .cl-tq__input[type] {
		font-size: 16px !important;
	}

	.cl-tq__field,
	.cl-tq__field:nth-child(3),
	.cl-tq__field:nth-child(4) {
		flex-basis: 100%;
	}

	.cl-tq__track {
		gap: 4px;
	}

	/* Stacked and full width, so the forward button is always the one
	   under the thumb. */
	.cl-tq__actions,
	.cl-tq__result-actions {
		flex-direction: column-reverse;
		gap: 10px;
	}

	.cl-tq__actions .cl-tq__btn,
	.cl-tq__result-actions .cl-tq__btn {
		flex: 1 1 auto;
		width: 100%;
		box-sizing: border-box;
	}

	.cl-tq__next {
		padding: 22px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.cl-tq__seg,
	.cl-tq__option,
	.cl-tq__btn,
	.cl-tq__ring-value {
		transition: none;
	}

	.cl-tq__btn:hover {
		transform: none;
	}
}
