/* ==========================================================================
   TextCRM How It Works Widget  —  "Three steps to autopilot." scrub timeline
   --------------------------------------------------------------------------
   A premium onboarding / process section: a centered editorial header (optional
   pill badge → display headline with an Instrument-Serif italic highlight) above
   a zig-zag timeline. A vertical spine runs down the centre; as the visitor
   scrolls, an accent "fill" draws down the spine and each node-dot lights up the
   moment the fill reaches it, while the alternating step cards fade + rise in.

   Layout : centered container; the timeline is a 2-column grid (card | spacer)
            that alternates sides per step and collapses to a single left rail
            (spine at the far left) on small screens.
   Type   : Space Grotesk (display) · Manrope (body + labels)
            · Instrument Serif (italic highlight accent).
   Palette: accent #42c67a · sunken bg #0a1122 · card surface #0f1a32 (shared
            with the Hero).
   Motion : GSAP ScrollTrigger scrub (spine fill + dot lighting) + staggered
            scroll reveal. Degrades to the static resting state without JS and
            under prefers-reduced-motion.

   Every visual token is a CSS custom property so the Elementor Style tab (and the
   global Light color-mode layer) can re-skin the section without forking this file.
   ========================================================================== */

.textcrm-how {
	/* ---- Theme tokens (overridable from the Elementor Style tab) ---- */
	--hw-bg:         #0a1122;
	--hw-surface:    #0f1a32;
	--hw-text:       #eaf0fb;
	--hw-muted:      #93a1bd;
	--hw-muted-2:    #5e6d8c;
	--hw-accent:     #42c67a;
	--hw-accent-2:   #00c98a;
	--hw-accent-dim: rgba(66, 198, 122, 0.10);
	--hw-ink:        #04211a; /* readable text on the accent */
	--hw-line:       rgba(255, 255, 255, 0.07);
	--hw-line-2:     rgba(255, 255, 255, 0.13);
	--hw-glow:       rgba(66, 198, 122, 0.16);
	--hw-glow-2:     rgba(0, 201, 138, 0.12);
	--hw-grid:       rgba(255, 255, 255, 0.05);

	--hw-font-display: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--hw-font-body:    'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--hw-font-mono:    'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--hw-font-accent:  'Instrument Serif', 'Times New Roman', Georgia, serif;

	--hw-maxw:     1200px;
	--hw-gutter:   24px;
	--hw-step-gap: 90px;   /* vertical gap between steps */
	--hw-col-gap:  50px;   /* horizontal gap card ↔ spine (zig-zag) */
	--hw-ease:     cubic-bezier(0.22, 0.61, 0.36, 1);

	position: relative;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
	padding-block: clamp(80px, 12vh, 150px);
	background-color: var(--hw-bg);
	color: var(--hw-text);
	font-family: var(--hw-font-body);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.textcrm-how *,
.textcrm-how *::before,
.textcrm-how *::after {
	box-sizing: border-box;
}

.textcrm-how ::selection {
	background: var(--hw-accent);
	color: var(--hw-ink);
}

/* --------------------------------------------------------------------------
   Layered backdrop — a masked dot-grid texture for depth + soft brand aurora
   blooms behind the timeline. Composes over the section's base colour so the
   white/dark surface never reads flat.
   -------------------------------------------------------------------------- */
.textcrm-how__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

/* Dotted grid, faded toward the edges with a radial mask so it never hits a
   hard rectangle — strongest behind the header / upper timeline. */
.textcrm-how__grid {
	position: absolute;
	inset: -1px;
	background-image: radial-gradient(var(--hw-grid) 1.1px, transparent 1.2px);
	background-size: 28px 28px;
	background-position: center top;
	-webkit-mask-image: radial-gradient(125% 85% at 50% 26%, #000 0%, rgba(0, 0, 0, 0.5) 48%, transparent 78%);
	mask-image: radial-gradient(125% 85% at 50% 26%, #000 0%, rgba(0, 0, 0, 0.5) 48%, transparent 78%);
	pointer-events: none;
}

/* Aurora blooms. */
.textcrm-how__glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(150px);
	pointer-events: none;
}

.textcrm-how__glow--1 {
	top: -8%;
	left: 50%;
	width: 840px;
	height: 560px;
	max-width: 96vw;
	transform: translateX(-50%);
	background: var(--hw-glow);
}

.textcrm-how__glow--2 {
	bottom: -14%;
	right: 4%;
	width: 540px;
	height: 440px;
	max-width: 82vw;
	background: var(--hw-glow-2);
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.textcrm-how__container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--hw-maxw);
	margin: 0 auto;
	padding-left: var(--hw-gutter);
	padding-right: var(--hw-gutter);
}

/* --------------------------------------------------------------------------
   Header — centered editorial column (eyebrow → title → lead).
   -------------------------------------------------------------------------- */
.textcrm-how__head {
	margin-bottom: clamp(48px, 7vw, 80px);
	text-align: center;
}

/* Eyebrow / badge pill (mirrors the Hero badge). */
.textcrm-how__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 20px;
	padding: 7px 14px;
	border: 1px solid rgba(66, 198, 122, 0.24);
	border-radius: 999px;
	background: rgba(66, 198, 122, 0.10);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	font-family: var(--hw-font-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #bfe9d2;
	line-height: 1;
}

.textcrm-how__eyebrow-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--hw-accent);
	box-shadow: 0 0 0 0 rgba(66, 198, 122, 0.55);
	animation: textcrm-how-pulse 2.4s ease-out infinite;
	flex-shrink: 0;
}

@keyframes textcrm-how-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(66, 198, 122, 0.5); }
	70%  { box-shadow: 0 0 0 8px rgba(66, 198, 122, 0); }
	100% { box-shadow: 0 0 0 0 rgba(66, 198, 122, 0); }
}

.textcrm-how__title {
	margin: 0 auto;
	max-width: 18ch;
	font-family: var(--hw-font-display);
	font-weight: 700;
	font-size: clamp(32px, 4.4vw, 56px);
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--hw-text);
}

/* Elegant italic highlight — same treatment as the Hero headline accent. */
.textcrm-how__title-accent {
	font-family: var(--hw-font-accent);
	font-style: italic;
	font-weight: 400;
	font-size: 1.1em;
	letter-spacing: 0;
	color: var(--hw-accent);
}

.textcrm-how__lead {
	margin: 18px auto 0;
	max-width: 56ch;
	font-family: var(--hw-font-body);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.6;
	color: var(--hw-muted);
}

/* --------------------------------------------------------------------------
   Timeline column
   -------------------------------------------------------------------------- */
.textcrm-how__line {
	position: relative;
	max-width: 880px;
	margin: 0 auto;
}

/* The vertical spine running down the centre, with its accent fill. */
.textcrm-how__spine {
	position: absolute;
	left: 50%;
	top: 6px;
	bottom: 6px;
	width: 2px;
	border-radius: 2px;
	background: var(--hw-line);
	transform: translateX(-50%);
}

.textcrm-how__fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0%;          /* grown by GSAP on scroll; 0 at rest (no-JS) */
	border-radius: 2px;
	background: var(--hw-accent);
	box-shadow: 0 0 14px var(--hw-accent);
	will-change: height;
}

/* --------------------------------------------------------------------------
   Steps — a 2-column grid (card | spacer) that alternates sides per step.
   -------------------------------------------------------------------------- */
.textcrm-how__step {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--hw-col-gap);
	align-items: center;
	margin-bottom: var(--hw-step-gap);
}

.textcrm-how__step:last-child {
	margin-bottom: 0;
}

/* Card / spacer placement per side. */
.textcrm-how__step.is-left .textcrm-how__card { grid-column: 1; }
.textcrm-how__step.is-left .textcrm-how__spacer { grid-column: 2; }
.textcrm-how__step.is-right .textcrm-how__card { grid-column: 2; }
.textcrm-how__step.is-right .textcrm-how__spacer { grid-column: 1; }

.textcrm-how__spacer {
	min-height: 1px;
}

/* The node dot sitting on the spine. */
.textcrm-how__dot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--hw-bg);
	border: 2px solid var(--hw-line-2);
	transform: translate(-50%, -50%);
	transition: border-color 0.4s var(--hw-ease), box-shadow 0.4s var(--hw-ease), transform 0.4s var(--hw-ease);
	z-index: 2;
}

.textcrm-how__step.is-lit .textcrm-how__dot {
	border-color: var(--hw-accent);
	box-shadow: 0 0 16px var(--hw-accent);
}

/* A small pulse ring fired by JS the moment a dot lights up. */
.textcrm-how__dot::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 1px solid var(--hw-accent);
	opacity: 0;
	transform: scale(0.6);
}

.textcrm-how__step.is-lit .textcrm-how__dot::after {
	animation: textcrm-how-ring 0.7s var(--hw-ease) forwards;
}

@keyframes textcrm-how-ring {
	0%   { opacity: 0.7; transform: scale(0.6); }
	100% { opacity: 0;   transform: scale(1.9); }
}

/* The step card. */
.textcrm-how__card {
	position: relative;
	min-width: 0;
	background: var(--hw-surface);
	border: 1px solid var(--hw-line-2);
	border-radius: 14px;
	padding: 28px;
	transition: transform 0.4s var(--hw-ease), border-color 0.4s var(--hw-ease), box-shadow 0.4s var(--hw-ease);
}

.textcrm-how__card:hover {
	transform: translateY(-4px);
	border-color: rgba(66, 198, 122, 0.32);
}

/* When the spine fill has reached this step, tint its card border to match. */
.textcrm-how__step.is-lit .textcrm-how__card {
	border-color: rgba(66, 198, 122, 0.28);
}

.textcrm-how__num {
	font-family: var(--hw-font-display);
	font-size: 46px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--hw-accent);
	opacity: 0.9;
	margin-bottom: 14px;
}

.textcrm-how__card-title {
	margin: 0 0 10px;
	font-family: var(--hw-font-display);
	font-weight: 600;
	font-size: 23px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--hw-text);
}

.textcrm-how__card-desc {
	margin: 0;
	font-family: var(--hw-font-body);
	font-weight: 400;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--hw-muted);
}

/* --------------------------------------------------------------------------
   Stacked layout (zig-zag off) — single left-aligned rail, spine on the left.
   -------------------------------------------------------------------------- */
.textcrm-how--stacked .textcrm-how__line {
	max-width: 720px;
}

.textcrm-how--stacked .textcrm-how__spine {
	left: 15px;
}

.textcrm-how--stacked .textcrm-how__step {
	grid-template-columns: 1fr;
	gap: 0;
	padding-left: 56px;
}

.textcrm-how--stacked .textcrm-how__step .textcrm-how__card {
	grid-column: 1;
}

.textcrm-how--stacked .textcrm-how__dot {
	left: 15px;
}

/* No-spine variant: drop the inset that made room for the rail. */
.textcrm-how--no-line.textcrm-how--stacked .textcrm-how__step {
	padding-left: 0;
}

/* --------------------------------------------------------------------------
   Entrance motion — pre-hidden states apply only while JS has NOT claimed the
   section (`:not(.is-gsap)`). Once the script runs it adds `.is-gsap` and drives
   everything via GSAP inline styles. The <noscript> failsafe (printed by PHP)
   and the reduced-motion block both force the resting state, so the section is
   always visible without JS.
   -------------------------------------------------------------------------- */
.textcrm-how--reveal:not(.is-gsap) .textcrm-how__animate {
	opacity: 0;
	transform: translateY(28px);
}

/* --------------------------------------------------------------------------
   Responsive — collapse to a single left rail.
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
	.textcrm-how {
		--hw-gutter: 18px;
	}
	.textcrm-how__title {
		max-width: 100%;
	}
	.textcrm-how__spine {
		left: 15px;
	}
	.textcrm-how__step,
	.textcrm-how__step.is-left,
	.textcrm-how__step.is-right {
		grid-template-columns: 1fr;
		gap: 0;
		padding-left: 52px;
	}
	.textcrm-how__step .textcrm-how__card,
	.textcrm-how__step.is-right .textcrm-how__card {
		grid-column: 1;
	}
	.textcrm-how__dot {
		left: 15px;
	}
	.textcrm-how__spacer {
		display: none;
	}
	.textcrm-how--no-line .textcrm-how__step {
		padding-left: 0;
	}
	.textcrm-how__num {
		font-size: 40px;
	}
}

@media (max-width: 420px) {
	.textcrm-how__card {
		padding: 22px;
	}
	.textcrm-how__card-title {
		font-size: 20px;
	}
}

/* --------------------------------------------------------------------------
   Reduced motion — show the resting state immediately, no motion.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.textcrm-how *,
	.textcrm-how *::before,
	.textcrm-how *::after {
		animation: none !important;
		transition: none !important;
	}
	.textcrm-how--reveal .textcrm-how__animate {
		opacity: 1 !important;
		transform: none !important;
	}
}
