/*
 * Langferry pricing cards. Uses the Langferry Site theme's colour presets
 * when present, with the dashboard's light colours as fallbacks.
 */
.lfp {
	--lfp-surface: var(--wp--preset--color--surface, #fff);
	--lfp-surface-2: var(--wp--preset--color--surface-2, #f0f2f8);
	--lfp-border: var(--wp--preset--color--border, #e2e5ee);
	--lfp-text: var(--wp--preset--color--contrast, #0f172a);
	--lfp-text-2: var(--wp--preset--color--secondary, #475569);
	--lfp-muted: var(--wp--preset--color--muted, #5b6478);
	--lfp-brand: var(--wp--preset--color--brand, #4f46e5);
	--lfp-brand-strong: var(--wp--preset--color--brand-strong, #4338ca);
	--lfp-brand-soft: var(--wp--preset--color--brand-soft, #eef0ff);
	--lfp-brand-text: var(--wp--preset--color--brand-text, #3730a3);
	--lfp-on-brand: var(--wp--preset--color--on-brand, #fff);
	--lfp-success: #047857;
	container-type: inline-size;
	color: var(--lfp-text);
}
@media (prefers-color-scheme: dark) {
	/* Theme presets win when present; these fallbacks match the dashboard's dark colours. */
	.lfp {
		--lfp-surface: var(--wp--preset--color--surface, #121827);
		--lfp-surface-2: var(--wp--preset--color--surface-2, #1a2133);
		--lfp-border: var(--wp--preset--color--border, #252e44);
		--lfp-text: var(--wp--preset--color--contrast, #e8ecf5);
		--lfp-text-2: var(--wp--preset--color--secondary, #aab4c8);
		--lfp-muted: var(--wp--preset--color--muted, #9aa3b8);
		--lfp-brand: var(--wp--preset--color--brand, #818cf8);
		--lfp-brand-strong: var(--wp--preset--color--brand-strong, #a5b4fc);
		--lfp-brand-soft: var(--wp--preset--color--brand-soft, #1e1f4b);
		--lfp-brand-text: var(--wp--preset--color--brand-text, #c7d2fe);
		--lfp-on-brand: var(--wp--preset--color--on-brand, #0b0f1a);
		--lfp-success: #34d399;
	}
}

.lfp-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Show only the selected billing period. */
.lfp[data-interval="month"] .lfp-when-year,
.lfp[data-interval="year"] .lfp-when-month { display: none; }

/* ---------- Toggle ---------- */
.lfp-toggle {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 3px;
	margin-bottom: 1.5rem;
	background: var(--lfp-surface-2);
	border: 1px solid var(--lfp-border);
	border-radius: 999px;
}
.lfp-toggle a {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .45rem 1rem;
	border-radius: 999px;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--lfp-text-2);
	text-decoration: none;
}
.lfp-toggle a:hover { color: var(--lfp-text); }
.lfp-toggle a[aria-current="true"] {
	background: var(--lfp-surface);
	color: var(--lfp-text);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.lfp-toggle a:focus-visible {
	outline: 2px solid var(--lfp-brand);
	outline-offset: 2px;
}
.lfp-save {
	font-size: .8125rem;
	font-weight: 600;
	color: var(--lfp-success);
}

/* ---------- Grid ---------- */
.lfp-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}
@container (min-width: 560px) {
	.lfp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* With an odd number of plans, the first card takes the whole row. */
	.lfp-grid > li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
}
@container (min-width: 1000px) {
	/* One row, one equal column per plan, however many plans the app returns. */
	.lfp-grid {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
	}
	.lfp-grid > li:first-child:nth-last-child(odd) { grid-column: auto; }

	/* Line up name, price, tagline, allowance and features across the cards. */
	@supports (grid-template-rows: subgrid) {
		.lfp-grid { row-gap: 0; }
		.lfp-grid > .lfp-card {
			display: grid;
			grid-template-rows: subgrid;
			row-gap: .6rem;
		}
		.lfp--full .lfp-grid > .lfp-card { grid-row: span 6; }
		.lfp--teaser .lfp-grid > .lfp-card { grid-row: span 5; }
		.lfp-card > .lfp-allowance,
		.lfp-card > .lfp-features { align-self: start; }
	}
}

/* ---------- Card ---------- */
.lfp-card {
	--lfp-plan: var(--lfp-muted);
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	margin: 0;
	padding: 1.25rem 1.25rem 1.35rem;
	background: var(--lfp-surface);
	border: 1px solid var(--lfp-border);
	border-top: 4px solid var(--lfp-plan);
	border-radius: 12px;
}
.lfp-card > * { margin: 0; }
/* Plan colours match the plan badges in the Langferry dashboard. */
.lfp-card--custom { --lfp-plan: #0f766e; }
.lfp-card--startup { --lfp-plan: #1d4ed8; }
.lfp-card--business { --lfp-plan: #6d28d9; }
.lfp-card--enterprise { --lfp-plan: #9a5b00; }
@media (prefers-color-scheme: dark) {
	.lfp-card--custom { --lfp-plan: #5eead4; }
	.lfp-card--startup { --lfp-plan: #93c5fd; }
	.lfp-card--business { --lfp-plan: #c4b5fd; }
	.lfp-card--enterprise { --lfp-plan: #fcd34d; }
}
.lfp-card.is-trial {
	border-color: var(--lfp-brand);
	border-top-color: var(--lfp-plan);
	box-shadow: 0 0 0 1px var(--lfp-brand), 0 10px 30px rgba(79, 70, 229, .12);
}

.lfp-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .4rem .75rem;
}
.lfp-name {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: var(--lfp-text);
}
/* The trial badge sits on the card's top edge, so it doesn't push the price down. */
.lfp-badge {
	position: absolute;
	top: -4px;
	inset-inline-end: 1rem;
	transform: translateY(-50%);
	display: inline-block;
	border: 1px solid var(--lfp-brand);
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--lfp-brand-soft);
	color: var(--lfp-brand-text);
	font-size: .75rem;
	font-weight: 650;
	line-height: 1.6;
	white-space: nowrap;
}

.lfp-price { line-height: 1.1; }
.lfp-amount {
	font-size: 2.125rem;
	font-weight: 750;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}
.lfp-per { font-size: .9375rem; color: var(--lfp-muted); font-weight: 500; }
.lfp-billed { font-size: .8125rem; color: var(--lfp-muted); }
.lfp-tagline { font-size: .9375rem; color: var(--lfp-text-2); line-height: 1.45; }

.lfp-allowance {
	padding: .7rem .8rem;
	background: var(--lfp-surface-2);
	border-radius: 8px;
}
.lfp-allowance p { margin: 0; }
.lfp-allowance-main { font-weight: 650; font-size: .9375rem; line-height: 1.35; }
.lfp-allowance-sub { font-size: .8125rem; color: var(--lfp-text-2); margin-top: .2rem !important; line-height: 1.4; }

.lfp-features {
	list-style: none;
	margin: .25rem 0 0;
	padding: 0;
	display: grid;
	gap: .45rem;
	font-size: .875rem;
	line-height: 1.4;
}
.lfp-features li {
	position: relative;
	padding-inline-start: 1.4rem;
}
.lfp-features li::before {
	content: "";
	position: absolute;
	inset-inline-start: .15rem;
	top: .35em;
	width: .6rem;
	height: .32rem;
	border-left: 2px solid var(--lfp-success);
	border-bottom: 2px solid var(--lfp-success);
	transform: rotate(-45deg);
}
.lfp-features .is-off { color: var(--lfp-muted); }
.lfp-features .is-limit { color: var(--lfp-text-2); }
.lfp-features .is-off::before,
.lfp-features .is-limit::before {
	top: .7em;
	height: 0;
	width: .6rem;
	border-left: 0;
	border-bottom: 2px solid var(--lfp-muted);
	transform: none;
}

/* ---------- Notes and actions ---------- */
.lfp-foot {
	margin-top: 1.5rem;
	display: grid;
	gap: .75rem;
	max-width: 46rem;
	font-size: .9375rem;
	color: var(--lfp-text-2);
}
.lfp-foot p { margin: 0; }
.lfp-trial { color: var(--lfp-text); font-weight: 550; }
.lfp-every-plan { color: var(--lfp-text); }
.lfp-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem 1.5rem;
	margin-top: .5rem;
}
.lfp .lfp-cta {
	display: inline-block;
	padding: .7rem 1.25rem;
	border-radius: 8px;
	border: 1px solid var(--lfp-brand);
	background: var(--lfp-brand);
	color: var(--lfp-on-brand);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
	text-decoration: none;
}
.lfp .lfp-cta:hover { background: var(--lfp-brand-strong); border-color: var(--lfp-brand-strong); color: var(--lfp-on-brand); }
.lfp .lfp-cta:focus-visible,
.lfp .lfp-compare:focus-visible { outline: 2px solid var(--lfp-brand); outline-offset: 3px; }
.lfp .lfp-compare { font-weight: 600; color: var(--lfp-brand); }

.lfp-missing {
	padding: 1rem 1.25rem;
	border: 1px dashed var(--lfp-border, #cdd2df);
	border-radius: 10px;
}
