/* Teckform Pricing Table widget. Colors and sizes set in the Style tab override these defaults. */

.teckform-pricing {
	--teckform-pricing-gap: 24px;
	--teckform-pricing-raise: 16px;
	--teckform-pricing-justify: flex-start;
	--teckform-pricing-check: #16a34a;
	--teckform-pricing-cross: var(--teckform-muted);
	color: var(--teckform-text);
}

/* Monthly / yearly switch */
.teckform-pricing__switch {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 48px;
}

.teckform-pricing__switch-label {
	color: var(--teckform-muted);
	font-weight: 600;
	cursor: pointer;
	user-select: none;
	transition: color 0.2s ease;
}

.teckform-pricing__switch-label.is-active {
	color: var(--teckform-text);
}

.teckform-pricing__toggle {
	position: relative;
	flex: 0 0 auto;
	width: 52px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--teckform-border);
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.teckform-pricing__toggle[aria-checked="true"] {
	background: var(--teckform-accent);
}

.teckform-pricing__toggle:focus-visible {
	outline: 2px solid var(--teckform-accent);
	outline-offset: 3px;
}

.teckform-pricing__toggle-knob {
	position: absolute;
	top: 4px;
	inset-inline-start: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
	transition: inset-inline-start 0.25s ease;
}

.teckform-pricing__toggle[aria-checked="true"] .teckform-pricing__toggle-knob {
	inset-inline-start: calc(100% - 26px);
}

.teckform-pricing__save {
	padding: 3px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--teckform-pricing-check) 14%, transparent);
	color: var(--teckform-pricing-check);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.4;
}

/* Plans grid. Automatic: all plans in one row on desktop, two on tablet, one on phones. */
.teckform-pricing__plans {
	display: grid;
	grid-template-columns: repeat(var(--teckform-pricing-columns, var(--teckform-pricing-count, 3)), minmax(0, 1fr));
	align-items: stretch;
	gap: var(--teckform-pricing-gap);
}

.teckform-pricing__plans:has(.teckform-pricing__plan--featured) {
	padding-top: var(--teckform-pricing-raise);
}

/* Card */
.teckform-pricing__plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 32px;
	border: 1px solid var(--teckform-border);
	border-radius: 16px;
	background: var(--teckform-surface);
	text-align: start;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.teckform-pricing__plan--featured {
	z-index: 1;
	border: 2px solid var(--teckform-accent);
	box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--teckform-accent) 45%, transparent);
	transform: translateY(calc(-1 * var(--teckform-pricing-raise)));
}

.teckform-pricing--lift .teckform-pricing__plan:hover {
	transform: translateY(-6px);
}

.teckform-pricing--lift .teckform-pricing__plan--featured:hover {
	transform: translateY(calc(-1 * var(--teckform-pricing-raise) - 6px));
}

.teckform-pricing__badge {
	position: absolute;
	top: 0;
	left: 50%;
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--teckform-accent);
	color: var(--teckform-on-accent, #fff);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.5;
	text-transform: uppercase;
	white-space: nowrap;
	transform: translate(-50%, -50%);
}

/* Name and description */
.teckform-pricing__header {
	margin-bottom: 20px;
}

.teckform-pricing .teckform-pricing__name {
	margin: 0 0 6px;
	color: var(--teckform-text);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.teckform-pricing__description {
	margin: 0;
	color: var(--teckform-muted);
	font-size: 0.9375rem;
	line-height: 1.6;
}

/* Price */
.teckform-pricing__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: var(--teckform-pricing-justify);
	gap: 0 4px;
	margin-bottom: 24px;
	color: var(--teckform-text);
	line-height: 1;
}

.teckform-pricing__currency {
	align-self: flex-start;
	margin-top: 0.3em;
	font-size: 1.5rem;
	font-weight: 600;
}

.teckform-pricing__currency:empty {
	display: none;
}

.teckform-pricing__amount {
	display: inline-block;
	font-size: 3rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.teckform-pricing__period {
	display: inline-block;
	color: var(--teckform-muted);
	font-size: 0.9375rem;
	line-height: 1.4;
}

.teckform-pricing--currency-after .teckform-pricing__currency {
	order: 2;
}

.teckform-pricing--currency-after .teckform-pricing__period {
	order: 3;
}

/* Swap animation when the switch changes. */
.teckform-pricing__price.is-updating .teckform-pricing__amount,
.teckform-pricing__price.is-updating .teckform-pricing__period {
	animation: teckform-pricing-swap 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes teckform-pricing-swap {
	from {
		opacity: 0;
		transform: translateY(-0.35em);
	}
}

/* Features */
.teckform-pricing__features {
	display: grid;
	gap: 12px;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

.teckform-pricing__feature {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	color: var(--teckform-text);
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: start;
}

.teckform-pricing__feature svg {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 0.15em;
	fill: var(--teckform-pricing-check);
}

.teckform-pricing__feature.is-excluded {
	color: var(--teckform-muted);
}

.teckform-pricing__feature.is-excluded > span {
	text-decoration: line-through;
	text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}

.teckform-pricing__feature.is-excluded svg {
	fill: var(--teckform-pricing-cross);
}

/* Centered cards: center each feature line, icon kept next to its text. */
.teckform-pricing__features {
	justify-items: var(--teckform-pricing-justify);
}

/* Button */
.teckform-pricing__action {
	margin-bottom: 0;
}

.teckform-pricing--buttons-bottom .teckform-pricing__action:last-child {
	margin-top: auto;
}

.teckform-pricing .teckform-pricing__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 24px;
	border: 1px solid var(--teckform-border);
	border-radius: 10px;
	background: transparent;
	color: var(--teckform-text);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.teckform-pricing .teckform-pricing__button:hover,
.teckform-pricing .teckform-pricing__button:focus-visible {
	border-color: var(--teckform-accent);
	color: var(--teckform-accent);
}

.teckform-pricing .teckform-pricing__button:focus-visible {
	outline: 2px solid var(--teckform-accent);
	outline-offset: 2px;
}

.teckform-pricing .teckform-pricing__plan--featured .teckform-pricing__button {
	border-color: var(--teckform-accent);
	background: var(--teckform-accent);
	color: var(--teckform-on-accent, #fff);
}

.teckform-pricing .teckform-pricing__plan--featured .teckform-pricing__button:hover,
.teckform-pricing .teckform-pricing__plan--featured .teckform-pricing__button:focus-visible {
	border-color: color-mix(in srgb, var(--teckform-accent) 85%, #000);
	background: color-mix(in srgb, var(--teckform-accent) 85%, #000);
	color: var(--teckform-on-accent, #fff);
}

/* With the button above the features, give it room. */
.teckform-pricing__action:not(:last-child) {
	margin-bottom: 28px;
}

@media (prefers-reduced-motion: reduce) {
	.teckform-pricing *,
	.teckform-pricing *::before,
	.teckform-pricing *::after {
		animation: none !important;
		transition: none !important;
	}

	.teckform-pricing--lift .teckform-pricing__plan:hover {
		transform: none;
	}

	.teckform-pricing--lift .teckform-pricing__plan--featured:hover {
		transform: translateY(calc(-1 * var(--teckform-pricing-raise)));
	}
}

@media (max-width: 1024px) {
	.teckform-pricing__plans {
		grid-template-columns: repeat(var(--teckform-pricing-columns, 2), minmax(0, 1fr));
	}
}

/* Phone: plans stack, so nothing is raised. */
@media (max-width: 767px) {
	.teckform-pricing__plans {
		grid-template-columns: repeat(var(--teckform-pricing-columns, 1), minmax(0, 1fr));
		padding-top: 0;
	}

	.teckform-pricing__plans:has(.teckform-pricing__plan--featured) {
		padding-top: 12px;
	}

	.teckform-pricing__plan--featured,
	.teckform-pricing--lift .teckform-pricing__plan--featured:hover {
		transform: none;
	}

	.teckform-pricing__plan {
		padding: 28px 24px;
	}
}
