/**
 * Frontend TN Stripe Licensing — card prodotti (stile Flatty prezzi).
 */

:root {
	--tn-sl-red: #6B4CC2;
	--tn-sl-red-hover: #5e3eb6;
	--tn-sl-purple-pastel: #ece3fd;
	--tn-sl-gray-box: #ebebeb;
	--tn-sl-gray-border: #e8e8e8;
	--tn-sl-text: #111111;
	--tn-sl-text-muted: #333333;
}

/* --- Griglia prodotti --- */
.tn-sl-products-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
	max-width: 1140px;
	margin: 30px auto;
	padding: 0 16px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* --- Card piano --- */
.tn-sl-plan {
	width: 100%;
	max-width: none;
	padding: 0;
	background: transparent;
	color: var(--tn-sl-text-muted);
	box-sizing: border-box;
}

.tn-sl-plan strong {
	font-weight: 700;
	color: var(--tn-sl-text);
}

.tn-sl-plan__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px 20px 20px;
	background-color: #ffffff;
	border: 2px solid var(--tn-sl-gray-border);
	border-radius: 16px;
	box-shadow: none;
	box-sizing: border-box;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tn-sl-plan:hover .tn-sl-plan__inner,
.tn-sl-plan:focus-within .tn-sl-plan__inner {
	border-color: var(--tn-sl-red);
	box-shadow:
		0 0 0 2px var(--tn-sl-red),
		0 8px 24px rgba(107, 76, 194, 0.12);
}

/* --- Titolo --- */
.tn-sl-plan__title {
	margin: 0 0 14px;
	font-weight: 700;
	font-size: 22px;
	line-height: 1.15;
	color: var(--tn-sl-text);
	text-transform: uppercase;
	text-align: center;
	letter-spacing: 0.02em;
	transition: color 0.25s ease;
}

.tn-sl-plan:hover .tn-sl-plan__title,
.tn-sl-plan:focus-within .tn-sl-plan__title {
	color: var(--tn-sl-red);
}

/* --- Fascia grigia (info / feature) --- */
.tn-sl-plan__info {
	margin: 0 -20px;
	padding: 14px 20px;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--tn-sl-text-muted);
	text-align: center;
	background-color: var(--tn-sl-gray-box);
	border-radius: 0;
	width: calc(100% + 40px);
	box-sizing: border-box;
}

.tn-sl-plan__info + .tn-sl-plan__features {
	margin-top: 0;
}

/* --- Lista feature --- */
.tn-sl-plan__features {
	display: flex;
	flex-direction: column;
	margin: 0 -20px;
	padding: 0;
	list-style: none;
	width: calc(100% + 40px);
}

.tn-sl-plan__features li {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0;
	padding: 14px 20px;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--tn-sl-text-muted);
	background-color: var(--tn-sl-gray-box);
	text-align: center;
}

.tn-sl-plan__features li + li {
	margin-top: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* Checkbox rotondo */
.tn-sl-plan__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background-color: var(--tn-sl-red);
	color: #ffffff;
}

.tn-sl-plan__icon svg {
	width: 12px;
	height: 12px;
}

/* Spacer: spinge prezzo e CTA in basso */
.tn-sl-plan__spacer {
	flex-grow: 1;
	min-height: 16px;
}

/* --- Box prezzo --- */
.tn-sl-plan__pricing {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 16px 0;
	padding: 14px 16px;
	background-color: var(--tn-sl-gray-box);
	border-radius: 12px;
	box-sizing: border-box;
	text-align: center;
	transition: background-color 0.25s ease;
}

.tn-sl-plan__pricing-value {
	font-size: clamp(1.5rem, 2.4vw, 1.85rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--tn-sl-text);
	transition: color 0.25s ease;
}

.tn-sl-plan__pricing-value small {
	margin-left: 0.1em;
	font-size: 0.42em;
	font-weight: 500;
	color: var(--tn-sl-text);
	vertical-align: baseline;
	transition: color 0.25s ease;
}

.tn-sl-plan:hover .tn-sl-plan__pricing,
.tn-sl-plan:focus-within .tn-sl-plan__pricing {
	background-color: var(--tn-sl-purple-pastel);
}

.tn-sl-plan:hover .tn-sl-plan__pricing-value,
.tn-sl-plan:hover .tn-sl-plan__pricing-value small,
.tn-sl-plan:focus-within .tn-sl-plan__pricing-value,
.tn-sl-plan:focus-within .tn-sl-plan__pricing-value small,
.tn-sl-plan:hover .tn-sl-plan__pricing--quote .tn-sl-plan__pricing-value,
.tn-sl-plan:focus-within .tn-sl-plan__pricing--quote .tn-sl-plan__pricing-value {
	color: var(--tn-sl-red);
}

.tn-sl-plan__pricing--quote {
	gap: 4px;
}

.tn-sl-plan__pricing-label {
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--tn-sl-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	transition: color 0.25s ease;
}

.tn-sl-plan:hover .tn-sl-plan__pricing-label,
.tn-sl-plan:focus-within .tn-sl-plan__pricing-label {
	color: var(--tn-sl-red);
}

.tn-sl-plan__pricing--quote .tn-sl-plan__pricing-value {
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	font-weight: 700;
}

/* --- Card contatto --- */
.tn-sl-plan--contact .tn-sl-plan__info {
	text-align: center;
}

/* --- Azione / CTA --- */
.tn-sl-plan__action {
	width: 100%;
	margin-top: 0;
}

.tn-sl-plan__button,
.tn-sl-plan__contact-label {
	display: block;
	width: 100%;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background-color: var(--tn-sl-red);
	color: #ffffff;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	font-family: inherit;
	box-sizing: border-box;
	transition: background-color 0.2s ease, transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tn-sl-plan__button:hover,
.tn-sl-plan__button:focus,
.tn-sl-plan__contact-label:hover,
.tn-sl-plan__contact-label:focus {
	background-color: var(--tn-sl-red-hover);
	color: #ffffff;
}

.tn-sl-plan__button:active {
	transform: translateY(1px);
}

.tn-sl-plan__button:disabled,
.tn-sl-plan__button.is-loading {
	opacity: 0.65;
	cursor: not-allowed;
	pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
	.tn-sl-products-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (max-width: 639px) {
	.tn-sl-products-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		margin: 20px auto;
		padding: 0 12px;
	}

	.tn-sl-plan__inner {
		padding: 24px 16px 16px;
	}

	.tn-sl-plan__info {
		margin-left: -16px;
		margin-right: -16px;
		width: calc(100% + 32px);
		padding-left: 16px;
		padding-right: 16px;
	}

	.tn-sl-plan__features {
		margin-left: -16px;
		margin-right: -16px;
		width: calc(100% + 32px);
	}

	.tn-sl-plan__features li {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* --- Notifiche post-checkout (modal) --- */
.tn-sl-notice-overlay {
	position: fixed;
	inset: 0;
	z-index: 1040;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.tn-sl-notice-overlay.is-closed {
	display: none;
}

.tn-sl-notice-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.45);
	cursor: pointer;
}

.tn-sl-notice {
	--tn-sl-notice-green-bg: #e8f8ef;
	--tn-sl-notice-green-border: #1e7e5a;
	--tn-sl-notice-green-text: #2d5c45;
	--uk-global-border: #e5e5e5;
	--uk-global-emphasis-color: #333;
	--uk-global-muted-color: #999;
	--uk-border-radius: 12px;
	position: relative;
	z-index: 1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #666;
	max-width: 520px;
	width: 100%;
	overflow: hidden;
	border-radius: var(--uk-border-radius);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	text-align: center;
}

.tn-sl-notice__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tn-sl-notice__close:hover,
.tn-sl-notice__close:focus {
	opacity: 1;
	background-color: rgba(0, 0, 0, 0.06);
}

.tn-sl-notice__inner {
	padding: 28px 36px 24px;
}

.tn-sl-notice__title {
	display: block;
	margin: 0 0 10px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.4;
}

.tn-sl-notice__body p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.6;
}

.tn-sl-notice__body p+p {
	margin-top: 8px;
}

.tn-sl-notice--success {
	background: #edfbf6;
	border: 2px solid #1e7e5a;
	color: #2d5c45;
}

.tn-sl-notice--success .tn-sl-notice__title {
	color: #1e7e5a;
}

.tn-sl-notice--provision {
	background: var(--tn-sl-notice-green-bg);
	border: 2px solid var(--tn-sl-notice-green-border);
	color: var(--tn-sl-notice-green-text);
}

.tn-sl-notice--provision .tn-sl-notice__title {
	color: var(--tn-sl-notice-green-border);
}

.tn-sl-notice--provision .tn-sl-notice__close {
	color: var(--tn-sl-notice-green-border);
}

.tn-sl-notice--warning {
	background: #fff6ee;
	border: 2px solid #c4842a;
	color: #8a5a20;
}

.tn-sl-notice--warning .tn-sl-notice__title {
	color: #b5741f;
}

.tn-sl-notice--error {
	background: #fef4f6;
	border: 2px solid #c4254a;
	color: #a83248;
}

.tn-sl-notice--error .tn-sl-notice__title {
	color: #c4254a;
}

.tn-sl-license-key {
	display: inline-block;
	padding: 4px 8px;
	background: #f8f8f8;
	border: 1px solid var(--uk-global-border);
	border-radius: var(--uk-border-radius);
	font-family: Consolas, monaco, monospace;
	font-size: 0.8125rem;
	line-height: 1.4;
	word-break: break-all;
	color: var(--uk-global-emphasis-color);
}

.tn-sl-license-hint {
	font-size: 0.8125rem;
	color: var(--uk-global-muted-color);
}

@media (max-width: 639px) {
	.tn-sl-notice-overlay {
		padding: 16px;
	}

	.tn-sl-notice__inner {
		padding: 24px 28px 20px;
	}
}