/*
	ROI calculator page

	Three screens in one card: the dealership, its software today, and the estimated return. Built from
	the theme's .dp- primitives (hero, section, form fields, buttons); only the calculator's own parts are here.
*/

.dp-roi {
	max-width: 1000px;
	margin: 0 auto;
}

/* The results grid sets its own display, which would beat the hidden attribute */
.dp-roi-panel[hidden] {
	display: none !important;
}


/* ---------------------------------------------------------------- Steps */

.dp-roi-steps {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin: 0 0 32px 0;
	padding: 0;
	list-style: none;
}

.dp-roi-step {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--dp-ink-soft);
}

/* The rule from one step to the next */
.dp-roi-step + .dp-roi-step:before {
	content: "";
	width: 40px;
	height: 1px;
	margin-right: 2px;
	background: #c9d1da;
}

.dp-roi-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 2px solid #c9d1da;
	border-radius: 50%;
	background: #ffffff;
	font-size: 13px;
	font-weight: 700;
	color: var(--dp-ink-soft);
}

.dp-roi-step.is-current {
	color: var(--dp-ink);
}

.dp-roi-step.is-current .dp-roi-step-num {
	background: var(--dp-blue);
	border-color: var(--dp-blue);
	color: #ffffff;
}

.dp-roi-step.is-done .dp-roi-step-num {
	border-color: var(--dp-blue);
	color: var(--dp-blue-dark);
}


/* ---------------------------------------------------------------- Question screens */

.dp-roi-card {
	max-width: 640px;
	margin: 0 auto;
	padding: 36px 36px 32px 36px;
	background: #ffffff;
	border: 1px solid var(--dp-line);
	border-radius: 10px;
}

.dp-roi-panel h2:focus {
	outline: none;
}

.dp-roi-field-note {
	margin: -2px 0 8px 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--dp-ink-soft);
}

/* A number box with its $, % or /month beside it, inside the one border */
.dp-roi-affix {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #c9d1da;
	border-radius: 6px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dp-roi-affix:focus-within {
	border-color: var(--dp-blue);
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.14);
}

.dp-roi-affix.has-error {
	border-color: #c9302c;
}

.dp-roi-affix .dp-roi-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-variant-numeric: tabular-nums;
}

.dp-roi-affix .dp-roi-input:focus {
	box-shadow: none;
}

.dp-roi-affix-text {
	display: flex;
	align-items: center;
	padding: 0 12px;
	background: var(--dp-wash);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--dp-ink-soft);
}

.dp-roi .dp-field-error {
	color: #c9302c;
}

.dp-roi .dp-field-error:empty {
	display: none;
}

.dp-roi-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 28px;
}

/* Back on the left, the way forward on the right */
.dp-roi-actions .dp-roi-back {
	margin-right: auto;
}

/* These are <button>s, which the core stylesheet gives a drop shadow; the theme's link buttons have none */
.dp-roi .dp-btn {
	cursor: pointer;
	font-family: inherit;
	box-shadow: none;
}

.dp-roi .dp-btn i {
	margin: 0 2px;
	font-size: 13px;
}


/* ---------------------------------------------------------------- Results */

.dp-roi-results {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 28px;
	align-items: start;
}

.dp-roi-results-title {
	margin: 0 0 18px 0;
	font-size: clamp(22px, 2.6vw, 28px);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--dp-ink);
}


/* The number the page is for */
.dp-roi-headline {
	padding: 30px 32px;
	border-radius: 10px;
	background-color: var(--dp-dark);
	background-image: radial-gradient(ellipse 80% 120% at 100% 0%, rgba(33, 150, 243, 0.28) 0%, rgba(33, 150, 243, 0) 65%);
	color: #ffffff;
}

.dp-roi-headline p {
	margin: 0;
}

.dp-roi-headline-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}

.dp-roi-headline .dp-roi-headline-value {
	margin-top: 8px;
	font-family: "Montserrat", sans-serif;
	font-size: clamp(40px, 6vw, 60px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	color: #ffffff;
}

.dp-roi-headline .dp-roi-headline-year {
	margin-top: 8px;
	font-size: 18px;
	color: rgba(255, 255, 255, 0.82);
}

.dp-roi-headline .dp-roi-headline-back {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 15px;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.82);
}


/* Where it comes from */
.dp-roi-breakdown {
	margin: 20px 0 0 0;
	padding: 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid var(--dp-line);
	border-radius: 10px;
}

.dp-roi-breakdown li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 18px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--dp-line);
}

.dp-roi-breakdown li:last-child {
	border-bottom: 0;
}

.dp-roi-breakdown-body {
	min-width: 0;
}

.dp-roi-breakdown-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--dp-ink);
}

.dp-roi-breakdown-detail {
	margin: 4px 0 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--dp-ink-soft);
}

.dp-roi-breakdown-value {
	flex: 0 0 auto;
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--dp-ink);
}

.dp-roi-breakdown .is-negative {
	color: #b3261e;
}

.dp-roi-breakdown li.is-total {
	background: var(--dp-wash);
	border-radius: 0 0 10px 10px;
}

.dp-roi-breakdown li.is-total .dp-roi-breakdown-value {
	font-size: 20px;
}


/* Today next to with DealerShark */
.dp-roi-compare-title {
	margin: 32px 0 12px 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--dp-ink);
}

.dp-roi-compare-wrap {
	overflow-x: auto;
	background: #ffffff;
	border: 1px solid var(--dp-line);
	border-radius: 10px;
}

.dp-roi-compare {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.dp-roi-compare th,
.dp-roi-compare td {
	padding: 13px 22px;
	border-bottom: 1px solid var(--dp-line);
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--dp-ink);
}

.dp-roi-compare tbody tr:last-child th,
.dp-roi-compare tbody tr:last-child td {
	border-bottom: 0;
}

.dp-roi-compare thead th {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dp-ink-soft);
}

.dp-roi-compare tbody th {
	text-align: left;
	font-weight: 600;
}

.dp-roi-compare thead th.is-with {
	color: var(--dp-blue-dark);
}

.dp-roi-compare tbody td {
	white-space: nowrap;
}

.dp-roi-compare tbody td.is-with {
	font-weight: 700;
}

.dp-roi-plan-note {
	margin: 12px 0 0 0;
	font-size: 13px;
	color: var(--dp-ink-soft);
}


/* ---------------------------------------------------------------- Assumptions and the way on */

/* Pinned below the fixed header, which is 60px tall and 70px from 992px (see the theme stylesheet) */
.dp-roi-side {
	position: sticky;
	top: 90px;
}

@media (min-width: 992px) {

	.dp-roi-side {
		top: 100px;
	}
}

.dp-roi-assume {
	padding: 24px 22px 6px 22px;
	background: #ffffff;
	border: 1px solid var(--dp-line);
	border-radius: 10px;
}

.dp-roi-assume-title {
	margin: 0 0 6px 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--dp-ink);
}

.dp-roi-assume-intro {
	margin: 0 0 20px 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--dp-ink-soft);
}

.dp-roi-assume-field {
	margin-bottom: 20px;
}

.dp-roi-assume-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.dp-roi-assume-value {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--dp-blue-dark);
}

.dp-roi-range {
	display: block;
	width: 100%;
	margin: 4px 0 8px 0;
	accent-color: var(--dp-blue);
	cursor: pointer;
}

.dp-roi-cta {
	display: block;
	margin-top: 18px;
}

.dp-roi-edit {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 6px 0;
	background: none;
	border: 0;
	box-shadow: none;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--dp-blue-dark);
}

.dp-roi-edit:hover,
.dp-roi-edit:focus {
	text-decoration: underline;
}

.dp-roi-disclaimer {
	margin: 12px 0 0 0;
	font-size: 13px;
	line-height: 1.55;
	color: var(--dp-ink-soft);
}


/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 900px) {

	.dp-roi-results {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Below the results rather than pinned beside them */
	.dp-roi-side {
		position: static;
	}
}

@media (max-width: 560px) {

	.dp-roi-card {
		padding: 24px 18px 22px 18px;
	}

	/* Only the current step keeps its name */
	.dp-roi-step:not(.is-current) .dp-roi-step-label {
		display: none;
	}

	.dp-roi-step + .dp-roi-step:before {
		width: 18px;
	}

	.dp-roi-actions {
		flex-direction: column-reverse;
	}

	.dp-roi-actions .dp-btn {
		width: 100%;
		margin-right: 0;
	}

	.dp-roi-headline {
		padding: 24px 22px;
	}

	.dp-roi-breakdown li {
		flex-direction: column;
		gap: 6px;
		padding: 16px 18px;
	}

	.dp-roi-compare th,
	.dp-roi-compare td {
		padding: 12px 14px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.dp-roi-affix {
		transition: none;
	}
}
