/*
 * Course screens (Figma course-guest, course-lesson): Tutor's learning area laid out as the lesson
 * column plus the course contents on the right, stacked below 1024. Tutor keeps its own CSS for the
 * player and the quiz; these rules only replace its app-style shell (sticky sidebar, inner header).
 */

/* Shell: the site header stays, Tutor's learning header is gone (template override). */
.tutor-learning-area.tutor-has-site-shell {
	--tutor-learning-header-height: 0px;
	background-color: var(--wp--custom--color--bg--page);
}

.tutor-learning-area.tutor-has-site-shell .tutor-learning-area-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--wp--custom--layout--course-aside);
	align-items: start;
	gap: var(--wp--custom--space--xl);
	max-width: calc(var(--wp--custom--layout--wide-width) + 2 * var(--wp--custom--gutter));
	margin-inline: auto;
	padding: var(--wp--custom--space--xxl) var(--wp--custom--gutter);
}

.tutor-learning-area.tutor-has-site-shell .tutor-learning-area-content {
	grid-column: 1;
	grid-row: 1;
	padding: 0;
}

.tutor-learning-area.tutor-has-site-shell .tutor-learning-area-container {
	max-width: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 1023px) {
	.tutor-learning-area.tutor-has-site-shell .tutor-learning-area-body {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Lesson column */
.kchsi-lesson {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--lg);
}

.kchsi-lesson p {
	margin: 0;
}

.kchsi-lesson__eyebrow,
.kchsi-register__eyebrow,
.kchsi-next__eyebrow {
	color: var(--wp--custom--color--text--brand);
}

.kchsi-lesson__video {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--media);
}

/* Placeholder play disc until the lesson has a video (same look as the hero play button). */
.kchsi-lesson__play {
	position: static;
	inset: auto;
	width: var(--wp--custom--control--height-lg);
	height: var(--wp--custom--control--height-lg);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--card);
}

.kchsi-lesson__play::before {
	content: "";
	width: var(--wp--custom--spacing--6);
	height: var(--wp--custom--spacing--6);
	background-color: var(--wp--custom--color--icon--default);
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M5 5a2 2 0 0 1 3-1.7l12 7a2 2 0 0 1 0 3.4l-12 7A2 2 0 0 1 5 19z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.kchsi-lesson__copy {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

.kchsi-lesson__title {
	margin: 0;
	font-size: var(--wp--custom--type--heading-2);
	line-height: var(--wp--custom--line-height--heading-2);
	letter-spacing: var(--wp--custom--tracking--heading-2);
}

.kchsi-lesson__text {
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-lesson__text > * {
	margin-block: 0;
}

/* Progress (Figma Progress): eyebrow label, percentage, 8 px track with a brand fill. */
.kchsi-progress {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

.kchsi-progress__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wp--custom--space--md);
}

.kchsi-progress__label {
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-progress__value {
	font-size: var(--wp--custom--font-size--14);
	font-weight: var(--wp--custom--weight--semibold);
	color: var(--wp--custom--color--text--brand);
}

.kchsi-progress__track {
	height: var(--wp--custom--spacing--2);
	overflow: hidden;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--custom--color--bg--muted);
}

.kchsi-progress__fill {
	display: block;
	width: var(--kchsi-progress, 0%);
	height: 100%;
	border-radius: inherit;
	background-color: var(--wp--custom--color--bg--brand);
	box-shadow: var(--wp--preset--shadow--glow-soft-brand);
}

/* Next card (Figma course-lesson: next): brand-soft panel, text on the left, secondary button right. */
.kchsi-next {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--space--md);
	padding: var(--wp--custom--space--lg);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--custom--color--bg--brand-soft);
}

.kchsi-next__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	min-width: 0;
}

.kchsi-next__title {
	font-size: var(--wp--custom--type--heading-4);
	font-weight: var(--wp--custom--weight--heading-4);
	line-height: var(--wp--custom--line-height--heading-4);
}

.kchsi-next__note {
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-next__action form {
	margin: 0;
}

.kchsi-next__action .wp-block-button__link {
	border: 0;
	font: inherit;
	font-weight: var(--wp--custom--weight--semibold);
	cursor: pointer;
}

@media (max-width: 767px) {
	.kchsi-next {
		flex-direction: column;
		align-items: stretch;
	}

	.kchsi-next__action .wp-block-button__link {
		width: 100%;
	}
}

/* Registration card (Figma course-guest: register): white card, card shadow, two-column fields. */
.kchsi-register {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--lg);
	padding: var(--wp--custom--space--xl);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--card);
	scroll-margin-top: var(--wp--custom--space--xxl);
}

.kchsi-register__intro {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

.kchsi-register__title {
	margin: 0;
	font-size: var(--wp--custom--type--heading-3);
	line-height: var(--wp--custom--line-height--heading-3);
	letter-spacing: var(--wp--custom--tracking--heading-3);
}

.kchsi-register__text {
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--md);
}

.kchsi-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--custom--space--md);
}

.kchsi-field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	margin: 0;
}

.kchsi-field label {
	font-weight: var(--wp--custom--weight--medium);
}

.kchsi-select {
	appearance: none;
	padding-inline-end: var(--wp--custom--space--xxl);
	background: var(--wp--custom--color--bg--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right var(--wp--custom--space--md) center / var(--wp--custom--spacing--5) no-repeat;
	cursor: pointer;
}

.kchsi-check {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--custom--space--sm);
	margin: 0;
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--custom--space--md);
	padding-top: var(--wp--custom--space--sm);
}

.kchsi-form__actions .wp-block-button__link {
	border: 0;
	font: inherit;
	font-weight: var(--wp--custom--weight--semibold);
	cursor: pointer;
}

.kchsi-form__link {
	font-size: var(--wp--custom--font-size--14);
	color: var(--wp--custom--color--text--link);
}

@media (max-width: 767px) {
	.kchsi-register {
		padding: var(--wp--custom--space--lg);
	}

	.kchsi-form__row {
		grid-template-columns: minmax(0, 1fr);
	}

	.kchsi-form__actions .wp-block-button,
	.kchsi-form__actions .wp-block-button__link {
		width: 100%;
	}
}

/* Course contents (Figma: contents + Course/LessonRow, state done | current | open | locked). */
.kchsi-curriculum {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

@media (min-width: 1024px) {
	.kchsi-curriculum {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--control--height-lg) + var(--wp--custom--space--xxl));
	}
}

@media (max-width: 1023px) {
	.kchsi-curriculum {
		grid-column: 1;
		grid-row: 2;
	}
}

.kchsi-curriculum__head {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	padding: var(--wp--custom--space--sm) var(--wp--custom--space--md);
}

.kchsi-curriculum__title {
	margin: 0;
	font-family: var(--wp--custom--font--body);
	font-size: var(--wp--custom--type--heading-4);
	font-weight: var(--wp--custom--weight--heading-4);
	line-height: var(--wp--custom--line-height--heading-4);
	letter-spacing: var(--wp--custom--tracking--body);
}

.kchsi-curriculum__meta {
	margin: 0;
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--muted);
}

.kchsi-curriculum__list {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.kchsi-lesson-row {
	--kchsi-row-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4.5a1.5 1.5 0 0 1 2.3-1.3l11 7a1.5 1.5 0 0 1 0 2.6l-11 7A1.5 1.5 0 0 1 6 18.5z'/%3E%3C/svg%3E");
	--kchsi-row-icon-color: var(--wp--custom--color--icon--brand);
	display: flex;
	align-items: center;
	gap: var(--wp--custom--space--md);
	padding: var(--wp--custom--space--sm) var(--wp--custom--space--md);
	border: var(--wp--custom--border--width) solid transparent;
	border-radius: var(--wp--custom--radius--control);
	color: var(--wp--custom--color--text--primary);
	text-decoration: none;
	transition:
		background-color var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--ease--out),
		border-color var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--ease--out);
}

a.kchsi-lesson-row:hover,
a.kchsi-lesson-row:focus-visible {
	background-color: var(--wp--custom--color--bg--subtle);
}

.kchsi-lesson-row.is-current {
	border-color: color-mix(in srgb, var(--wp--custom--color--border--brand) 50%, transparent);
	background-color: var(--wp--custom--color--bg--brand-soft);
	box-shadow: var(--wp--preset--shadow--glow-soft-brand);
}

.kchsi-lesson-row.is-done {
	--kchsi-row-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

.kchsi-lesson-row.is-locked {
	--kchsi-row-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
	--kchsi-row-icon-color: var(--wp--custom--color--icon--muted);
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-lesson-row__icon {
	flex: none;
	width: var(--wp--custom--spacing--6);
	height: var(--wp--custom--spacing--6);
	background-color: var(--kchsi-row-icon-color);
	mask: var(--kchsi-row-icon) center / contain no-repeat;
}

.kchsi-lesson-row__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.kchsi-lesson-row__label {
	font-size: var(--wp--custom--font-size--12);
	font-weight: var(--wp--custom--weight--semibold);
	line-height: var(--wp--custom--line-height--small);
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
	color: var(--wp--custom--color--text--muted);
}

.kchsi-lesson-row__title {
	font-size: var(--wp--custom--font-size--14);
	font-weight: var(--wp--custom--weight--medium);
	line-height: var(--wp--custom--line-height--small);
}

.kchsi-lesson-row__aside {
	flex: none;
	font-size: var(--wp--custom--font-size--12);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--muted);
}

/* Form states shared by registration and sign-in. */
.kchsi-form__error {
	display: block;
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--accent);
}

.kchsi-form__trap {
	position: absolute;
	left: -100vw;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.kchsi-check input[aria-invalid="true"] {
	border-color: var(--wp--custom--color--border--danger);
}

.kchsi-auth__notice {
	margin: 0;
	padding: var(--wp--custom--space--sm) var(--wp--custom--space--md);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--custom--color--bg--warning-soft);
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
}

/* Sign-in (Figma login, login-code): a 480 card centred over soft orbs. */
.kchsi-auth {
	display: flex;
	justify-content: center;
	padding: var(--wp--custom--section-y) var(--wp--custom--gutter);
}

.kchsi-auth__card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--lg);
	width: 100%;
	max-width: var(--wp--custom--layout--auth-card);
	padding: var(--wp--custom--space--xl);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--card);
}

.kchsi-auth__card p {
	margin: 0;
}

.kchsi-auth__intro {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

.kchsi-auth__eyebrow {
	color: var(--wp--custom--color--text--brand);
}

.kchsi-auth__title {
	margin: 0;
	font-size: var(--wp--custom--type--heading-3);
	line-height: var(--wp--custom--line-height--heading-3);
	letter-spacing: var(--wp--custom--tracking--heading-3);
}

.kchsi-auth__text {
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-auth__submit,
.kchsi-auth__submit .wp-block-button__link {
	width: 100%;
}

.kchsi-auth__submit .wp-block-button__link {
	border: 0;
	font: inherit;
	font-weight: var(--wp--custom--weight--semibold);
	cursor: pointer;
}

.kchsi-auth__resend {
	margin: 0;
	font-size: var(--wp--custom--font-size--14);
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-auth__link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--custom--color--text--link);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.kchsi-auth__aside {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	padding: var(--wp--custom--space--md);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--custom--color--bg--subtle);
}

.kchsi-auth__aside-title {
	font-weight: var(--wp--custom--weight--semibold);
}

.kchsi-auth__aside-text {
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-auth__aside-link {
	font-size: var(--wp--custom--font-size--14);
	font-weight: var(--wp--custom--weight--semibold);
	color: var(--wp--custom--color--text--link);
}

@media (max-width: 767px) {
	.kchsi-auth__card {
		padding: var(--wp--custom--space--lg);
	}
}

/* Code cells (Figma Code/Digit, state empty | filled | focus): 48 x 56, control radius. */
.kchsi-code {
	display: flex;
	gap: var(--wp--custom--space--sm);
	margin: 0;
	padding: 0;
	border: 0;
}

.kchsi-code__digit {
	width: var(--wp--custom--control--height-md);
	height: var(--wp--custom--control--height-lg);
	padding: 0;
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--custom--color--bg--surface);
	color: var(--wp--custom--color--text--primary);
	font: inherit;
	font-size: var(--wp--custom--type--heading-4);
	font-weight: var(--wp--custom--weight--semibold);
	text-align: center;
}

.kchsi-code__digit:focus {
	outline: none;
	border-color: var(--wp--custom--color--border--focus);
	box-shadow: inset 0 0 0 var(--wp--custom--border--width) var(--wp--custom--color--border--focus), var(--wp--preset--shadow--glow-soft-brand);
}

.kchsi-code__digit[aria-invalid="true"] {
	border-color: var(--wp--custom--color--border--danger);
}

/* Account chip in the header (Figma Header/Account): initial disc + first name, menu on click. */
.kchsi-account__menu {
	position: relative;
}

.kchsi-account__chip {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--space--sm);
	min-height: var(--wp--custom--control--height-md);
	padding: var(--wp--custom--space--xs) var(--wp--custom--space--md) var(--wp--custom--space--xs) var(--wp--custom--space--xs);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--custom--color--bg--surface);
	font-weight: var(--wp--custom--weight--medium);
	list-style: none;
	cursor: pointer;
}

.kchsi-account__chip::-webkit-details-marker {
	display: none;
}

.kchsi-account__initial {
	display: grid;
	place-items: center;
	width: var(--wp--custom--spacing--8);
	height: var(--wp--custom--spacing--8);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--custom--color--bg--brand);
	color: var(--wp--custom--color--text--on-brand);
	font-weight: var(--wp--custom--weight--semibold);
}

.kchsi-account__list {
	position: absolute;
	top: calc(100% + var(--wp--custom--space--sm));
	right: 0;
	z-index: 20;
	min-width: 100%;
	margin: 0;
	padding: var(--wp--custom--space--xs);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--floating);
	list-style: none;
}

.kchsi-account__list a {
	display: block;
	padding: var(--wp--custom--space--sm) var(--wp--custom--space--md);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--custom--color--text--primary);
	white-space: nowrap;
	text-decoration: none;
}

.kchsi-account__list a:hover,
.kchsi-account__list a:focus-visible {
	background-color: var(--wp--custom--color--bg--subtle);
}

/*
 * Final test (Figma course-quiz, course-result, course-result-fail): one 720 column, no course
 * contents. Tutor's app layout for the attempt (fixed header and footer, absolutely placed
 * questions, full-viewport form) is undone so the page scrolls like the rest of the site.
 */
.single-tutor_quiz .kchsi-curriculum {
	display: none;
}

.single-tutor_quiz .tutor-learning-area.tutor-has-site-shell .tutor-learning-area-body {
	grid-template-columns: minmax(0, 1fr);
	max-width: calc(var(--wp--custom--layout--content-width) + 2 * var(--wp--custom--gutter));
	padding-block: var(--wp--custom--section-y);
}

.tutor-learning-area .tutor-quiz-submission.tutor-quiz-submission,
.tutor-learning-area .tutor-quiz-submission[data-question-layout-view] {
	gap: var(--wp--custom--space--xl);
	width: 100%;
	max-width: calc(var(--wp--custom--layout--content-width) + 2 * var(--wp--custom--gutter));
	height: auto;
	margin-inline: auto;
	padding: var(--wp--custom--section-y) var(--wp--custom--gutter);
	background-color: transparent;
}

.tutor-learning-area .tutor-quiz-submission .tutor-quiz-questions[data-question-layout-view] {
	position: static;
	inset: auto;
	gap: 0;
	max-width: none;
	max-height: none;
	height: auto;
	padding: 0;
	transform: none;
}

.tutor-learning-area .tutor-quiz-submission .tutor-quiz-question-wrapper {
	margin: 0;
}

.tutor-learning-area .tutor-quiz-submission[data-question-layout-view] .tutor-quiz-footer {
	position: static;
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--md);
	padding: 0;
	border: 0;
	background-color: transparent;
}

.kchsi-quiz,
.tutor-quiz-question.tutor-quiz-question {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xl);
}

.kchsi-quiz p,
.kchsi-question p {
	margin: 0;
}

.kchsi-quiz__icon {
	width: var(--wp--custom--spacing--16);
	height: var(--wp--custom--spacing--16);
}

.kchsi-quiz__icon::before {
	width: var(--wp--custom--spacing--8);
	height: var(--wp--custom--spacing--8);
}

.kchsi-quiz__copy,
.kchsi-question {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--sm);
}

.kchsi-quiz__eyebrow,
.kchsi-question__eyebrow {
	color: var(--wp--custom--color--text--brand);
}

.kchsi-quiz__title {
	margin: 0;
	font-size: var(--wp--custom--type--heading-2);
	line-height: var(--wp--custom--line-height--heading-2);
	letter-spacing: var(--wp--custom--tracking--heading-2);
}

.kchsi-question__title {
	margin: 0;
	font-size: var(--wp--custom--type--heading-3);
	line-height: var(--wp--custom--line-height--heading-3);
	letter-spacing: var(--wp--custom--tracking--heading-3);
}

.kchsi-quiz__text,
.kchsi-question__text {
	color: var(--wp--custom--color--text--secondary);
}

.kchsi-quiz__text > * {
	margin: 0;
}

.kchsi-quiz__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--custom--space--md);
}

.kchsi-quiz__actions form {
	margin: 0;
}

.kchsi-quiz__actions .wp-block-button__link {
	border: 0;
	font: inherit;
	font-weight: var(--wp--custom--weight--semibold);
	cursor: pointer;
}

.kchsi-quiz__actions .wp-block-button__link:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.kchsi-quiz__note {
	font-size: var(--wp--custom--font-size--14);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--muted);
}

/* Answer options (Figma Quiz/Option, state default | selected): the whole row is the target, one
   per line. Tutor lays choices out in 2 to 4 grid columns and pads the question like a card; the
   doubled classes outrank its [data-question=...] :has() rules. */
.tutor-learning-area .tutor-quiz-question.tutor-quiz-question[data-question] {
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

.tutor-learning-area .tutor-quiz-question[data-question] .tutor-quiz-question-options.tutor-quiz-question-options {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--md);
}

.tutor-quiz-question .tutor-quiz-question-option {
	display: block;
	margin: 0;
	padding: var(--wp--custom--space--md) var(--wp--custom--space--lg);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--control);
	background-color: var(--wp--custom--color--bg--surface);
	cursor: pointer;
	transition:
		background-color var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--ease--out),
		border-color var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--ease--out),
		box-shadow var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--ease--out);
}

.tutor-quiz-question .tutor-quiz-question-option:hover {
	border-color: var(--wp--custom--color--border--strong);
}

.tutor-quiz-question .tutor-quiz-question-option:focus-visible {
	outline: var(--wp--custom--border--width-strong) solid var(--wp--custom--color--border--focus);
	outline-offset: var(--wp--custom--border--width);
}

.tutor-quiz-question .tutor-quiz-question-option:has(input:checked) {
	border-color: var(--wp--custom--color--border--brand);
	background-color: var(--wp--custom--color--bg--brand-soft);
	box-shadow: var(--wp--preset--shadow--glow-soft-brand);
}

.tutor-quiz-question .tutor-quiz-question-option .tutor-input-wrapper {
	display: flex;
	align-items: center;
	gap: var(--wp--custom--space--md);
}

.tutor-quiz-question .tutor-quiz-question-option .tutor-label {
	margin: 0;
	color: var(--wp--custom--color--text--primary);
	font-size: var(--wp--custom--font-size--16);
	line-height: var(--wp--custom--line-height--body);
	cursor: pointer;
}

.tutor-quiz-question .tutor-quiz-question-option input[type="radio"] {
	appearance: none;
	flex: none;
	width: var(--wp--custom--spacing--5);
	height: var(--wp--custom--spacing--5);
	margin: 0;
	border: var(--wp--custom--border--width-strong) solid var(--wp--custom--color--border--strong);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--custom--color--bg--surface);
}

.tutor-quiz-question .tutor-quiz-question-option input[type="radio"]:checked {
	border: var(--wp--custom--spacing--1) solid var(--wp--custom--color--bg--brand);
	background-color: var(--wp--custom--color--text--primary);
}

.tutor-quiz-question .tutor-quiz-questions-error {
	margin-top: var(--wp--custom--space--sm);
	font-size: var(--wp--custom--font-size--14);
	color: var(--wp--custom--color--text--accent);
}

/* Lessons to review after a failed attempt (Figma course-result-fail: review). */
.kchsi-review {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--lg);
	padding: var(--wp--custom--space--xl);
	border: var(--wp--custom--border--width) solid var(--wp--custom--color--border--default);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--card);
}

.kchsi-review__head {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
}

.kchsi-review__title {
	margin: 0;
	font-family: var(--wp--custom--font--body);
	font-size: var(--wp--custom--type--heading-4);
	font-weight: var(--wp--custom--weight--heading-4);
	line-height: var(--wp--custom--line-height--heading-4);
	letter-spacing: var(--wp--custom--tracking--body);
}

.kchsi-review__meta {
	font-size: var(--wp--custom--font-size--14);
	color: var(--wp--custom--color--text--muted);
}

/* Certificate preview (Figma certificate/a4, landscape): brand logos, name, text, date. */
.kchsi-certificate {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--custom--space--sm);
	max-width: var(--wp--custom--layout--certificate);
	aspect-ratio: 297 / 210;
	padding: var(--wp--custom--space--xl);
	border: var(--wp--custom--border--width-strong) solid var(--wp--custom--color--border--brand);
	border-radius: var(--wp--custom--radius--media);
	background-color: var(--wp--custom--color--bg--surface);
	box-shadow: var(--wp--preset--shadow--card-hover);
	text-align: center;
}

.kchsi-certificate__brand {
	display: flex;
	justify-content: space-between;
	align-self: stretch;
	margin-bottom: auto;
	font-size: var(--wp--custom--font-size--12);
	font-weight: var(--wp--custom--weight--semibold);
}

.kchsi-certificate__logo {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--custom--space--xs);
}

.kchsi-certificate__logo .kchsi-logo__mark {
	margin: 0;
}

.kchsi-certificate__kicker {
	font-family: var(--wp--custom--font--heading);
	font-size: var(--wp--custom--type--heading-3);
	line-height: var(--wp--custom--line-height--heading-3);
}

.kchsi-certificate__line,
.kchsi-certificate__meta {
	font-size: var(--wp--custom--font-size--12);
	color: var(--wp--custom--color--text--muted);
}

.kchsi-certificate__name {
	font-family: var(--wp--custom--font--heading);
	font-size: var(--wp--custom--type--heading-4);
	color: var(--wp--custom--color--text--primary);
}

.kchsi-certificate__text {
	max-width: 42ch;
	margin-bottom: auto;
	font-size: var(--wp--custom--font-size--12);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--text--secondary);
}

@media (max-width: 767px) {
	.kchsi-certificate {
		aspect-ratio: auto;
		padding: var(--wp--custom--space--lg);
	}

	.kchsi-review {
		padding: var(--wp--custom--space--lg);
	}

	.kchsi-quiz__actions .wp-block-button,
	.kchsi-quiz__actions form,
	.kchsi-quiz__actions .wp-block-button__link {
		width: 100%;
	}
}
