/*
 * CR12 components (brief 2.15): the interim forms, the resource cards, the speaking events band, the
 * Batch 4 blocks and the exit-intent popup. Enqueued only on a page where one of them renders, so
 * main.css and warm.css stay byte-identical and no other page changes. The form base styles are
 * main.css section 11's (unchanged); this file adds what the engine needs on top.
 */

/* Anything the scripts hide stays hidden, whatever the component's own display. */
.jd-forms [hidden],
.jd-popup[hidden],
.jd-popup [hidden] {
	display: none !important;
}

/* Forms ------------------------------------------------------------------------------------------- */

.jd-field--group {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.jd-field--group > .jd-field__label {
	padding: 0;
	margin-bottom: 6px;
}
.jd-field__optional {
	color: var(--jd-meta);
}
.jd-ground-blue .jd-field__optional {
	color: inherit;
}
.jd-options {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.jd-option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	padding: 10px 0;
}
.jd-option .jd-check {
	margin-top: 1px;
}
.jd-option__label {
	font-size: 17px;
	line-height: 1.4;
	color: var(--jd-ink);
	cursor: pointer;
}
.jd-ground-blue .jd-option__label {
	color: var(--jd-on-blue);
}
.jd-check:focus-visible {
	outline: 2px solid var(--jd-focus);
	outline-offset: 2px;
}
.jd-form__step {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.jd-form__step-title {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--jd-meta);
}
.jd-form__step-title:focus-visible {
	outline: 2px solid var(--jd-focus);
	outline-offset: 4px;
}
.jd-form__step-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.jd-form__status:empty {
	display: none;
}
.jd-form__status {
	font-size: 16px;
	line-height: 1.5;
	color: var(--jd-heading);
}
.jd-form__fallback {
	margin-top: 16px;
}
.jd-form-success__next {
	margin-top: 12px;
	font-family: var(--jd-sans);
	font-size: 17px;
}
.jd-form__submit:disabled {
	opacity: 0.8;
	cursor: progress;
}

/* /free-resources/ cards -------------------------------------------------------------------------- */

.jd-resources__group {
	margin-top: 40px;
}
.jd-resources__group:first-child {
	margin-top: 0;
}
.jd-resources__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}
.jd-resource-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 24px;
	border: 1px solid var(--jd-line);
	background: var(--jd-paper);
}
.jd-resource-card__cover {
	width: 100%;
	height: auto;
}
.jd-resource-card__title {
	font-size: 22px;
	line-height: 1.3;
	color: var(--jd-heading);
}
.jd-resource-card__action {
	margin-top: auto;
}

/* The speaking events band: a static grouped list, text only (R48). ------------------------------- */

.jd-events-list__sets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 32px;
	margin-top: 32px;
}
.jd-events-list__heading {
	font-size: 20px;
	line-height: 1.3;
	color: var(--jd-heading);
}
.jd-events-list__label {
	margin-top: 20px;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--jd-meta);
}
.jd-events-list__items {
	margin: 8px 0 0;
	padding-left: 1.2em;
}
.jd-events-list__item {
	padding: 4px 0;
	font-size: 17px;
	line-height: 1.45;
}

/* Batch 4 ------------------------------------------------------------------------------------------ */

.jd-programme__label {
	margin-top: 20px;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--jd-meta);
}
.jd-programme__includes {
	padding-left: 1.2em;
}
.jd-programme__price {
	font-size: 22px;
	color: var(--jd-heading);
}

/* The exit-intent popup (R44.2) --------------------------------------------------------------------- */

.jd-popup {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.jd-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 32, 0.6);
}
.jd-popup__dialog {
	position: relative;
	width: min(560px, 100%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: clamp(24px, 4vw, 40px);
	background: var(--jd-paper);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.jd-popup__heading {
	font-family: var(--jd-serif);
	font-size: 28px;
	line-height: 1.25;
	color: var(--jd-heading);
}
.jd-popup__heading:focus-visible {
	outline: 2px solid var(--jd-focus);
	outline-offset: 4px;
}
.jd-popup__close {
	min-height: 44px;
}
@media (prefers-reduced-motion: no-preference) {
	.jd-popup:not([hidden]) .jd-popup__dialog {
		animation: jd-popup-in 160ms ease-out;
	}
}
@keyframes jd-popup-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
