/* ==========================================================================
   KitMaestro Funnel Conversion Toolkit (Russell Brunson / ClickFunnels Style)
   Multi-Step Forms, 2-Step Opt-In Modals, Value Stacks, Urgency Bars & Timers
   ========================================================================== */

/* 1. Multi-Step Lead Capture Form */
.km-multistep {
	width: 100%;
}

.km-ms-header {
	margin-bottom: 1.35rem;
}

.km-ms-progress-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	margin-bottom: 0.5rem;
}

.km-ms-progress-track {
	width: 100%;
	height: 10px;
	background-color: var(--wp--preset--color--primary-light);
	border-radius: 50px;
	overflow: hidden;
}

.km-ms-progress-bar {
	height: 100%;
	width: 33%;
	background: linear-gradient(90deg, var(--wp--preset--color--primary) 0%, var(--wp--preset--color--success) 100%);
	border-radius: 50px;
	transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.km-ms-steps-pills {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.km-ms-pill {
	flex: 1;
	text-align: center;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.72rem;
	font-weight: 700;
	padding: 0.3rem 0.45rem;
	border-radius: 50px;
	background-color: #f1f5f9;
	color: #64748b;
	transition: all 0.25s ease;
}

.km-ms-pill.is-active {
	background-color: var(--wp--preset--color--primary-light);
	color: var(--wp--preset--color--primary);
	font-weight: 800;
}

.km-ms-pill.is-done {
	background-color: var(--wp--preset--color--success-light);
	color: var(--wp--preset--color--success-dark);
}

/* Step Panels */
.km-ms-step {
	display: none;
	flex-direction: column;
	gap: 0.95rem;
	animation: kmStepFade 0.28s ease both;
}

.km-ms-step.is-active {
	display: flex;
}

/* Keep steps visible inside Gutenberg Editor so admin can inspect/edit */
.editor-styles-wrapper .km-ms-step {
	display: flex;
	padding-top: 0.75rem;
	border-top: 1px dashed #cbd5e1;
}

@keyframes kmStepFade {
	from {
		opacity: 0;
		transform: translateX(8px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.km-ms-question {
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--wp--preset--color--contrast);
	margin: 0 0 0.25rem;
	line-height: 1.3;
}

/* Micro-commitment Clickable Choice Cards */
.km-choice-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

@media (max-width: 480px) {
	.km-choice-grid {
		grid-template-columns: 1fr;
	}
}

.km-choice-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.85rem 1rem;
	border-radius: 16px;
	border: 1.5px solid var(--wp--preset--color--primary-light);
	background-color: #ffffff;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
	transition: all 0.2s ease;
}

.km-choice-card:hover {
	border-color: var(--wp--preset--color--primary);
	background-color: #f8fbff;
	transform: translateY(-2px);
}

.km-choice-card input[type="radio"] {
	accent-color: var(--wp--preset--color--primary);
	width: 18px;
	height: 18px;
	margin: 0;
	flex-shrink: 0;
}

.km-choice-card:has(input:checked),
.km-choice-card.is-selected {
	border-color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--primary-light);
	color: var(--wp--preset--color--primary);
	box-shadow: 0 6px 16px rgba(0, 92, 188, 0.1);
}

/* Step Navigation Buttons */
.km-ms-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.km-btn-back {
	background: #f1f5f9;
	color: #475569;
	border: none;
	border-radius: 14px;
	padding: 0.9rem 1.15rem;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.km-btn-back:hover {
	background: #e2e8f0;
}

.km-btn-next {
	flex: 1;
	background-color: var(--wp--preset--color--primary);
	color: #ffffff;
	border: none;
	border-radius: 16px;
	padding: 0.95rem 1.4rem;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.98rem;
	font-weight: 800;
	cursor: pointer;
	box-shadow: var(--wp--preset--shadow--km-button);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.km-btn-next:hover {
	background-color: var(--wp--preset--color--primary-dark);
	transform: translateY(-2px);
}

/* Validation feedback */
.km-ms-error {
	display: none;
	font-size: 0.8rem;
	font-weight: 600;
	color: #dc2626;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 12px;
	padding: 0.55rem 0.85rem;
}

.km-ms-error.is-visible {
	display: block;
}

.km-input-invalid {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14) !important;
}

/* Success state inside Multi-Step card */
.km-ms-success-badge {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--success-light);
	color: var(--wp--preset--color--success-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 0.5rem;
	font-size: 1.5rem;
	font-weight: 900;
}

/* 2. ClickFunnels Double-Line Giant CTA Button (.km-cf-cta) */
.km-cf-cta {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	width: 100%;
	max-width: 560px;
	padding: 1.15rem 2rem;
	border-radius: 18px;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #ffffff !important;
	text-decoration: none !important;
	text-align: center;
	border: none;
	cursor: pointer;
	box-shadow: 0 16px 34px rgba(16, 185, 129, 0.32);
	transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.km-cf-cta:hover {
	transform: translateY(-3px);
	box-shadow: 0 22px 42px rgba(16, 185, 129, 0.42);
	filter: brightness(1.03);
	color: #ffffff !important;
	text-decoration: none !important;
}

.km-cf-cta__main {
	font-family: var(--wp--preset--font-family--outfit);
	font-size: clamp(1.05rem, 2.2vw, 1.35rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.km-cf-cta__sub {
	font-family: var(--wp--preset--font-family--inter);
	font-size: 0.78rem;
	font-weight: 500;
	opacity: 0.92;
	line-height: 1.3;
}

/* 3. 2-Step Opt-In Popup Modal */
.km-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.km-modal-backdrop.is-open {
	display: flex;
}

/* Previewable inside Gutenberg Editor without covering screen */
.editor-styles-wrapper .km-modal-backdrop {
	position: relative;
	inset: auto;
	display: flex;
	background: rgba(15, 23, 42, 0.06);
	border-radius: 28px;
	padding: 1.5rem;
	margin-top: 1rem;
}

.km-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 500px;
	background: #ffffff;
	border-radius: 32px;
	border: 1px solid var(--wp--preset--color--primary-light);
	padding: 2.25rem 2rem;
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
	animation: kmModalPop 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes kmModalPop {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(12px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.km-modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #475569;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.km-modal-close:hover {
	background: #fee2e2;
	color: #dc2626;
}

/* 4. Evergreen / Deadline Countdown Timer */
.km-countdown {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.km-cd-box {
	min-width: 62px;
	padding: 0.5rem 0.7rem;
	border-radius: 14px;
	background: rgba(15, 23, 42, 0.92);
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.1;
}

.km-cd-num {
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 1.35rem;
	font-weight: 900;
	color: #fbbf24;
}

.km-cd-label {
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #cbd5e1;
	margin-top: 0.15rem;
}

/* 5. Russell Brunson Value Stack & Sales Letter Highlights */
.km-highlight-yellow {
	background: linear-gradient(180deg, transparent 55%, #fef08a 55%);
	padding: 0 0.2em;
	color: var(--wp--preset--color--contrast);
	font-weight: 800;
}

.km-strike-price {
	text-decoration: line-through;
	text-decoration-color: #ef4444;
	text-decoration-thickness: 2.5px;
	color: #64748b;
}

.km-stack-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.95rem 1.15rem;
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--primary-light);
}

.km-stack-value {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 800;
	font-size: 0.85rem;
	color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary-light);
	padding: 0.3rem 0.75rem;
	border-radius: 50px;
	white-space: nowrap;
}

/* Funnel Step Progress Bar (OTO / Upsell Header) */
.km-funnel-steps-bar {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border-radius: 50px;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--primary-border);
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.8rem;
	font-weight: 800;
}

.km-funnel-steps-bar__done {
	background: var(--wp--preset--color--success-light);
	color: var(--wp--preset--color--success-dark);
	padding: 0.65rem 1rem;
	text-align: center;
}

.km-funnel-steps-bar__current {
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	padding: 0.65rem 1rem;
	text-align: center;
}

/* Old Way vs New Way Lists */
ul.km-x-list {
	list-style: none !important;
	padding-left: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

ul.km-x-list > li {
	position: relative;
	padding-left: 2.25rem;
	line-height: 1.5;
}

ul.km-x-list > li::before {
	content: "✕";
	position: absolute;
	left: 0;
	top: 0.1rem;
	width: 1.55rem;
	height: 1.55rem;
	border-radius: 8px;
	background-color: #fef2f2;
	color: #dc2626;
	font-family: var(--wp--preset--font-family--outfit);
	font-size: 0.8rem;
	font-weight: 900;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
