/* Tarifs — bronze / argent / or + lumières en vague */
.tcf-pricing {
	--tp-ink: #111827;
	--tp-muted: #6b7280;
	--tp-line: #e5e7eb;
	--tp-soft: #f3f4f6;
	--tp-ok: #16a34a;
	--tp-no: #dc2626;
	--tp-blue: #2563eb;
	--tp-bronze-1: #b45309;
	--tp-bronze-2: #d97706;
	--tp-bronze-3: #f59e0b;
	--tp-silver-1: #64748b;
	--tp-silver-2: #94a3b8;
	--tp-silver-3: #e2e8f0;
	--tp-gold-1: #a16207;
	--tp-gold-2: #ca8a04;
	--tp-gold-3: #facc15;
	--tp-green: #22c55e;
}

.tcf-pricing__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	/* 4 rangées partagées : tête / options / bouton / comparaison */
	grid-template-rows: auto auto auto 1fr;
	column-gap: 1.25rem;
	row-gap: 0;
	align-items: stretch;
}

.tcf-plan {
	position: relative;
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 4;
	grid-template-columns: minmax(0, 1fr);
	background: #fff;
	border: 1px solid var(--tp-line);
	border-radius: 20px;
	padding: 1.75rem 1.35rem 1.4rem;
	box-shadow: 0 10px 30px -22px rgba(17, 24, 39, 0.35);
	overflow: hidden;
	outline: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tcf-plan:hover {
	transform: translateY(-3px);
}

/* Vagues en ::before (vert) / ::after (métal) — hors flux, n’affectent pas le subgrid */
.tcf-plan::before,
.tcf-plan::after {
	content: '';
	pointer-events: none;
	position: absolute;
	inset: -40%;
	z-index: 0;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.tcf-plan__head,
.tcf-plan__options-slot,
.tcf-plan__price-block,
.tcf-plan__compare {
	position: relative;
	z-index: 1;
}

/* Vague verte permanente sur Recommandé */
.tcf-plan.is-wave-green::before {
	opacity: 1;
	background:
		radial-gradient(ellipse 80% 55% at 20% 0%, rgba(34, 197, 94, 0.22), transparent 60%),
		radial-gradient(ellipse 70% 50% at 85% 10%, rgba(74, 222, 128, 0.18), transparent 55%);
	animation: tcf-wave-green 3.6s ease-in-out infinite;
}

.tcf-plan--featured {
	border-color: rgba(34, 197, 94, 0.45);
	box-shadow:
		0 0 0 1px rgba(34, 197, 94, 0.25),
		0 18px 40px -24px rgba(34, 197, 94, 0.4);
}

.tcf-plan--featured .tcf-plan__head::before {
	content: '';
	position: absolute;
	top: -1.75rem;
	left: 1.2rem;
	right: 1.2rem;
	height: 4px;
	border-radius: 0 0 8px 8px;
	background: linear-gradient(90deg, #16a34a, #4ade80, #16a34a);
	background-size: 200% 100%;
	animation: tcf-wave-bar 3.2s ease-in-out infinite;
	z-index: 2;
}

/* Vague métal au clic */
.tcf-plan.is-wave-metal.tcf-plan--metal-bronze::after {
	opacity: 1;
	background:
		radial-gradient(ellipse 75% 55% at 30% 0%, rgba(217, 119, 6, 0.35), transparent 58%),
		radial-gradient(ellipse 60% 45% at 80% 20%, rgba(245, 158, 11, 0.25), transparent 55%);
	animation: tcf-wave-bronze 2.8s ease-in-out infinite;
}

.tcf-plan.is-wave-metal.tcf-plan--metal-silver::after {
	opacity: 1;
	background:
		radial-gradient(ellipse 75% 55% at 30% 0%, rgba(148, 163, 184, 0.4), transparent 58%),
		radial-gradient(ellipse 60% 45% at 80% 20%, rgba(226, 232, 240, 0.55), transparent 55%);
	animation: tcf-wave-silver 2.8s ease-in-out infinite;
}

.tcf-plan.is-wave-metal.tcf-plan--metal-gold::after {
	opacity: 1;
	background:
		radial-gradient(ellipse 75% 55% at 30% 0%, rgba(234, 179, 8, 0.4), transparent 58%),
		radial-gradient(ellipse 60% 45% at 80% 20%, rgba(250, 204, 21, 0.35), transparent 55%);
	animation: tcf-wave-gold 2.8s ease-in-out infinite;
}

.tcf-plan.is-wave-metal.tcf-plan--metal-bronze {
	border-color: rgba(217, 119, 6, 0.55);
	box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.3), 0 18px 40px -20px rgba(180, 83, 9, 0.45);
}

.tcf-plan.is-wave-metal.tcf-plan--metal-silver {
	border-color: rgba(100, 116, 139, 0.55);
	box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45), 0 18px 40px -20px rgba(71, 85, 105, 0.4);
}

.tcf-plan.is-wave-metal.tcf-plan--metal-gold {
	border-color: rgba(202, 138, 4, 0.6);
	box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.4), 0 18px 40px -20px rgba(161, 98, 7, 0.45);
}

/* Plus recommandé : conserve le halo vert même avec vague argent */
.tcf-plan--featured.is-wave-metal {
	border-color: rgba(34, 197, 94, 0.55);
	box-shadow:
		0 0 0 1px rgba(34, 197, 94, 0.35),
		0 0 28px -8px rgba(148, 163, 184, 0.55),
		0 18px 40px -20px rgba(34, 197, 94, 0.4);
}

.tcf-plan__badge {
	position: absolute;
	top: -0.75rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	white-space: nowrap;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 750;
	color: #fff;
	background: var(--tp-blue);
	box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.8);
}

/* ——— Zones alignées via subgrid (boutons au même niveau) ——— */
.tcf-plan__head {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	/* Pas de min-height : la rangée 1 s’aligne sur la carte la plus haute */
	padding-bottom: 0.35rem;
}

.tcf-plan__metal-label {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
}

.tcf-plan--metal-bronze .tcf-plan__metal-label { color: var(--tp-bronze-1); }
.tcf-plan--metal-silver .tcf-plan__metal-label { color: #475569; }
.tcf-plan--metal-gold .tcf-plan__metal-label { color: var(--tp-gold-1); }

.tcf-plan__name {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--tp-ink);
	line-height: 1.15;
}

.tcf-plan__desc {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--tp-muted);
}

.tcf-plan__options-slot {
	display: flex;
	align-items: flex-end;
	min-height: 2.75rem;
	padding: 0.85rem 0 0.75rem;
	box-sizing: border-box;
}

.tcf-plan__options {
	display: inline-flex;
	gap: 0.2rem;
	padding: 0.2rem;
	border-radius: 999px;
	background: var(--tp-soft);
	border: 1px solid var(--tp-line);
}

.tcf-plan__opt {
	border: none;
	background: transparent;
	border-radius: 999px;
	padding: 0.4rem 0.8rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: #6b7280;
	cursor: pointer;
	font-family: inherit;
}

.tcf-plan__opt.is-active {
	background: #fff;
	color: var(--tp-ink);
	box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
}

.tcf-plan__price-block {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	margin: 0;
	padding: 0 0 1.25rem;
	border-bottom: 1px solid var(--tp-line);
}

.tcf-plan__price-btn {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 0.35rem;
	width: 100%;
	min-height: 3.15rem;
	padding: 0.9rem 1rem;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 800;
	font-size: 1.1rem;
	color: #fff;
	border: none;
	transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.tcf-plan__price-btn small {
	font-size: 0.8rem;
	font-weight: 650;
	opacity: 0.9;
}

.tcf-plan__price-btn:hover {
	transform: translateY(-1px);
	color: #fff;
	filter: brightness(1.05);
}

/* Boutons métalliques */
.tcf-plan__price-btn--free {
	background: #fff;
	color: var(--tp-ink);
	border: 1.5px solid var(--tp-line);
	box-shadow: none;
}

.tcf-plan__price-btn--free:hover {
	background: var(--tp-soft);
	color: var(--tp-ink);
	filter: none;
}

.tcf-plan__price-btn--bronze {
	background: linear-gradient(145deg, #92400e 0%, #b45309 35%, #d97706 70%, #f59e0b 100%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 12px 24px -12px rgba(180, 83, 9, 0.75);
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.tcf-plan__price-btn--silver {
	background: linear-gradient(145deg, #475569 0%, #64748b 40%, #94a3b8 75%, #e2e8f0 100%);
	color: #0f172a;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.55) inset,
		0 12px 24px -12px rgba(71, 85, 105, 0.65);
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tcf-plan__price-btn--silver small {
	color: #1e293b;
}

.tcf-plan__price-btn--gold {
	background: linear-gradient(145deg, #854d0e 0%, #a16207 30%, #ca8a04 65%, #facc15 100%);
	color: #1c1917;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.45) inset,
		0 12px 28px -12px rgba(202, 138, 4, 0.8);
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tcf-plan__price-btn--gold small {
	color: #292524;
}

.tcf-plan__price-sub {
	margin: 0.55rem 0 0;
	text-align: center;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--tp-muted);
	min-height: 1.2em;
}

.tcf-plan__compare {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.tcf-plan__group-title {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #9ca3af;
}

.tcf-plan__rows {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tcf-plan__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid #f3f4f6;
}

.tcf-plan__row:last-child {
	border-bottom: none;
}

.tcf-plan__row-label {
	font-size: 0.86rem;
	line-height: 1.35;
	color: #374151;
}

.tcf-plan__row-cell {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 1.35rem;
	text-align: right;
}

.tcf-plan__ok {
	display: inline-flex;
	width: 1.25rem;
	height: 1.25rem;
	color: var(--tp-ok);
}

.tcf-plan__ok svg,
.tcf-plan__no svg {
	width: 100%;
	height: 100%;
	display: block;
}

.tcf-plan__no {
	display: inline-flex;
	width: 1.15rem;
	height: 1.15rem;
	color: var(--tp-no);
}

.tcf-plan__val {
	font-size: 0.84rem;
	font-weight: 750;
	color: var(--tp-ink);
	line-height: 1.25;
	max-width: 7.5rem;
}

/* Texte Or clignotant (Pro : essais / sessions / Illimité) */
.tcf-plan__val--gold {
	color: #a16207;
	background: linear-gradient(90deg, #854d0e, #eab308, #fde68a, #eab308, #854d0e);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: tcf-gold-blink 2.2s ease-in-out infinite;
	font-weight: 800;
}

.tcf-pricing__foot {
	margin: 1.75rem auto 0;
	max-width: 42rem;
	text-align: center;
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--tp-muted);
}

@keyframes tcf-wave-green {
	0%, 100% { transform: translateY(0) scale(1); opacity: 0.75; }
	50% { transform: translateY(6%) scale(1.05); opacity: 1; }
}

@keyframes tcf-wave-bronze {
	0%, 100% { transform: translateX(0) translateY(0); opacity: 0.7; }
	50% { transform: translateX(4%) translateY(5%); opacity: 1; }
}

@keyframes tcf-wave-silver {
	0%, 100% { transform: translateX(0) translateY(0); opacity: 0.65; }
	50% { transform: translateX(-4%) translateY(6%); opacity: 1; }
}

@keyframes tcf-wave-gold {
	0%, 100% { transform: translateX(0) translateY(0) scale(1); opacity: 0.7; }
	50% { transform: translateX(3%) translateY(5%) scale(1.06); opacity: 1; }
}

@keyframes tcf-wave-bar {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

@keyframes tcf-gold-blink {
	0%, 100% { background-position: 0% 50%; filter: brightness(1); }
	50% { background-position: 100% 50%; filter: brightness(1.25); }
}

@media (max-width: 1180px) {
	.tcf-pricing__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		/* 2 cartes × 4 rangées = 8 rangées subgrid */
		grid-template-rows: auto auto auto 1fr auto auto auto 1fr;
		row-gap: 1.25rem;
	}

	.tcf-plan {
		grid-row: span 4;
	}
}

@media (max-width: 640px) {
	.tcf-pricing__grid {
		grid-template-columns: 1fr;
		grid-template-rows: none;
		row-gap: 1.5rem;
	}

	.tcf-plan {
		display: flex;
		flex-direction: column;
		grid-row: auto;
		grid-template-rows: none;
		padding: 1.5rem 1.2rem 1.35rem;
	}

	.tcf-plan--featured {
		margin-top: 0.5rem;
	}

	.tcf-plan__options-slot {
		min-height: 0;
		padding: 0.75rem 0;
	}

	.tcf-plan__val {
		max-width: 9rem;
	}
}

/* Fallback si subgrid non supporté : hauteurs fixes calées sur la carte la plus haute */
@supports not (grid-template-rows: subgrid) {
	.tcf-pricing__grid {
		grid-template-rows: none;
		gap: 1.25rem;
	}

	.tcf-plan {
		display: flex;
		flex-direction: column;
		grid-row: auto;
	}

	.tcf-plan__head {
		min-height: 10.5rem;
	}

	.tcf-plan__options-slot {
		min-height: 3.1rem;
	}

	.tcf-plan__compare {
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tcf-plan,
	.tcf-plan__price-btn,
	.tcf-plan::before,
	.tcf-plan::after,
	.tcf-plan__val--gold,
	.tcf-plan--featured .tcf-plan__head::before {
		animation: none !important;
		transition: none;
	}

	.tcf-plan:hover,
	.tcf-plan__price-btn:hover {
		transform: none;
	}

	.tcf-plan__val--gold {
		color: #a16207;
		background: none;
		-webkit-background-clip: unset;
		background-clip: unset;
	}
}
