/* TF LMS quiz */
.tf-quiz [hidden] { display: none !important; }
.tf-quiz { --q-navy: #1A1C2A; --q-red: #C70807; --q-grey: #EAEBEC; --q-grey-2: #F6F6F7; --q-text: #333333; --q-ease: cubic-bezier(.2, .7, .2, 1);
	margin: 40px 0 10px; border-radius: 10px; background: var(--q-grey); padding: clamp(18px, 3vw, 30px); font-weight: 700; color: var(--q-text); scroll-margin-top: 110px; position: relative; overflow: hidden; overflow: clip; isolation: isolate; }
.tf-quiz::before { content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%; border: 36px solid rgba(199, 8, 7, .07); }
.tf-quiz button { font-family: inherit; }
.tf-quiz .tf-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; padding: 13px 24px; background: var(--q-navy); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; transition: background .25s, transform .25s var(--q-ease), opacity .2s; }
.tf-quiz .tf-btn:hover { background: var(--q-red); transform: translateY(-2px); }
.tf-quiz .tf-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; background: var(--q-navy); }

/* Intro */
.tf-quiz__intro { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tf-quiz__badge { width: 64px; height: 64px; flex-shrink: 0; border-radius: 10px; background: var(--q-navy); color: #fff; display: grid; place-items: center; animation: tfq-bob 3s ease-in-out infinite; }
.tf-quiz__badge svg { width: 28px; height: 28px; fill: currentColor; }
.tf-quiz__head { flex: 1; min-width: 200px; }
.tf-quiz__eyebrow { margin: 0; color: var(--q-red); font-size: 17px; font-weight: 900 !important; letter-spacing: 3px; text-transform: uppercase; line-height: 1.2; -webkit-text-stroke: .7px currentColor; paint-order: stroke fill; }
.tf-quiz__title { margin: 2px 0 2px !important; color: var(--q-navy) !important; font-size: 22px; font-weight: 900; line-height: 1.25; display: block !important; }
.tf-quiz__title::before { display: none !important; }
.tf-quiz__meta { margin: 0 !important; color: #6b6b6b; font-size: 16px; }

/* Progress */
.tf-quiz__top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tf-quiz__count { flex-shrink: 0; color: var(--q-navy); font-size: 16px; font-weight: 800; }
.tf-quiz__bar { flex: 1; height: 8px; border-radius: 4px; background: #fff; overflow: hidden; }
.tf-quiz__bar span { display: block; height: 100%; border-radius: 4px; background: var(--q-red); transition: width .6s var(--q-ease); }

/* Question card */
.tf-quiz__card { background: #fff; border-radius: 10px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 10px 30px rgba(26, 28, 42, .08); animation: tfq-in .45s var(--q-ease) both; }
.tf-quiz__q { color: var(--q-navy); font-size: 18px; font-weight: 900; line-height: 1.5; margin-bottom: 16px; }
.tf-quiz__q strong { color: var(--q-red); }
.tf-quiz__hint { margin: -8px 0 14px !important; color: #6b6b6b; font-size: 16px; }
.tf-quiz__options { display: grid; gap: 10px; }
.tf-quiz__opt {
	display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left;
	border: 2px solid var(--q-grey); border-radius: 10px; background: #fff; color: var(--q-text); font-size: 17px; font-weight: 700; line-height: 1.4; cursor: pointer;
	transition: border-color .2s, background .2s, transform .2s var(--q-ease); animation: tfq-in .4s var(--q-ease) both;
}
.tf-quiz__opt:hover:not(:disabled) { border-color: var(--q-navy); transform: translateX(3px); }
.tf-quiz__letter { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--q-grey); color: var(--q-navy); font-size: 16px; font-weight: 900; transition: background .2s, color .2s; }
.tf-quiz__opt[aria-pressed="true"] { border-color: var(--q-navy); background: var(--q-grey-2); }
.tf-quiz__opt[aria-pressed="true"] .tf-quiz__letter { background: var(--q-navy); color: #fff; }
.tf-quiz__opt:disabled { cursor: default; }
.tf-quiz__opt.is-right { border-color: var(--q-navy); background: var(--q-grey-2); }
.tf-quiz__opt.is-right .tf-quiz__letter { background: var(--q-navy); color: #fff; font-size: 0; }
.tf-quiz__opt.is-right .tf-quiz__letter::before { content: "\2713"; font-size: 17px; }
.tf-quiz__opt.is-wrong { border-color: var(--q-red); background: #FDF2F2; }
.tf-quiz__opt.is-wrong .tf-quiz__letter { background: var(--q-red); color: #fff; font-size: 0; }
.tf-quiz__opt.is-wrong .tf-quiz__letter::before { content: "\2715"; font-size: 16px; }
.tf-quiz__opt.is-right:not([aria-pressed="true"]) { border-style: dashed; }
.tf-quiz__form.is-checked .tf-quiz__opt:not(.is-right):not(.is-wrong) { opacity: .6; }

/* Gap fill */
.tf-quiz__q--gap { font-weight: 900; color: var(--q-navy); font-size: 18px; }
.tf-quiz__line { margin: 0 0 12px !important; line-height: 2.3; }
.tf-quiz__gap {
	display: inline-block; max-width: 100%; margin: 0 4px; padding: 5px 10px; vertical-align: baseline;
	border: 0; border-bottom: 3px solid var(--q-navy); border-radius: 6px 6px 0 0; background: var(--q-grey-2);
	font: inherit; font-weight: 900; color: var(--q-navy); transition: background .2s, border-color .2s;
}
.tf-quiz__gap:focus { outline: none; background: var(--q-grey); border-color: var(--q-red); }
.tf-quiz__gap.is-right { border-color: var(--q-navy); background: var(--q-grey); }
.tf-quiz__gap.is-caps { border-color: var(--q-navy); border-bottom-style: dashed; }
.tf-quiz__gap.is-wrong { border-color: var(--q-red); background: #FDF2F2; color: var(--q-red); text-decoration: line-through; }
.tf-quiz__fix { display: inline-block; margin: 0 4px; padding: 2px 10px; border-radius: 6px; background: var(--q-navy); color: #fff; font-size: 16px; font-weight: 900; line-height: 1.6; animation: tfq-in .35s var(--q-ease) both; }

/* Feedback */
.tf-quiz__feedback { position: relative; margin-top: 16px; padding: 16px 20px 16px 70px; border-radius: 10px; border: 2px solid var(--q-grey); background: #fff; box-shadow: 0 10px 26px rgba(26, 28, 42, .08); animation: tfq-in .35s var(--q-ease) both; }
.tf-quiz__feedback::before { content: "✓"; position: absolute; left: 18px; top: 16px; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--q-navy); color: #fff; font-size: 20px; font-weight: 900; line-height: 1; animation: tfq-pop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.tf-quiz__feedback.is-partial::before { content: "½"; background: #8F8F8F; }
.tf-quiz__feedback.is-wrong::before { content: "✗"; background: var(--q-red); }
@keyframes tfq-pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tf-quiz__feedback p { margin: 0 0 4px !important; }
.tf-quiz__feedback p:last-child { margin-bottom: 0 !important; }
.tf-quiz__feedback.is-wrong { border-color: #F3D0D0; background: #FDF6F6; }
.tf-quiz__verdict { color: var(--q-navy); font-size: 18px; font-weight: 900; }

.tf-quiz__caps { color: var(--q-red); font-weight: 900; }
.tf-quiz__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.tf-quiz__link { border: 0; background: none; padding: 6px 2px; color: var(--q-navy); font-size: 16px; font-weight: 900; cursor: pointer; border-bottom: 2px solid var(--q-red); }
.tf-quiz__link:hover { color: var(--q-red); }

/* Result */
.tf-quiz__result { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: #fff; border-radius: 10px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 10px 30px rgba(26, 28, 42, .08); animation: tfq-in .45s var(--q-ease) both; }
.tf-quiz__ring { position: relative; width: 132px; height: 132px; }
.tf-quiz__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tf-quiz__ring circle { fill: none; stroke: var(--q-grey); stroke-width: 12; }
.tf-quiz__ring .tf-quiz__arc { stroke: var(--q-red); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: calc(326.7 - 326.7 * var(--p) / 100); }
.tf-quiz__pct { position: absolute; inset: 0; display: grid; place-items: center; color: var(--q-navy); font-size: 30px; font-weight: 900; }
.tf-quiz__points { margin: 0 !important; color: var(--q-navy); font-size: 26px; font-weight: 900; }
.tf-quiz__msg { margin: 4px 0 0 !important; font-size: 17px; }
.tf-quiz__review { grid-column: 1 / -1; list-style: none; margin: 6px 0 0 !important; padding: 0 !important; display: grid; gap: 10px; counter-reset: rq; }
.tf-quiz__review li { counter-increment: rq; position: relative; margin: 0 !important; padding: 12px 14px 12px 52px !important; border-radius: 10px; background: var(--q-grey-2); border: 2px solid transparent; }
.tf-quiz__review li::before { content: counter(rq) !important; position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--q-navy) !important; color: #fff; font-size: 16px; font-weight: 900; transform: none !important; }
.tf-quiz__review li.is-wrong { background: #FDF6F6; border-color: #F3D0D0; }
.tf-quiz__review li.is-wrong::before { background: var(--q-red) !important; }
.tf-quiz__review p { margin: 0 0 2px !important; font-size: 16px; }
.tf-quiz__review span { color: #6b6b6b; font-weight: 900; }
.tf-quiz__rq { color: var(--q-navy); font-weight: 900; }
@media (max-width: 560px) {
	.tf-quiz__result { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.tf-quiz__result .tf-quiz__actions { justify-content: center; }
	.tf-quiz__review { text-align: left; justify-self: stretch; }
	.tf-quiz__top { flex-direction: column; align-items: stretch; gap: 8px; }
}
.tfq-missing { padding: 12px 16px; border: 2px dashed #C70807; border-radius: 10px; color: #C70807; font-weight: 900; }

@keyframes tfq-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tfq-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .tf-quiz * { animation: none !important; transition: none !important; } }

.tf-quiz img { max-width: 100%; height: auto; border-radius: 6px; }
.tf-quiz__q p, .tf-quiz__q ul, .tf-quiz__q ol { margin: 0 0 .6em; }

/* Questions and instructions always bold */
.tf-quiz .tf-quiz__q, .tf-quiz .tf-quiz__q p, .tf-quiz .tf-quiz__q li, .tf-quiz .tf-quiz__q span:not(.tf-quiz__fix) { font-weight: 900 !important; color: var(--q-navy); }
.tf-quiz .tf-quiz__verdict { font-weight: 900 !important; font-size: 18px; }
.tf-quiz .tf-quiz__feedback p { font-weight: 800; }
.tf-quiz .tf-quiz__eyebrow { color: var(--q-red) !important; }
.tf-quiz .tf-quiz__title { color: var(--q-red) !important; font-size: 20px; }
