/**
 * Academy course pages: membership popup (includes/membership-popup.php)
 */

html.tcm-mp-open {
	overflow: hidden;
}

.tcm-mp {
	--tcm-mp-pink: #e0214f;
	--tcm-mp-pink-hover: #b81a40;
	--tcm-mp-pink-deep: #de2559;
	--tcm-mp-pink-light: #e43c64;
	--tcm-mp-pink-text: #c41d47;
	--tcm-mp-purple: #632e92;
	--tcm-mp-border: #e8e5ee;
	--tcm-mp-text: #3d3a45;
	--tcm-mp-muted: #57535f;

	box-sizing: border-box;
	width: min(940px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: #000;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
	font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.tcm-mp::backdrop {
	background: rgba(13, 8, 30, 0.78);
}

.tcm-mp *,
.tcm-mp *::before,
.tcm-mp *::after {
	box-sizing: border-box;
}

/* Divi styles headings, paragraphs and lists site-wide */
.tcm-mp :where(h2, h3, h4, p, ul, li) {
	margin: 0;
	padding: 0;
	border: 0;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	list-style: none;
}

.tcm-mp strong {
	color: #000;
	font-weight: 700;
}

.tcm-mp :focus-visible {
	outline: 2px solid var(--tcm-mp-pink);
	outline-offset: 2px;
}

.tcm-mp__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding: 40px 40px 32px;
}

.tcm-mp--free .tcm-mp__inner {
	padding-bottom: 36px;
}

.tcm-mp__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: #f4f2f7;
	color: #000;
	cursor: pointer;
}

.tcm-mp__close:hover {
	background: var(--tcm-mp-border);
}

/* Header (paid) */

.tcm-mp__header {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-right: 48px;
}

.tcm-mp__title {
	font-size: 32px;
	line-height: 40px;
	font-weight: 700;
}

.tcm-mp__lead {
	color: var(--tcm-mp-text);
	font-size: 16px;
	line-height: 26px;
}

.tcm-mp__check {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--tcm-mp-text);
	font-size: 14px;
	line-height: 20px;
}

.tcm-mp__check-icon {
	flex-shrink: 0;
	color: var(--tcm-mp-pink);
}

/* Free tier card + upgrade copy (free) */

.tcm-mp__free {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	margin-right: 48px;
	padding: 28px 28px 28px 32px;
	border: 2px solid var(--tcm-mp-pink);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(224, 33, 79, 0.16);
}

.tcm-mp__free-text {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tcm-mp__free-text .tcm-mp__check {
	font-weight: 600;
}

.tcm-mp__upgrade {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tcm-mp__subtitle {
	font-size: 22px;
	line-height: 28px;
	font-weight: 700;
}

.tcm-mp__upgrade .tcm-mp__lead {
	font-size: 15px;
	line-height: 24px;
}

.tcm-mp__mobile-only {
	display: none;
}

/* Buttons */

.tcm-mp__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 4px 16px;
	border-radius: 9999px;
	font-size: 15px;
	line-height: 20px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: filter 0.15s, background-color 0.15s;
}

.tcm-mp__btn--solid,
.tcm-mp__btn--solid:hover {
	border: 0;
	background: linear-gradient(180deg, var(--tcm-mp-pink-deep), var(--tcm-mp-pink-light));
	color: #fff;
}

.tcm-mp__btn--solid:hover {
	filter: brightness(0.93);
}

.tcm-mp__btn--outline,
.tcm-mp__btn--outline:hover {
	border: 2px solid var(--tcm-mp-pink-deep);
	background: #fff;
	color: var(--tcm-mp-pink-text);
}

.tcm-mp__btn--outline:hover {
	background: #fdf0f3;
}

.tcm-mp__free .tcm-mp__btn {
	flex-shrink: 0;
	width: auto;
	min-height: 52px;
	padding: 0 36px;
}

/* Plans: cards on desktop, tappable rows on mobile */

.tcm-mp__plans {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.tcm-mp__plan {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"name chip"
		"price price"
		"tagline tagline"
		"perks perks"
		"btn btn";
	grid-template-rows: minmax(28px, auto) auto auto 1fr auto;
	align-items: start;
	gap: 16px 8px;
	padding: 24px 22px;
	border: 2px solid var(--tcm-mp-border);
	border-radius: 16px;
	background: #fff;
}

.tcm-mp__plan--featured {
	border-color: var(--tcm-mp-pink);
	box-shadow: 0 8px 24px rgba(224, 33, 79, 0.16);
}

.tcm-mp__plan-name {
	grid-area: name;
	align-self: center;
	font-size: 20px;
	line-height: 28px;
	font-weight: 700;
}

.tcm-mp__chip {
	grid-area: chip;
	align-self: center;
	justify-self: end;
	padding: 6px 12px;
	border-radius: 9999px;
	background: var(--tcm-mp-purple);
	color: #fff;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	white-space: nowrap;
}

.tcm-mp__price {
	grid-area: price;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
}

.tcm-mp__amount {
	font-size: 34px;
	line-height: 40px;
	font-weight: 700;
}

.tcm-mp__period {
	color: var(--tcm-mp-muted);
	font-size: 15px;
	white-space: nowrap;
}

.tcm-mp__arrow {
	display: none;
	flex-shrink: 0;
}

.tcm-mp__tagline {
	grid-area: tagline;
	margin-top: -12px;
	color: var(--tcm-mp-muted);
	font-size: 14px;
	line-height: 20px;
}

.tcm-mp__perks {
	grid-area: perks;
	color: #000;
	font-size: 15px;
	line-height: 22px;
	font-weight: 700;
}

/* Narrow cards wrap at the dot, not inside a phrase */
.tcm-mp__all,
.tcm-mp__saving {
	white-space: nowrap;
}

.tcm-mp__dot {
	color: var(--tcm-mp-pink);
}

/* Labels fit on one line at full width, so no side padding */
.tcm-mp__plan .tcm-mp__btn {
	grid-area: btn;
	padding-inline: 4px;
}

.tcm-mp--free .tcm-mp__plan {
	row-gap: 14px;
	padding: 22px;
}

.tcm-mp--free .tcm-mp__plan-name {
	font-size: 18px;
	line-height: 26px;
}

.tcm-mp--free .tcm-mp__amount {
	font-size: 32px;
	line-height: 38px;
}

.tcm-mp--free .tcm-mp__tagline {
	margin-top: -10px;
}

.tcm-mp--free .tcm-mp__plan .tcm-mp__btn {
	min-height: 46px;
}

/* Includes list + footer (paid) */

.tcm-mp__includes {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 12px 28px;
	color: var(--tcm-mp-text);
	font-size: 14px;
	line-height: 20px;
}

.tcm-mp__includes-title {
	color: #000;
	font-weight: 700;
}

/* Items wrap in one flow with the title, back to the left edge */
.tcm-mp__includes-list {
	display: contents;
}

.tcm-mp__footer {
	padding-top: 20px;
	border-top: 1px solid var(--tcm-mp-border);
	color: var(--tcm-mp-text);
	font-size: 15px;
	line-height: 24px;
	text-align: center;
}

.tcm-mp__footer a {
	color: var(--tcm-mp-pink);
	font-weight: 700;
	text-decoration: none;
}

.tcm-mp__footer a:hover {
	color: var(--tcm-mp-pink-hover);
	text-decoration: underline;
}

/* Tablet: same layout, tighter */

@media (max-width: 979px) {
	.tcm-mp__inner {
		padding: 32px 24px 24px;
	}

	.tcm-mp__plans {
		gap: 12px;
	}

	.tcm-mp__plan,
	.tcm-mp--free .tcm-mp__plan {
		padding: 20px 16px;
	}

	.tcm-mp__plan-name,
	.tcm-mp--free .tcm-mp__plan-name {
		font-size: 18px;
		line-height: 26px;
	}

	.tcm-mp__chip {
		padding: 4px 10px;
		font-size: 11px;
		line-height: 14px;
	}

	.tcm-mp__amount,
	.tcm-mp--free .tcm-mp__amount {
		font-size: 26px;
		line-height: 32px;
	}

	.tcm-mp__free {
		gap: 24px;
		padding: 24px;
	}
}

/* Phone: bottom sheet, each plan is one tappable row */

@media (max-width: 767px) {
	.tcm-mp {
		inset: auto 0 0;
		width: 100%;
		height: calc(100vh - 24px);
		height: calc(100dvh - 24px);
		max-height: none;
		margin: 0;
		border-radius: 20px 20px 0 0;
	}

	.tcm-mp[open] {
		animation: tcm-mp-sheet-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	.tcm-mp__inner,
	.tcm-mp--free .tcm-mp__inner {
		gap: 18px;
		padding: 24px 20px 34px;
	}

	.tcm-mp--free .tcm-mp__inner {
		gap: 20px;
	}

	.tcm-mp__close {
		top: 12px;
		right: 12px;
	}

	.tcm-mp__close svg {
		width: 18px;
		height: 18px;
	}

	.tcm-mp__header {
		padding-right: 0;
	}

	.tcm-mp__header .tcm-mp__title {
		padding-right: 48px;
	}

	.tcm-mp__title {
		font-size: 24px;
		line-height: 30px;
	}

	.tcm-mp__lead,
	.tcm-mp__upgrade .tcm-mp__lead {
		font-size: 14px;
		line-height: 21px;
	}

	.tcm-mp__check-icon {
		width: 14px;
		height: 14px;
	}

	.tcm-mp__free {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		margin: 32px 0 0;
		padding: 18px;
		box-shadow: 0 6px 18px rgba(224, 33, 79, 0.16);
	}

	.tcm-mp__free-text {
		gap: 10px;
	}

	.tcm-mp__free-text .tcm-mp__check {
		font-size: 13px;
		line-height: 18px;
	}

	.tcm-mp__free .tcm-mp__btn {
		width: 100%;
		min-height: 48px;
		margin-top: 4px;
		padding: 0 16px;
	}

	.tcm-mp__subtitle {
		font-size: 18px;
		line-height: 24px;
	}

	.tcm-mp__desktop-only {
		display: none;
	}

	.tcm-mp__mobile-only {
		display: block;
	}

	.tcm-mp__plans {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.tcm-mp__plan,
	.tcm-mp--free .tcm-mp__plan {
		grid-template-areas:
			"name price"
			"sub price"
			"chip price";
		grid-template-rows: auto;
		align-content: center;
		gap: 2px 12px;
		min-height: 72px;
		padding: 12px 16px;
		border-radius: 14px;
	}

	.tcm-mp--free .tcm-mp__plan {
		min-height: 68px;
	}

	.tcm-mp__plan--featured {
		box-shadow: 0 6px 18px rgba(224, 33, 79, 0.16);
	}

	.tcm-mp__plan-name,
	.tcm-mp--free .tcm-mp__plan-name {
		font-size: 16px;
		line-height: 22px;
	}

	.tcm-mp__chip {
		justify-self: start;
		margin-top: 4px;
	}

	.tcm-mp__price {
		align-self: center;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0;
	}

	.tcm-mp__amount,
	.tcm-mp--free .tcm-mp__amount {
		font-size: 20px;
		line-height: 26px;
	}

	.tcm-mp__period {
		display: none;
	}

	.tcm-mp__arrow {
		display: block;
		margin-left: 10px;
		color: var(--tcm-mp-pink);
	}

	/* One muted line under the name: the saving where there is one, otherwise the tagline */
	.tcm-mp__tagline,
	.tcm-mp--free .tcm-mp__tagline,
	.tcm-mp__perks {
		grid-area: sub;
		margin-top: 0;
		color: var(--tcm-mp-muted);
		font-size: 13px;
		line-height: 18px;
		font-weight: 400;
	}

	.tcm-mp__plan--saving .tcm-mp__tagline,
	.tcm-mp__plan:not(.tcm-mp__plan--saving) .tcm-mp__perks,
	.tcm-mp__all,
	.tcm-mp__dot {
		display: none;
	}

	/* The link covers the whole row; its text stays as the accessible name */
	.tcm-mp__plan .tcm-mp__btn,
	.tcm-mp__plan .tcm-mp__btn:hover,
	.tcm-mp--free .tcm-mp__plan .tcm-mp__btn {
		position: absolute;
		inset: -2px;
		width: auto;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 14px;
		background: transparent;
		color: transparent;
		font-size: 0;
		filter: none;
		overflow: hidden;
	}

	.tcm-mp__includes {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		font-size: 13px;
	}

	.tcm-mp__includes-list {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	.tcm-mp__includes .tcm-mp__check {
		gap: 8px;
	}

	.tcm-mp__footer {
		padding-top: 14px;
		font-size: 14px;
		line-height: 22px;
	}
}

@keyframes tcm-mp-sheet-in {
	from {
		transform: translateY(100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tcm-mp[open] {
		animation: none;
	}
}

/* Sale (includes/membership-sale.php): banner across the top, first-payment prices */

.tcm-mp--sale .tcm-mp__sale {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 68px;
	margin: -40px -40px 8px;
	padding: 14px 76px 14px 36px;
	background: var(--tcm-mp-pink);
	color: #fff;
}

.tcm-mp--sale .tcm-mp__sale-badge {
	flex-shrink: 0;
	padding: 5px 14px;
	border-radius: 9999px;
	background: #fff;
	color: var(--tcm-mp-pink);
	font-size: 14px;
	line-height: 20px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
}

.tcm-mp--sale .tcm-mp__sale-text {
	color: #fff;
	font-size: 16px;
	line-height: 24px;
}

.tcm-mp--sale .tcm-mp__sale strong {
	color: #fff;
}

/* The close button sits in the banner */
.tcm-mp--sale .tcm-mp__close {
	top: 12px;
	right: 14px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.tcm-mp--sale .tcm-mp__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.tcm-mp--sale .tcm-mp__close:focus-visible {
	outline-color: #fff;
}

/* ...so the content no longer makes room for it */
.tcm-mp--sale .tcm-mp__header {
	padding-right: 0;
}

.tcm-mp--sale .tcm-mp__free {
	margin-right: 0;
}

@media (max-width: 979px) {
	.tcm-mp--sale .tcm-mp__sale {
		margin: -32px -24px 8px;
		padding: 12px 68px 12px 24px;
	}

	.tcm-mp--sale .tcm-mp__close {
		right: 12px;
	}
}

@media (max-width: 767px) {
	.tcm-mp--sale .tcm-mp__sale {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		min-height: 0;
		margin: -24px -20px 2px;
		padding: 14px 56px 18px 20px;
	}

	.tcm-mp--sale .tcm-mp__sale-badge {
		padding: 2px 10px;
		font-size: 11px;
		line-height: 18px;
	}

	.tcm-mp--sale .tcm-mp__sale-text {
		font-size: 14px;
		line-height: 20px;
	}

	.tcm-mp--sale .tcm-mp__sale-note {
		display: block;
	}

	.tcm-mp--sale .tcm-mp__close {
		top: 10px;
		right: 10px;
	}

	.tcm-mp--sale .tcm-mp__header .tcm-mp__title {
		padding-right: 0;
	}

	.tcm-mp--sale .tcm-mp__free {
		margin: 0;
	}

	/* Price over its period, right-aligned, with the arrow beside both */
	.tcm-mp--sale .tcm-mp__price {
		display: grid;
		grid-template-columns: auto auto;
		grid-template-areas:
			"amount arrow"
			"period arrow";
		align-items: center;
		justify-items: end;
	}

	.tcm-mp--sale .tcm-mp__amount {
		grid-area: amount;
	}

	.tcm-mp--sale .tcm-mp__period {
		grid-area: period;
		display: block;
		font-size: 12px;
		line-height: 16px;
	}

	.tcm-mp--sale .tcm-mp__arrow {
		grid-area: arrow;
	}
}
