/*
 * Buying a licence: checkout, payment and "thank you".
 *
 * One focused screen, not a shop page: no site header or footer, the order on
 * a dark half with each licence drawn as a card, the form on a light half.
 * Markup: templates/purchase.php, inc/checkout.php and woocommerce/checkout.
 * Colours and radii come from the parent theme's tokens.
 */

.cr-purchase {
	--cr-dark: var(--dl-color-secondary, #351322);
	--cr-ink: #fff;
	--cr-ink-muted: rgb(255 255 255 / 70%);
	--cr-ink-line: rgb(255 255 255 / 15%);
	--cr-ok: #0f9d6c;
	--cr-ok-ink: #0b7a55; /* The same green for small text: 5.3:1 on white. */
	--cr-gutter: clamp(1.25rem, 4vw, 2.5rem);
	--cr-desk-width: 74rem;
	--cr-bar-height: 4.75rem;
	--cr-split-gap: clamp(1.5rem, 4.5vw, 4.5rem);

	margin: 0;
	background: var(--dl-color-base, #fff);
}

/* ---------- The screen -------------------------------------------------- */
.cr-shell {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
	overflow-x: clip;
}

.cr-shell__main,
.cr-shell__main > .woocommerce {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
}

/* The bar floats over the top of both halves. */
.cr-bar {
	position: absolute;
	z-index: 5;
	inset: 0 0 auto;
}

.cr-bar__inner {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: var(--cr-desk-width);
	height: var(--cr-bar-height);
	margin-inline: auto;
	padding-inline: var(--cr-gutter);
}

.cr-bar__brand {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	color: var(--dl-color-contrast);
}

.cr-bar__back {
	display: inline-flex;
	flex: 0 0 2.25rem;
	align-items: center;
	justify-content: center;
	height: 2.25rem;
	border-radius: 50%;
	background: color-mix(in oklab, currentcolor 10%, transparent);
	color: inherit;
	transition: background var(--dl-duration, 200ms) var(--dl-ease, ease), transform var(--dl-duration, 200ms) var(--dl-ease, ease);
}

.cr-bar__back:hover {
	background: color-mix(in oklab, currentcolor 20%, transparent);
	color: inherit;
	transform: translateX(-2px);
}

.cr-bar .custom-logo-link {
	display: block;
	line-height: 0;
}

.cr-bar .custom-logo-link img {
	display: block;
	width: auto;
	max-width: none;
	height: 34px;
}

.cr-bar__name {
	color: inherit;
	font-weight: var(--dl-weight-bold, 700);
	text-decoration: none;
}

.cr-bar__aside {
	display: flex;
	gap: 1.25rem;
	align-items: center;
	max-width: none;
	margin: 0;
	color: var(--dl-color-text-muted);
	font-size: 0.8125rem;
}

.cr-bar__secure {
	display: inline-flex;
	gap: 0.375rem;
	align-items: center;
	color: var(--cr-ok-ink);
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-bar__help {
	color: inherit;
	text-decoration: none;
}

.cr-bar__help:hover {
	color: var(--dl-color-brand-strong);
}

/* On the dark half the brand is white. */
.cr-shell--split .cr-bar__brand {
	color: var(--cr-ink);
}

.cr-shell--split .cr-bar .custom-logo-link img {
	filter: brightness(0) invert(1);
}

/* ---------- Two halves -------------------------------------------------- */
.cr-desk {
	display: grid;
	flex: 1 0 auto;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	width: 100%;
	max-width: var(--cr-desk-width);
	margin-inline: auto;
	padding-inline: var(--cr-gutter);
}

.cr-desk__aside {
	position: relative;
	isolation: isolate;
	min-width: 0;
	padding: calc(var(--cr-bar-height) + 1.5rem) var(--cr-split-gap) 3rem 0;
	color: var(--cr-ink);
}

/* The dark runs to the edge of the window, whatever the width of the page. */
.cr-desk__aside::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0 0 0 -100vw;
	background:
		radial-gradient(46rem 30rem at 100% 0, rgb(192 38 109 / 36%), transparent 64%),
		radial-gradient(34rem 26rem at calc(100% - 26rem) 100%, rgb(232 90 152 / 14%), transparent 62%),
		linear-gradient(180deg, color-mix(in oklab, var(--cr-dark) 92%, #fff), color-mix(in oklab, var(--cr-dark) 82%, #000));
}

.cr-desk__sticky {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
}

.cr-desk__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: calc(var(--cr-bar-height) + 1.5rem) 0 1.75rem var(--cr-split-gap);
}

.cr-purchase .cr-desk__eyebrow,
.cr-purchase #order_review_heading {
	float: none;
	width: auto;
	margin: 0 0 1rem;
	padding: 0;
	border-radius: 0;
	background: none;
	color: var(--cr-ink-muted);
	font-size: 0.75rem;
	font-weight: var(--dl-weight-bold, 700);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cr-desk__head {
	margin-bottom: 2.25rem;
}

.cr-purchase .cr-desk__title {
	margin: 0;
	color: var(--dl-color-contrast);
	font-size: clamp(1.875rem, 3.4vw, 2.625rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
}

.cr-desk__lead {
	max-width: 34rem;
	margin: 0.75rem 0 0;
	color: var(--dl-color-text-muted);
}

.cr-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.125rem;
	max-width: none;
	margin: auto 0 0;
	padding-top: 2.75rem;
	color: var(--dl-color-text-muted);
	font-size: 0.75rem;
}

.cr-legal a {
	color: inherit;
	text-decoration: none;
}

.cr-legal a:hover {
	color: var(--dl-color-brand-strong);
	text-decoration: underline;
}

@media (width < 900px) {
	.cr-desk {
		grid-template-columns: minmax(0, 1fr);
		padding-inline: 0;
	}

	.cr-desk__aside {
		padding: calc(var(--cr-bar-height) + 0.5rem) var(--cr-gutter) 2rem;
	}

	.cr-desk__aside::before {
		inset: 0;
	}

	.cr-desk__sticky {
		position: static;
	}

	.cr-desk__body {
		padding: 2rem var(--cr-gutter) 1.5rem;
	}

	/* The whole bar is over the dark half. */
	.cr-shell--split .cr-bar .cr-currency {
		--cr-currency-track: rgb(255 255 255 / 12%);
		--cr-currency-ink: rgb(255 255 255 / 75%);
	}

	.cr-shell--split .cr-bar__aside {
		color: var(--cr-ink-muted);
	}

	.cr-shell--split .cr-bar__secure {
		color: #7ee2bd;
	}

	.cr-shell--split .cr-bar__help:hover {
		color: var(--cr-ink);
	}

	/* The line under the pay button says it on small screens. */
	.cr-desk__aside .cr-assure {
		display: none;
	}
}

@media (width < 480px) {
	.cr-bar__help {
		display: none;
	}

	.cr-bar__aside {
		gap: 0.75rem;
	}
}

/* Undo the floats and panels of the stock two-column checkout. */
.cr-purchase form.checkout::after {
	content: none;
}

.cr-purchase #customer_details,
.cr-purchase #order_review {
	float: none;
	clear: none;
	width: auto;
	margin: 0;
	padding: 0;
	border-radius: 0;
	background: none;
}

/* ---------- The licence card ------------------------------------------- */
.cr-lines {
	display: grid;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cr-licence {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 1.375rem 1.5rem 1.375rem;
	border-radius: 1.25rem;
	/* The light end is the lightest raspberry that still takes white text at 4.5:1. */
	background: linear-gradient(135deg, #d2367a 0%, var(--dl-color-brand, #c0266d) 44%, #86194d 100%);
	color: #fff;
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 30%),
		0 30px 60px -30px rgb(0 0 0 / 75%),
		0 16px 30px -20px rgb(192 38 109 / 70%);
}

/* The CraftRoq mark, pressed into the corner. */
.cr-licence__mark {
	position: absolute;
	z-index: -1;
	right: -1.25rem;
	bottom: -1.5rem;
	width: 12.5rem;
	fill: rgb(255 255 255 / 9%);
	transform: rotate(-8deg);
}

/* A light passes over the card when it is drawn or redrawn. */
.cr-licence::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(105deg, transparent 36%, rgb(255 255 255 / 24%) 50%, transparent 64%);
	transform: translateX(-120%);
	animation: cr-sheen 1.1s 0.15s ease-out both;
	pointer-events: none;
}

@keyframes cr-sheen {
	to {
		transform: translateX(120%);
	}
}

.cr-licence__top {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.cr-licence__icon img {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.75rem;
	background: #fff;
	object-fit: cover;
	box-shadow: 0 6px 14px -8px rgb(0 0 0 / 60%);
}

.cr-licence__name {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: var(--dl-weight-semibold, 600);
	line-height: 1.25;
}

.cr-licence__status {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 0.3rem;
	align-items: center;
	padding: 0.25rem 0.625rem;
	border: 1px solid rgb(255 255 255 / 40%);
	border-radius: 999px;
	background: rgb(255 255 255 / 14%);
	font-size: 0.6875rem;
	font-weight: var(--dl-weight-bold, 700);
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
	white-space: nowrap;
}

.cr-licence--active .cr-licence__status {
	border-color: #fff;
	background: #fff;
	color: var(--cr-ok-ink);
}

.cr-licence__key {
	display: flex;
	gap: 0.875rem;
	max-width: none;
	margin: 1.5rem 0 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.25rem;
	letter-spacing: 0.16em;
	line-height: 1;
}

.cr-licence__note {
	max-width: none;
	margin: 0.5rem 0 0;
	color: rgb(255 255 255 / 92%);
	font-size: 0.75rem;
	overflow-wrap: anywhere;
}

.cr-licence__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	margin: 1.25rem 0 0;
}

.cr-licence__fields dt {
	color: rgb(255 255 255 / 92%);
	font-size: 0.625rem;
	font-weight: var(--dl-weight-semibold, 600);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cr-licence__fields dd {
	margin: 0.125rem 0 0;
	font-size: 0.9375rem;
	font-weight: var(--dl-weight-semibold, 600);
	overflow-wrap: anywhere;
}

.cr-licence__fields dd.is-empty {
	color: rgb(255 255 255 / 85%);
	font-weight: var(--dl-weight-regular, 400);
}

/* A free plugin has no key, and a failed, cancelled or refunded order has no
   licence: a quiet card. */
.cr-licence--free,
.cr-licence--off {
	border: 1px solid var(--cr-ink-line);
	background: linear-gradient(135deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 5%));
	box-shadow: none;
}

.cr-licence--off .cr-licence__key {
	opacity: 0.4;
}

.cr-licence--off::after {
	content: none;
}

@media (prefers-reduced-motion: reduce) {
	.cr-licence::after {
		animation: none;
	}
}

/* Extra facts a plugin adds to a line, e.g. "Renewal of your existing licence". */
.cr-line .variation {
	margin: 0.625rem 0 0;
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
}

.cr-line .variation dt,
.cr-line .variation dd {
	display: inline;
	float: none;
	margin: 0;
}

.cr-line .variation dd p {
	display: inline;
	margin: 0;
}

.cr-line__row {
	position: relative;
	display: flex;
	gap: 1rem;
	align-items: baseline;
	justify-content: space-between;
	max-width: none;
	margin: 0.75rem 0 0;
}

.cr-line__price {
	font-size: 1.0625rem;
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-line__period {
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
	font-weight: var(--dl-weight-regular, 400);
}

.cr-line__remove {
	margin-inline-start: auto;
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
}

.cr-line__remove:hover {
	color: var(--cr-ink);
}

/* Plan switch: the plans of the same plugin, side by side. */
.cr-plan-switch {
	/* Above the shadow the card casts. */
	position: relative;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr));
	gap: 0.5rem;
	margin-top: 0.875rem;
	transition: opacity var(--dl-duration, 200ms) var(--dl-ease, ease);
}

.cr-plan-switch.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

.cr-plan-switch__option {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.5625rem 0.75rem;
	border: 1.5px solid var(--cr-ink-line);
	border-radius: var(--dl-radius-md, 0.75rem);
	color: var(--cr-ink);
	line-height: 1.3;
	text-decoration: none;
	transition: border-color var(--dl-duration, 200ms) var(--dl-ease, ease), background var(--dl-duration, 200ms) var(--dl-ease, ease), transform var(--dl-duration-fast, 120ms) var(--dl-ease, ease);
}

a.cr-plan-switch__option:hover {
	border-color: rgb(255 255 255 / 55%);
	background: rgb(255 255 255 / 8%);
	color: var(--cr-ink);
	transform: translateY(-1px);
}

.cr-plan-switch__option.is-current {
	border-color: #fff;
	background: #fff;
	color: var(--cr-dark);
}

.cr-plan-switch__label {
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-plan-switch__price {
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
}

.cr-plan-switch__option.is-current .cr-plan-switch__price {
	color: color-mix(in oklab, var(--cr-dark) 70%, #fff);
}

/* ---------- Totals, coupon, receipt ------------------------------------ */
.cr-purchase table.cr-totals {
	width: 100%;
	margin: 1.5rem 0 0;
	border: 0;
	border-radius: 0;
	border-collapse: collapse;
	background: none;
}

.cr-purchase table.cr-totals th,
.cr-purchase table.cr-totals td {
	padding: 0.5rem 0;
	border: 0;
	background: none;
	color: var(--cr-ink-muted);
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-regular, 400);
	text-align: start;
	vertical-align: baseline;
}

.cr-purchase table.cr-totals td {
	color: var(--cr-ink);
	text-align: end;
}

.cr-purchase table.cr-totals .order-total th,
.cr-purchase table.cr-totals .order-total td {
	padding-top: 1rem;
	border-top: 1px solid var(--cr-ink-line);
	color: var(--cr-ink);
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-purchase table.cr-totals .order-total td {
	font-size: clamp(1.625rem, 3vw, 2rem);
	font-weight: var(--dl-weight-bold, 700);
	line-height: 1.1;
}

.cr-purchase table.cr-totals .woocommerce-remove-coupon {
	margin-inline-start: 0.375rem;
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
}

/* While WooCommerce refreshes the order. */
.cr-desk__aside .blockUI.blockOverlay {
	border-radius: var(--dl-radius-md, 0.75rem);
	background: color-mix(in oklab, var(--cr-dark) 88%, #000) !important;
}

/* Coupon: a quiet link that opens a field. */
.cr-coupon {
	margin-top: 0.75rem;
	font-size: var(--dl-text-sm, 0.875rem);
}

.cr-coupon .woocommerce-form-coupon-toggle .woocommerce-info {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--cr-ink-muted);
}

.cr-coupon .woocommerce-form-coupon-toggle .woocommerce-info::before {
	content: none;
}

.cr-coupon .showcoupon {
	color: var(--cr-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cr-coupon form.checkout_coupon {
	display: flex;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
	padding: 0;
	border: 0;
}

.cr-coupon form.checkout_coupon > p:not(.form-row),
.cr-coupon form.checkout_coupon .clear {
	display: none;
}

.cr-coupon form.checkout_coupon .form-row {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

.cr-coupon form.checkout_coupon .form-row-first {
	flex: 1 1 auto;
}

.cr-purchase .cr-coupon input.input-text {
	width: 100%;
	min-width: 0;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--cr-ink-line);
	border-radius: var(--dl-radius-md, 0.75rem);
	background: rgb(255 255 255 / 8%);
	color: var(--cr-ink);
}

.cr-purchase .cr-coupon input.input-text::placeholder {
	color: var(--cr-ink-muted);
}

.cr-purchase .cr-coupon button.button {
	padding: 0.625rem 1rem;
	border-color: rgb(255 255 255 / 45%);
	background: transparent;
	color: var(--cr-ink);
}

.cr-purchase .cr-coupon button.button:hover {
	background: rgb(255 255 255 / 12%);
}

/* A coupon's answer ("applied", "does not exist") lands beside the form. */
.cr-desk__aside .woocommerce-message,
.cr-desk__aside .woocommerce-error,
.cr-desk__aside .coupon-error-notice {
	margin: 0.75rem 0 0;
	padding: 0.625rem 0.875rem;
	border: 0;
	border-radius: var(--dl-radius-md, 0.75rem);
	background: rgb(255 255 255 / 10%);
	color: var(--cr-ink);
	font-size: 0.8125rem;
	list-style: none;
}

.cr-desk__aside .woocommerce-message::before,
.cr-desk__aside .woocommerce-error::before {
	content: none;
}

/* The receipt of an order that has been placed. */
.cr-receipt {
	display: grid;
	gap: 0.5rem;
	margin: 1.5rem 0 0;
}

.cr-receipt > div {
	display: flex;
	gap: 1rem;
	align-items: baseline;
	justify-content: space-between;
}

.cr-receipt dt {
	color: var(--cr-ink-muted);
	font-size: var(--dl-text-sm, 0.875rem);
}

.cr-receipt dd {
	margin: 0;
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-semibold, 600);
	text-align: end;
	overflow-wrap: anywhere;
}

.cr-receipt .cr-receipt__total {
	margin-top: 0.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--cr-ink-line);
}

.cr-receipt .cr-receipt__total dt {
	color: var(--cr-ink);
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-receipt .cr-receipt__total dd {
	font-size: clamp(1.625rem, 3vw, 2rem);
	font-weight: var(--dl-weight-bold, 700);
	line-height: 1.1;
}

/* What every purchase includes. */
.cr-assure {
	display: grid;
	gap: 0.75rem;
	margin: 1.75rem 0 0;
	padding: 1.5rem 0 0;
	border-top: 1px solid var(--cr-ink-line);
	list-style: none;
}

.cr-assure__item {
	display: flex;
	gap: 0.625rem;
	color: var(--cr-ink-muted);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.cr-assure__item strong {
	display: block;
	color: var(--cr-ink);
	font-weight: var(--dl-weight-semibold, 600);
}

.cr-assure__icon {
	flex: 0 0 auto;
	margin-top: 0.125rem;
	color: color-mix(in oklab, var(--dl-color-accent, #e85a98) 80%, #fff);
}

/* ---------- Steps on the light half ------------------------------------ */
.cr-steps {
	display: grid;
	gap: 2.25rem;
}

.cr-step {
	position: relative;
	padding-inline-start: 3.25rem;
}

/* The line that joins a step to the next. */
.cr-step:not(:last-child)::before {
	content: "";
	position: absolute;
	top: 2.75rem;
	bottom: -1.75rem;
	left: calc(1.125rem - 1px);
	width: 2px;
	border-radius: 1px;
	background: var(--dl-color-border);
}

.cr-step__num {
	position: absolute;
	top: 0;
	left: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--dl-color-brand-soft);
	color: var(--dl-color-brand-strong);
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-bold, 700);
}

.cr-step__head {
	min-height: 2.25rem;
	margin-bottom: 1.25rem;
}

.cr-purchase .cr-step__title {
	margin: 0;
	padding-top: 0.25rem;
	font-size: 1.25rem;
	line-height: 1.3;
}

.cr-step__text {
	max-width: none;
	margin: 0.125rem 0 0;
	color: var(--dl-color-text-muted);
	font-size: var(--dl-text-sm, 0.875rem);
}

@media (width < 560px) {
	/* The fields get the full width; only the heading keeps its number. */
	.cr-step {
		padding-inline-start: 0;
	}

	.cr-step:not(:last-child)::before {
		content: none;
	}

	.cr-step__head {
		padding-inline-start: 3rem;
	}
}

/* The section has its own heading. */
.cr-step .woocommerce-billing-fields > h3,
.cr-step .woocommerce-additional-fields > h3 {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.cr-step .woocommerce-billing-fields__field-wrapper,
.cr-step .woocommerce-shipping-fields__field-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.cr-purchase .cr-step .form-row {
	grid-column: 1 / -1;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

.cr-purchase .cr-step .form-row-first {
	grid-column: 1;
}

.cr-purchase .cr-step .form-row-last {
	grid-column: 2;
}

@media (width < 480px) {
	.cr-purchase .cr-step .form-row-first,
	.cr-purchase .cr-step .form-row-last {
		grid-column: 1 / -1;
	}
}

.cr-purchase .cr-step .form-row input.input-text,
.cr-purchase .cr-step .form-row select {
	padding: 0.875rem 1rem;
	border-radius: 0.875rem;
	background: color-mix(in oklab, var(--dl-color-brand-soft) 35%, var(--dl-color-base, #fff));
	transition: border-color var(--dl-duration, 200ms) var(--dl-ease, ease), background var(--dl-duration, 200ms) var(--dl-ease, ease), box-shadow var(--dl-duration, 200ms) var(--dl-ease, ease);
}

.cr-purchase .cr-step .form-row input.input-text:focus,
.cr-purchase .cr-step .form-row select:focus {
	background: var(--dl-color-base, #fff);
}

/* The country list, drawn like the other fields. */
.cr-purchase .cr-step .form-row .select2-container .select2-selection--single {
	height: auto;
	padding: 0.6rem 0.5rem;
	border-radius: 0.875rem;
	background: color-mix(in oklab, var(--dl-color-brand-soft) 35%, var(--dl-color-base, #fff));
}

.cr-purchase .cr-step .form-row .select2-container--open .select2-selection--single,
.cr-purchase .cr-step .form-row .select2-container--focus .select2-selection--single {
	border-color: var(--dl-color-brand);
	background: var(--dl-color-base, #fff);
	box-shadow: 0 0 0 3px var(--dl-color-brand-soft);
}

.cr-step .woocommerce-account-fields,
.cr-step .woocommerce-additional-fields {
	margin-top: 1rem;
}

/* Payment methods as cards. */
.cr-purchase #payment {
	border-radius: 0;
	background: none;
}

.cr-purchase #payment ul.payment_methods {
	display: grid;
	gap: 0.625rem;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}

.cr-purchase #payment ul.payment_methods > li {
	margin: 0;
	padding: 0.875rem 1rem;
	border: 1.5px solid var(--dl-color-border-strong, #d4d4d8);
	border-radius: 0.875rem;
	background: var(--dl-color-base);
	transition: border-color var(--dl-duration, 200ms) var(--dl-ease, ease), background var(--dl-duration, 200ms) var(--dl-ease, ease);
}

.cr-purchase #payment ul.payment_methods > li:has(input:checked) {
	border-color: var(--dl-color-brand);
	background: var(--dl-color-brand-soft);
	box-shadow: inset 0 0 0 1px var(--dl-color-brand);
}

.cr-purchase #payment ul.payment_methods > li > input[type="radio"] {
	width: 1.125rem;
	height: 1.125rem;
	margin: 0 0.625rem 0 0;
	accent-color: var(--dl-color-brand);
	vertical-align: -0.2em;
}

.cr-purchase #payment ul.payment_methods > li > label {
	display: inline;
	margin: 0;
	color: var(--dl-color-contrast);
	font-size: var(--dl-text-base, 1rem);
	font-weight: var(--dl-weight-semibold, 600);
	cursor: pointer;
}

.cr-purchase #payment ul.payment_methods > li > label img {
	max-height: 1.5rem;
	margin-inline-start: 0.5rem;
	vertical-align: middle;
}

.cr-purchase #payment div.payment_box {
	margin: 0.625rem 0 0;
	padding: 0;
	border-radius: 0;
	background: none;
	color: var(--dl-color-text-muted);
	font-size: var(--dl-text-sm, 0.875rem);
}

.cr-purchase #payment div.payment_box::before {
	content: none;
}

.cr-purchase #payment div.payment_box p:last-child {
	margin-bottom: 0;
}

/* "No payment methods available" is a notice, not a method: no card around it. */
.cr-purchase #payment ul.payment_methods > li:has(> .woocommerce-info, > .woocommerce-notice, > .wc-block-components-notice-banner) {
	padding: 0;
	border: 0;
	background: none;
}

.cr-purchase #payment ul.payment_methods > li > .woocommerce-info {
	margin: 0;
}

.cr-purchase #payment div.place-order {
	float: none;
	width: auto;
	margin: 1.5rem 0 0;
	padding: 0;
}

.cr-purchase #payment .woocommerce-terms-and-conditions-wrapper {
	margin-bottom: 1rem;
}

.cr-purchase #payment .woocommerce-terms-and-conditions-wrapper .form-row {
	margin: 0;
	padding: 0;
}

.cr-purchase #payment .woocommerce-form__label-for-checkbox {
	display: block;
	color: var(--dl-color-text);
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-regular, 400);
}

.cr-purchase #payment .woocommerce-form__label-for-checkbox input {
	margin: 0 0.5rem 0 0;
	accent-color: var(--dl-color-brand);
	vertical-align: -0.1em;
}

.cr-purchase #payment .woocommerce-privacy-policy-text,
.cr-purchase #payment .woocommerce-terms-and-conditions-wrapper {
	padding: 0;
	color: var(--dl-color-text-muted);
	font-size: 0.8125rem;
}

.cr-purchase #payment .woocommerce-privacy-policy-text p {
	margin: 0 0 1rem;
}

/* The button: the whole width, a lock, and the amount. */
.cr-purchase #payment #place_order {
	gap: 0.625rem;
	width: 100%;
	padding: 1.15rem 1.5rem;
	background: linear-gradient(135deg, #d93a80, var(--dl-color-brand-strong, #c0266d) 60%, #9d1d59);
	font-size: 1.0625rem;
	box-shadow: 0 14px 28px -14px color-mix(in oklab, var(--dl-color-brand) 85%, #000);
}

.cr-purchase #payment #place_order::before {
	content: "";
	flex: 0 0 1.05rem;
	height: 1.05rem;
	background: currentcolor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cr-purchase #payment #place_order:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
}

.cr-pay-note {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	justify-content: center;
	max-width: none;
	margin: 0.875rem 0 0;
	color: var(--dl-color-text-muted);
	font-size: 0.8125rem;
	text-align: center;
}

.cr-pay-note svg {
	flex: 0 0 auto;
	color: var(--cr-ok);
}

/* "Returning customer?" before the form. */
.cr-desk__body .woocommerce-form-login-toggle .woocommerce-info {
	margin: 0 0 1.5rem;
}

/* The payment provider's own step (its button or form). */
.cr-receipt-step__provider {
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border: 1px solid var(--dl-color-border);
	border-radius: var(--dl-radius-lg, 1rem);
}

.cr-receipt-step__provider > :first-child {
	margin-top: 0;
}

.cr-receipt-step__provider > :last-child {
	margin-bottom: 0;
}

.cr-receipt-step__provider button,
.cr-receipt-step__provider input[type="submit"],
.cr-receipt-step__provider a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 0.5rem 0.5rem 0;
	padding: 0.9rem 1.75rem;
	border: 2px solid var(--dl-color-border-strong, #d4d4d8);
	border-radius: var(--dl-radius-pill, 999px);
	background: transparent;
	color: var(--dl-color-contrast);
	font: inherit;
	font-weight: var(--dl-weight-semibold, 600);
	text-decoration: none;
	cursor: pointer;
}

.cr-receipt-step__provider button:first-of-type,
.cr-receipt-step__provider input[type="submit"]:first-of-type {
	border-color: transparent;
	background: var(--dl-color-brand-strong);
	color: #fff;
}

/* ---------- Notices ----------------------------------------------------- */
/* Printed above the two halves by WooCommerce: they float in the corner. */
.cr-shell--split .cr-shell__main > .woocommerce > .woocommerce-notices-wrapper {
	position: fixed;
	z-index: 60;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--cr-bar-height));
	right: var(--cr-gutter);
	display: grid;
	gap: 0.5rem;
	width: min(26rem, 100vw - 2 * var(--cr-gutter));
}

.cr-shell--split .cr-shell__main > .woocommerce > .woocommerce-notices-wrapper > * {
	margin: 0;
	border-radius: var(--dl-radius-md, 0.75rem);
	background: var(--dl-color-base, #fff);
	box-shadow: 0 20px 40px -18px rgb(53 19 34 / 45%), 0 0 0 1px var(--dl-color-border);
	outline: 0;
	cursor: pointer;
	animation: cr-toast 0.35s ease-out both;
}

@keyframes cr-toast {
	from {
		opacity: 0;
		transform: translateY(-0.5rem);
	}
}

.cr-desk__body .woocommerce-NoticeGroup {
	margin-bottom: 1.5rem;
}

/* ---------- Order received --------------------------------------------- */
.cr-thanks__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.75rem;
	height: 3.75rem;
	margin-bottom: 1.25rem;
	border-radius: 50%;
	background: color-mix(in oklab, var(--cr-ok) 14%, transparent);
	color: var(--cr-ok);
}

.cr-thanks__badge.is-waiting {
	background: color-mix(in oklab, #d97706 16%, transparent);
	color: #b45309;
}

.cr-thanks__badge.is-failed {
	background: color-mix(in oklab, var(--dl-color-error, #d63031) 14%, transparent);
	color: var(--dl-color-error, #d63031);
}

/* The tick draws itself. */
.cr-thanks__tick {
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	animation: cr-tick 0.5s 0.25s ease-out forwards;
}

@keyframes cr-tick {
	to {
		stroke-dashoffset: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cr-thanks__tick {
		stroke-dashoffset: 0;
		animation: none;
	}
}

.cr-empty__actions,
.cr-thanks__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	max-width: none;
	margin: 0;
}

/* What happens next: a numbered line down the side. */
.cr-purchase .cr-next__title,
.cr-purchase .woocommerce-order-details__title,
.cr-purchase .woocommerce-order-downloads__title,
.cr-purchase .woocommerce-column__title {
	margin: 0 0 1.25rem;
	font-size: 1.25rem;
}

.cr-next__steps {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: cr-next;
}

.cr-next__step {
	position: relative;
	padding: 0 0 1.5rem 3.25rem;
	counter-increment: cr-next;
}

.cr-next__step::before {
	content: counter(cr-next);
	position: absolute;
	top: 0;
	left: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--dl-color-brand-soft);
	color: var(--dl-color-brand-strong);
	font-weight: var(--dl-weight-bold, 700);
}

.cr-next__step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 2.5rem;
	bottom: 0.25rem;
	left: calc(1.125rem - 1px);
	width: 2px;
	border-radius: 1px;
	background: var(--dl-color-border);
}

.cr-purchase .cr-next__step h3 {
	margin: 0;
	padding-top: 0.3rem;
	font-size: var(--dl-text-lg, 1.125rem);
}

.cr-next__step p {
	max-width: 34rem;
	margin: 0.25rem 0 0;
	color: var(--dl-color-text-muted);
}

.cr-next__downloads {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem !important;
}

.cr-next__downloads .button svg {
	margin-inline-end: 0.5rem;
}

/* Step 3 says the same, with the link. */
.cr-thanks .craftroq-license-note {
	display: none;
}

/* Bank details and the like, from the payment method. */
.cr-thanks .woocommerce-bacs-bank-details,
.cr-thanks .woocommerce-order-downloads,
.cr-thanks .woocommerce-customer-details {
	margin-bottom: 2rem;
}

/* ---------- Without the two halves: empty cart, messages ---------------- */
.cr-shell--plain {
	background:
		radial-gradient(60rem 30rem at 50% -10%, color-mix(in oklab, var(--dl-color-brand) 16%, transparent), transparent 70%),
		var(--dl-color-brand-soft);
}

.cr-shell--plain .cr-shell__main {
	justify-content: center;
	padding: calc(var(--cr-bar-height) + 1rem) var(--cr-gutter) 2rem;
}

.cr-shell--plain .cr-shell__main > .woocommerce {
	flex: 0 0 auto;
	width: 100%;
	max-width: 34rem;
	margin-inline: auto;
	padding: clamp(1.5rem, 5vw, 3rem);
	border-radius: 1.5rem;
	background: var(--dl-color-base, #fff);
	box-shadow: 0 30px 60px -34px rgb(53 19 34 / 40%);
}

.cr-shell--plain .cr-shell__main > .woocommerce > :last-child,
.cr-shell--plain .cr-shell__main > .woocommerce > .woocommerce-notices-wrapper:last-child > :last-child {
	margin-bottom: 0;
}

.cr-shell__foot {
	padding: 0 var(--cr-gutter) 1.5rem;
}

.cr-shell__foot .cr-legal {
	justify-content: center;
	margin: 0;
	padding: 0;
}

.cr-empty {
	text-align: center;
}

.cr-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	background: var(--dl-color-brand-soft);
	color: var(--dl-color-brand-strong);
}

.cr-purchase .cr-empty__title {
	margin: 1rem 0 0.375rem;
	font-size: clamp(1.5rem, 4vw, 1.875rem);
	line-height: 1.15;
}

.cr-empty__text {
	max-width: none;
	margin: 0 0 1.5rem;
	color: var(--dl-color-text-muted);
}

.cr-empty__actions {
	justify-content: center;
}

.cr-empty__items {
	display: grid;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
	text-align: start;
}

.cr-empty__items li {
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	border: 1px solid var(--dl-color-border);
	border-radius: var(--dl-radius-md, 0.75rem);
}
