/* ==========================================================================
   Benefits Flip Cards for Elementor
   Front: icon + title + description | Back: marker-line benefit list
   ========================================================================== */

.bfc-wrap {
	--bfc-auto-h: 0px;
}

.bfc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
	align-items: stretch;
}

/* ---------- Card shell ---------------------------------------------------- */

.bfc-card {
	position: relative;
	width: 100%;
	max-width: 528px;
	margin-inline: auto;
	perspective: 2000px;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.bfc-card-inner {
	--bfc-min-h: 480px;
	--bfc-speed: 700ms;
	position: relative;
	width: 100%;
	height: max(var(--bfc-min-h), var(--bfc-auto-h, 0px));
	transform-style: preserve-3d;
	transition: transform var(--bfc-speed) cubic-bezier(0.4, 0.15, 0.2, 1);
	will-change: transform;
}

.bfc-face {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 72px 40px;
	background-color: #ffffff;
	border: 1px solid #d8e0e8;
	border-radius: 24px;
	overflow: hidden;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	transform: translateZ(0);
}

.bfc-front {
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	z-index: 2;
}

.bfc-back {
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
	padding: 88px 72px;
	z-index: 1;
}

/* ---------- Flip directions ---------------------------------------------- */

.bfc-flip-left {
	--bfc-rot: rotateY(-180deg);
	--bfc-back-rot: rotateY(180deg);
}

.bfc-flip-right {
	--bfc-rot: rotateY(180deg);
	--bfc-back-rot: rotateY(180deg);
}

.bfc-flip-up {
	--bfc-rot: rotateX(180deg);
	--bfc-back-rot: rotateX(180deg);
}

.bfc-flip-down {
	--bfc-rot: rotateX(-180deg);
	--bfc-back-rot: rotateX(180deg);
}

.bfc-back {
	transform: var(--bfc-back-rot, rotateY(180deg));
}

.bfc-card.is-flipped .bfc-card-inner,
.bfc-card:focus-visible .bfc-card-inner {
	transform: var(--bfc-rot, rotateY(180deg));
}

@media (hover: hover) and (pointer: fine) {
	.bfc-trigger-hover .bfc-card:hover .bfc-card-inner {
		transform: var(--bfc-rot, rotateY(180deg));
	}
}

.bfc-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 24px;
}

/* ---------- Front content ------------------------------------------------- */

.bfc-front-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 136px;
	margin-bottom: 48px;
	flex: 0 0 auto;
}

.bfc-front-icon img {
	display: block;
	width: 160px;
	height: auto;
	max-width: 100%;
}

.bfc-front-title {
	margin: 0 0 16px;
	max-width: 320px;
	font-size: 30px;
	line-height: 40px;
	font-weight: 700;
	color: #003057;
}

.bfc-front-desc {
	margin: 0;
	max-width: 320px;
	font-size: 18px;
	line-height: 28px;
	font-weight: 400;
	letter-spacing: 0.025em;
	color: #000000;
}

/* ---------- Back content -------------------------------------------------- */

.bfc-back-title {
	margin: 0 0 24px;
	font-size: 24px;
	line-height: 32px;
	font-weight: 700;
	color: #003057;
}

.bfc-list {
	--bfc-marker-size: 16px;
	--bfc-marker-stroke: 1px;
	--bfc-marker-color: #003057;
	--bfc-marker-fill: #ffffff;
	--bfc-marker-nudge: 0px;
	--bfc-line-w: 3px;
	--bfc-line-color: #003057;
	--bfc-item-gap: 16px;
	--bfc-text-offset: 24px;
	--bfc-text-w: 344px;
	--bfc-marker-offset: calc((1.5556em - var(--bfc-marker-size)) / 2 + var(--bfc-marker-nudge));

	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	font-size: 18px;
	line-height: 28px;
	font-weight: 400;
	letter-spacing: 0.025em;
}

@supports (height: 1lh) {
	.bfc-list {
		--bfc-marker-offset: calc((1lh - var(--bfc-marker-size)) / 2 + var(--bfc-marker-nudge));
	}
}

.bfc-list-item {
	position: relative;
	display: grid;
	grid-template-columns: var(--bfc-marker-size) minmax(0, var(--bfc-text-w));
	column-gap: var(--bfc-text-offset);
	align-items: start;
}

.bfc-list-item + .bfc-list-item {
	margin-top: var(--bfc-item-gap);
}

/* connector segment: this marker centre -> next marker centre */
.bfc-list-item::before {
	content: "";
	position: absolute;
	left: calc((var(--bfc-marker-size) - var(--bfc-line-w)) / 2);
	top: calc(var(--bfc-marker-offset) + (var(--bfc-marker-size) / 2));
	width: var(--bfc-line-w);
	height: calc(100% + var(--bfc-item-gap));
	background-color: var(--bfc-line-color);
	border-radius: calc(var(--bfc-line-w) / 2);
	pointer-events: none;
}

.bfc-list-item:last-child::before {
	display: none;
}

.bfc-line-extend .bfc-list-item:first-child::before {
	top: 0;
	height: calc(100% + var(--bfc-item-gap));
}

.bfc-line-extend .bfc-list-item:last-child::before {
	display: block;
	top: var(--bfc-marker-offset);
	height: calc(100% - var(--bfc-marker-offset));
}

.bfc-line-extend .bfc-list-item:only-child::before {
	top: 0;
	height: 100%;
}

.bfc-marker {
	position: relative;
	z-index: 1;
	display: block;
	box-sizing: border-box;
	width: var(--bfc-marker-size);
	height: var(--bfc-marker-size);
	margin-top: var(--bfc-marker-offset);
	border: var(--bfc-marker-stroke) solid var(--bfc-marker-color);
	border-radius: 50%;
	background-color: var(--bfc-marker-fill);
	flex: 0 0 auto;
}

.bfc-list-text {
	display: block;
	color: #000000;
	max-width: 100%;
}

/* ---------- Measuring state (used by JS, never painted) ------------------- */

.bfc-wrap.bfc-measuring .bfc-card-inner {
	height: auto;
	transition: none !important;
	transform: none !important;
}

.bfc-wrap.bfc-measuring .bfc-face {
	position: relative;
	inset: auto;
	transform: none !important;
	backface-visibility: visible;
}

/* ---------- No-JS / reduced motion --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.bfc-card-inner {
		transition: none;
	}
}

/* ---------- Responsive fallbacks ----------------------------------------- */

@media (max-width: 1024px) {
	.bfc-grid {
		gap: 24px;
	}
}

@media (max-width: 767px) {
	.bfc-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.bfc-face {
		padding: 40px 24px;
	}

	.bfc-back {
		padding: 40px 24px;
	}

	.bfc-front-icon {
		min-height: 124px;
		margin-bottom: 28px;
	}

	.bfc-front-icon img {
		width: 120px;
	}

	.bfc-front-title,
	.bfc-front-desc {
		max-width: 100%;
	}

	.bfc-list {
		--bfc-text-offset: 16px;
		--bfc-text-w: 100%;
	}
}
