/* 5th Axis — ROI Calculator (stepper + form panels + live summary) */

.axis5th-roi {
	--axis5th-roi-accent: #dd2828;
	--axis5th-roi-border: #e4e4e7;
	--axis5th-roi-heading: #18181b;
	--axis5th-roi-text: #71717a;
	--axis5th-roi-upcoming: #d4d4d8;
	--axis5th-roi-step-label: #71717a;
	--axis5th-roi-summary-bg: #0d0d0d;
	--axis5th-roi-summary-text: #f5f5f5;
	--axis5th-roi-summary-muted: #9a9a9a;

	background: #ffffff;
	border: 1px solid var( --axis5th-roi-border );
	max-width: 1100px;
	margin: 0 auto;
	padding: 48px clamp( 20px, 4vw, 48px );
}

.axis5th-highlight {
	color: var( --axis5th-roi-accent );
}

.axis5th-roi__print-heading {
	display: none;
}

/* ── Rail ─────────────────────────────────────────────────── */
/* One flex row: dot-column, line, dot-column, line, … — the line is a
   plain flex sibling between dot-columns rather than an absolutely
   positioned overlay, so it can never mis-measure against label width. */

.axis5th-roi__rail {
	display: flex;
	align-items: flex-start;
	margin-bottom: 40px;
}

.axis5th-roi__rail-step {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.axis5th-roi__rail-line {
	flex: 1 1 auto;
	align-self: flex-start;
	margin-top: 13px;
	height: 2px;
	min-width: 16px;
	background: var( --axis5th-roi-upcoming );
}

.axis5th-roi__rail-dot {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid var( --axis5th-roi-upcoming );
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	flex-shrink: 0;
}

.axis5th-roi__rail-dot::after {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: transparent;
}

.axis5th-roi__rail-check {
	display: none;
	color: #ffffff;
	font-size: 13px;
	line-height: 1;
}

.axis5th-roi__rail-label {
	margin-top: 10px;
	font-size: 12px;
	color: var( --axis5th-roi-step-label );
	white-space: nowrap;
}

/* Done */
.axis5th-roi__rail-step.is-done .axis5th-roi__rail-dot {
	background: var( --axis5th-roi-accent );
	border-color: var( --axis5th-roi-accent );
}

.axis5th-roi__rail-step.is-done .axis5th-roi__rail-check {
	display: block;
}

.axis5th-roi__rail-step.is-done .axis5th-roi__rail-dot::after {
	display: none;
}

.axis5th-roi__rail-line.is-done {
	background: var( --axis5th-roi-accent );
}

/* Active */
.axis5th-roi__rail-step.is-active .axis5th-roi__rail-dot {
	border-color: var( --axis5th-roi-accent );
}

.axis5th-roi__rail-step.is-active .axis5th-roi__rail-dot::after {
	background: var( --axis5th-roi-accent );
}

.axis5th-roi__rail-step.is-active .axis5th-roi__rail-label {
	color: var( --axis5th-roi-heading );
	font-weight: 600;
}

/* ── Body layout ──────────────────────────────────────────── */

.axis5th-roi__body {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 48px;
	align-items: start;
}

.axis5th-roi__panel {
	display: none;
}

.axis5th-roi__panel.is-active {
	display: block;
}

.axis5th-roi__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.axis5th-roi__step-label {
	font-family: var(--e-global-typography-57475c0-font-family), Sans-serif;
	font-size: 16px;
	font-weight: 400;
	text-transform: uppercase;
	color: var( --axis5th-roi-accent );
	margin-bottom: 6px;
}

.axis5th-roi__title {
	font-size: 32px;
	font-weight: 700;
	color: var( --axis5th-roi-heading );
	line-height: 1.15;
	margin: 0;
}

.axis5th-roi__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: 1px solid var( --e-global-color-primary );
	color: var( --axis5th-roi-heading );
	font-size: 14px;
	font-weight: 500;
	padding: 8px 14px;
	cursor: pointer;
	white-space: nowrap;
}

.axis5th-roi__reset:hover {
	background: var( --e-global-color-primary );
	color: var( --axis5th-roi-heading );
	border-color: var( --axis5th-roi-accent );
	color: #fff;
}

.axis5th-roi__desc {
	color: var( --axis5th-roi-text );
	font-size: 14px;
	line-height: 1.6;
	max-width: 46em;
	margin: 12px 0 28px;
}

/* ── Fields ───────────────────────────────────────────────── */

.axis5th-roi__fields {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-bottom: 24px;
}

.axis5th-roi__field-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 10px;
}

.axis5th-roi__field-label {
	font-family: var(--e-global-typography-57475c0-font-family), Sans-serif;
	font-size: 16px;
	font-weight: 400;
	text-transform: uppercase;
	color: var( --axis5th-roi-heading );
}

.axis5th-roi__field-value {
	font-size: 13px;
	font-weight: 600;
	color: var( --axis5th-roi-accent );
}

.axis5th-roi__slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient( to right, var( --axis5th-roi-accent ) 0%, var( --axis5th-roi-accent ) var( --fill, 0% ), var( --axis5th-roi-border ) var( --fill, 0% ), var( --axis5th-roi-border ) 100% );
	outline: none;
	cursor: pointer;
	margin: 0;
}

.axis5th-roi__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	background: var( --axis5th-roi-accent );
	cursor: pointer;
	margin-top: 0;
	border: none;
}

.axis5th-roi__slider::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: var( --axis5th-roi-accent );
	cursor: pointer;
	border: none;
	border-radius: 0;
}

.axis5th-roi__slider::-moz-range-track {
	height: 4px;
	background: var( --axis5th-roi-border );
}

.axis5th-roi__slider::-moz-range-progress {
	height: 4px;
	background: var( --axis5th-roi-accent );
}

.axis5th-roi__text-input {
	position: relative;
	display: flex;
	align-items: center;
}

.axis5th-roi__text-input input {
	width: 100%;
	border: 1px solid var( --axis5th-roi-border );
	background: #ffffff;
	padding: 12px 34px 12px 14px;
	font-size: 14px;
	color: var( --axis5th-roi-heading );
}

.axis5th-roi__text-input input:focus {
	outline: none;
	border-color: var( --axis5th-roi-accent );
}

.axis5th-roi__text-suffix {
	position: absolute;
	right: 14px;
	color: var( --axis5th-roi-text );
	font-size: 13px;
	pointer-events: none;
}

.axis5th-roi__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: -8px;
}

.axis5th-roi__chip {
	border: 1px solid var( --axis5th-roi-border );
	padding: 6px 12px;
	font-size: 12px;
	color: var( --axis5th-roi-text );
}

.axis5th-roi__pill-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #f4f4f5;
	padding: 8px;
	margin-top: 8px;
}

.axis5th-roi__pill {
	flex: 1 1 auto;
	background: #ffffff;
	border: 1px solid var( --axis5th-roi-border );
	color: var( --axis5th-roi-heading );
	font-size: 13px;
	padding: 10px 14px;
	cursor: pointer;
	white-space: nowrap;
}

.axis5th-roi__pill.is-active {
	background: var( --axis5th-roi-accent );
	border-color: var( --axis5th-roi-accent );
	color: #ffffff;
}

/* ── Note ─────────────────────────────────────────────────── */

.axis5th-roi__note {
	background: #f4f4f5;
	border-left: 3px solid var( --axis5th-roi-accent );
	padding: 16px 20px;
	margin-bottom: 28px;
}

.axis5th-roi__note strong {
	display: block;
	font-size: 15px;
	color: var( --axis5th-roi-heading );
	margin-bottom: 6px;
}

.axis5th-roi__note p {
	font-size: 13px;
	color: var( --axis5th-roi-text );
	line-height: 1.6;
	margin: 0;
}

/* ── Nav ──────────────────────────────────────────────────── */

.axis5th-roi__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.axis5th-roi__back,
.axis5th-roi__next {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	padding: 12px 20px;
	cursor: pointer;
	border: 1px solid var( --axis5th-roi-border );
	background: #ffffff;
	color: var( --axis5th-roi-heading );
}

.axis5th-roi__next {
	background: var( --axis5th-roi-accent );
	border-color: var( --axis5th-roi-accent );
	color: #ffffff;
}

.axis5th-roi__back:hover {
	border-color: var( --axis5th-roi-accent );
	color: var( --axis5th-roi-accent );
}

.axis5th-roi__next:hover {
	opacity: 0.9;
}

/* ── Summary panel ────────────────────────────────────────── */

.axis5th-roi__summary {
	position: sticky;
	top: 24px;
}

.axis5th-roi__summary-head {
	font-family: var(--e-global-typography-57475c0-font-family), Sans-serif;
	background: var( --axis5th-roi-accent );
	color: #ffffff;
	font-size: 16px;
	font-weight: 400;
	text-transform: uppercase;
	padding: 12px 20px;
}

.axis5th-roi__summary-body {
	background: var( --axis5th-roi-summary-bg );
	color: var( --axis5th-roi-summary-text );
	padding: 24px 20px;
}

.axis5th-roi__metric {
	padding: 14px 0;
	border-bottom: 1px solid rgba( 255, 255, 255, 0.1 );
}

.axis5th-roi__metric:first-child {
	padding-top: 0;
}

.axis5th-roi__metric-label {
	font-size: 14px;
	font-weight: 400;
	text-transform: uppercase;
	color: var( --axis5th-roi-summary-muted );
	margin-bottom: 6px;
}

.axis5th-roi__metric-value {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
}

.axis5th-roi__metric-sub {
	font-size: 12px;
	color: var( --axis5th-roi-summary-muted );
	margin-top: 4px;
}

.axis5th-roi__breakdown {
	padding: 16px 0;
}

.axis5th-roi__breakdown-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	padding: 6px 0;
	color: var( --axis5th-roi-summary-muted );
}

.axis5th-roi__breakdown-row span:last-child {
	color: var( --axis5th-roi-summary-text );
	font-weight: 600;
}

.axis5th-roi__payback-bar {
	padding-top: 16px;
	border-top: 1px solid rgba( 255, 255, 255, 0.1 );
}

.axis5th-roi__payback-bar-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var( --axis5th-roi-summary-muted );
	margin-bottom: 10px;
}

.axis5th-roi__payback-bar-track {
	height: 6px;
	background: rgba( 255, 255, 255, 0.12 );
	position: relative;
}

.axis5th-roi__payback-bar-fill {
	height: 100%;
	width: 0%;
	background: var( --axis5th-roi-accent );
	transition: width 0.3s ease;
}

.axis5th-roi__pdf {
	border: 1px solid var( --axis5th-roi-border );
	border-top: none;
	padding: 18px 20px;
	text-align: center;
}

.axis5th-roi__pdf p {
	font-size: 14px;
	color: var( --axis5th-roi-text );
	line-height: 1.5;
	margin: 0 0 12px;
	font-weight: 400;
}

.axis5th-roi__pdf-btn {
	width: 100%;
	background: transparent;
	border: 1px solid var( --axis5th-roi-accent );
	color: #18181B;
	font-size: 14px !important;
	font-weight: 600;
	padding: 12px;
	cursor: pointer;
	display: flex;
    justify-content: center;
    gap: 20px;
}

.axis5th-roi__pdf-btn:hover {
	border-color: var( --e-global-color-primary );
	color: #fff;
	background: var( --e-global-color-primary );
}

.axis5th-roi__pdf-btn:disabled {
	background: #f4f4f5;
	border-color: #18181B;
	color: var( --axis5th-roi-text );
	cursor: not-allowed;
	opacity: 0.7;
	font-size: 14px;
	font-weight: 500;
}

.axis5th-roi__pdf-hint {
	display: none;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: var( --axis5th-roi-text );
	margin: 8px 0 0;
}

.axis5th-roi__pdf-btn:disabled + .axis5th-roi__pdf-hint {
	display: block;
}

/* ── Responsive ───────────────────────────────────────────── */

@media ( max-width: 900px ) {
	.axis5th-roi__body {
		grid-template-columns: 1fr;
	}

	.axis5th-roi__summary {
		position: static;
	}

	.axis5th-roi__rail-label {
		display: none;
	}
}

@media ( max-width: 575px ) {
	.axis5th-roi__title {
		font-size: 24px;
	}

	.axis5th-roi__head {
		flex-direction: column;
	}

	.axis5th-roi__reset {
		align-self: flex-start;
	}
}

/* ── Print report ─────────────────────────────────────────── */
/* "Print / Save as PDF" should produce a real report: every step's
   answers (not just whichever one was on screen), followed by the
   summary — stacked in one readable column, with the dark summary panel
   forced to light/printable colors since browsers usually skip
   background colors on print (white text on an unprinted dark
   background would otherwise be invisible). */
@media print {
	.axis5th-roi {
		border: none;
		padding: 0;
		max-width: none;
	}

	.axis5th-roi__print-heading {
		display: block;
		font-size: 22px;
		font-weight: 800;
		color: #000000;
		margin-bottom: 24px;
	}

	.axis5th-roi__rail,
	.axis5th-roi__nav,
	.axis5th-roi__reset,
	.axis5th-roi__pdf {
		display: none !important;
	}

	.axis5th-roi__body {
		display: block;
	}

	.axis5th-roi__panel {
		display: block !important;
		padding-top: 20px;
		border-top: 1px solid #d4d4d8;
		break-inside: avoid;
	}

	.axis5th-roi__panel:first-child {
		padding-top: 0;
		border-top: none;
	}

	.axis5th-roi__slider {
		display: none;
	}

	.axis5th-roi__pill:not( .is-active ) {
		display: none;
	}

	.axis5th-roi__pill-group {
		background: none;
		padding: 0;
	}

	.axis5th-roi__pill.is-active {
		flex: 0 0 auto;
		border: none;
		background: none;
		color: #000000;
		padding: 0;
		font-weight: 700;
		text-align: left;
	}

	.axis5th-roi__text-input {
		justify-content: flex-start;
		gap: 2px;
	}

	.axis5th-roi__text-input input {
		width: auto;
		flex: 0 0 auto;
		border: none;
		padding: 0;
	}

	.axis5th-roi__text-suffix {
		position: static;
	}

	.axis5th-roi__summary {
		position: static;
		margin-top: 32px;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.axis5th-roi__summary-body {
		background: #ffffff;
		color: #000000;
		border: 1px solid #d4d4d8;
	}

	.axis5th-roi__metric,
	.axis5th-roi__payback-bar {
		border-color: #d4d4d8;
	}

	.axis5th-roi__metric-label,
	.axis5th-roi__metric-sub,
	.axis5th-roi__breakdown-row,
	.axis5th-roi__payback-bar-labels {
		color: #52525b;
	}

	.axis5th-roi__breakdown-row span:last-child,
	.axis5th-roi__metric-value {
		color: #000000;
	}

	.axis5th-roi__payback-bar-track {
		background: #e4e4e7;
	}
}
