/*
 * New Ver 1 Prepayment Calculator
 * Visual design adapted from a supplied style reference: card-based
 * sections, a thin accent-to-gold gradient top bar, boxed field values,
 * pill-shaped radios and CTA, dashed stat rows. All sizes in px rather
 * than rem so a host theme that rescales the root font-size can't
 * silently shrink the calculator.
 */

.nv1pc {
	--nv1pc-accent: #05549d;
	--nv1pc-accent-dark: #043f75;
	--nv1pc-gold: #eda01d;
	--nv1pc-gold-dark: #a06a0f;
	--nv1pc-ink: #1f2937;
	--nv1pc-muted: #5b6472;
	--nv1pc-paper: #ffffff;
	--nv1pc-surface: #eaf2fa;
	--nv1pc-line: #d7dce2;
	--nv1pc-track: #e9ebee;
	--nv1pc-error: #c0392b;
	--nv1pc-radius: 14px;

	position: relative;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--nv1pc-ink);
	background: var(--nv1pc-paper);
	border: 1px solid var(--nv1pc-line);
	border-radius: var(--nv1pc-radius);
	padding: 28px;
	max-width: 1140px;
	margin: 0 auto;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.nv1pc::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--nv1pc-accent) 0%, var(--nv1pc-accent) 60%, var(--nv1pc-gold) 100%);
}

.nv1pc *,
.nv1pc *::before,
.nv1pc *::after {
	box-sizing: inherit;
}

.nv1pc--dark {
	--nv1pc-ink: #eef2fa;
	--nv1pc-muted: #a9b2c4;
	--nv1pc-paper: #131a29;
	--nv1pc-surface: #182a3d;
	--nv1pc-line: #2b3448;
	--nv1pc-track: #2b3448;
}

@media (prefers-color-scheme: dark) {
	.nv1pc--auto {
		--nv1pc-ink: #eef2fa;
		--nv1pc-muted: #a9b2c4;
		--nv1pc-paper: #131a29;
		--nv1pc-surface: #182a3d;
		--nv1pc-line: #2b3448;
		--nv1pc-track: #2b3448;
	}
}

/* ---------- Head ---------- */

.nv1pc__head {
	margin: 10px 0 22px;
}

.nv1pc__heading {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
	color: var(--nv1pc-ink);
}

.nv1pc__intro {
	margin: 0;
	font-size: 14px;
	color: var(--nv1pc-muted);
	max-width: 62ch;
}

/* ---------- Layout ---------- */

.nv1pc__grid {
	display: grid;
	gap: 28px;
	grid-template-columns: 1fr;
	align-items: start;
}

@media (min-width: 780px) {
	.nv1pc__grid {
		grid-template-columns: 1.4fr 1fr;
	}
}

.nv1pc__inputs-panel {
	min-width: 0;
}

.nv1pc__inputs {
	margin: 0;
}

/* ---------- Fields ---------- */

.nv1pc__field {
	margin-bottom: 18px;
	border: 0;
	padding: 0;
	min-width: 0;
}

.nv1pc__field-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	flex-wrap: nowrap;
}

.nv1pc__field-label {
	font-weight: 700;
	font-size: 15px;
	color: var(--nv1pc-ink);
	white-space: nowrap;
	padding: 0;
}

.nv1pc__value-box {
	display: flex;
	align-items: center;
	background: var(--nv1pc-paper);
	border: 1px solid var(--nv1pc-line);
	border-radius: 6px;
	padding: 5px 10px;
	min-width: 140px;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nv1pc__value-box:focus-within {
	border-color: var(--nv1pc-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--nv1pc-accent) 14%, transparent) !important;
}

.nv1pc__value-box--tenure {
	min-width: 168px;
}

.nv1pc__prefix,
.nv1pc__suffix {
	color: var(--nv1pc-muted);
	font-size: 14px;
	font-weight: 600;
	flex-shrink: 0;
}

.nv1pc__suffix {
	margin-left: 6px;
}

.nv1pc__input {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
	color: var(--nv1pc-accent) !important;
	width: 100%;
	min-width: 70px;
	text-align: right;
	background: transparent !important;
	padding: 0 !important;
	margin: 0;
	box-sizing: content-box !important;
}

.nv1pc__input:focus {
	color: var(--nv1pc-accent) !important;
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
}

.nv1pc__input--tenure {
	min-width: 34px;
	text-align: left;
	margin-right: 6px;
}

.nv1pc__select {
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background-color: transparent !important;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--nv1pc-muted) !important;
	cursor: pointer;
	padding: 0 14px 0 4px !important;
	margin: 0;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
	background-position: right 4px top 55%, right 0 top 55% !important;
	background-size: 4px 4px !important;
	background-repeat: no-repeat !important;
	border-left: 1px solid var(--nv1pc-line) !important;
}

/* range slider - flat track, plain circular thumb */
.nv1pc__range {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	width: 100%;
	height: 4px !important;
	background: var(--nv1pc-track) !important;
	border: none !important;
	border-radius: 2px;
	outline: none !important;
	box-shadow: none !important;
	margin: 14px 0 6px;
	padding: 0 !important;
	box-sizing: content-box !important;
	cursor: pointer;
	display: block;
}

.nv1pc__range::-webkit-slider-runnable-track {
	background: var(--nv1pc-track);
	height: 4px;
	border-radius: 2px;
}

.nv1pc__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--nv1pc-paper);
	border: 3px solid var(--nv1pc-accent);
	cursor: pointer;
	margin-top: -6px;
}

.nv1pc__range::-moz-range-track {
	height: 4px;
	background: var(--nv1pc-track);
	border-radius: 2px;
}

.nv1pc__range::-moz-range-thumb {
	box-sizing: border-box;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--nv1pc-paper);
	border: 3px solid var(--nv1pc-accent);
	cursor: pointer;
}

.nv1pc__range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--nv1pc-accent-dark);
	outline-offset: 2px;
}

.nv1pc__range-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--nv1pc-muted);
}

.nv1pc__field-error {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--nv1pc-error);
}

/* ---------- Choice ---------- */

.nv1pc__choice {
	margin-top: 4px;
}

.nv1pc__choice legend {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-bottom: 10px;
	white-space: normal;
	overflow-wrap: break-word;
	line-height: 1.35;
}

.nv1pc__radios {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.nv1pc__radio-pill {
	position: relative;
	flex: 1 1 220px;
	display: block;
	margin: 0;
	cursor: pointer;
}

.nv1pc__radio-pill input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.nv1pc__radio-pill span {
	display: block;
	text-align: center;
	padding: 10px 14px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--nv1pc-muted);
	background: var(--nv1pc-paper);
	border: 1px solid var(--nv1pc-line);
	border-radius: 999px;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nv1pc__radio-pill input:checked + span {
	color: #fff;
	background: var(--nv1pc-accent);
	border-color: var(--nv1pc-accent);
}

.nv1pc__radio-pill input:focus-visible + span {
	outline: 2px solid var(--nv1pc-accent-dark);
	outline-offset: 2px;
}

.nv1pc__reset {
	all: unset;
	display: inline-block;
	cursor: pointer;
	font-size: 13px;
	color: var(--nv1pc-muted);
	border-bottom: 1px solid var(--nv1pc-line);
	padding-bottom: 1px;
	margin-bottom: 8px;
}

.nv1pc__reset:hover {
	color: var(--nv1pc-accent);
	border-bottom-color: var(--nv1pc-accent);
}

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

.nv1pc__results {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.nv1pc__verdict {
	background: var(--nv1pc-surface);
	border: 1px solid var(--nv1pc-line);
	border-radius: var(--nv1pc-radius);
	padding: 18px 20px;
	text-align: center;
}

.nv1pc--dark .nv1pc__verdict {
	background: #1b3550;
}

.nv1pc__verdict-eyebrow {
	font-size: 13px;
	font-weight: 700;
	color: var(--nv1pc-accent);
	margin: 0 0 8px;
}

.nv1pc__verdict-line {
	font-size: clamp(22px, 3.4vw, 28px);
	font-weight: 800;
	color: var(--nv1pc-accent);
	margin: 0;
	letter-spacing: 0.1px;
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
}

.nv1pc__verdict-unit {
	font-size: 0.5em;
	font-weight: 600;
	color: var(--nv1pc-muted);
}

.nv1pc__verdict-sub {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--nv1pc-muted);
}

/* stat strip - dashed breakdown rows */
.nv1pc__stats {
	background: var(--nv1pc-paper);
	border: 1px solid var(--nv1pc-line);
	border-radius: var(--nv1pc-radius);
	padding: 4px 20px;
}

.nv1pc__stat {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 0;
	border-bottom: 1px dashed var(--nv1pc-line);
}

.nv1pc__stat:last-child {
	border-bottom: none;
}

.nv1pc__stat-label {
	font-size: 13px;
	color: var(--nv1pc-muted);
	margin: 0;
}

.nv1pc__stat-value {
	font-size: 15px;
	font-weight: 700;
	color: var(--nv1pc-ink);
	font-variant-numeric: tabular-nums;
	margin: 0;
	white-space: nowrap;
}

/* ---------- CTA ---------- */

.nv1pc__cta-wrap {
	text-align: center;
}

.nv1pc__cta {
	display: inline-block;
	background: var(--nv1pc-accent);
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1;
	padding: 15px 40px;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.nv1pc__cta:hover,
.nv1pc__cta:focus-visible {
	background: var(--nv1pc-accent-dark);
	color: #ffffff;
}

.nv1pc__cta:active {
	transform: translateY(1px);
}

@media (max-width: 480px) {
	.nv1pc__cta {
		display: block;
	}
}

/* ---------- Disclaimer ---------- */

.nv1pc__disclaimer {
	margin: 40px auto 0;
	max-width: 900px;
	text-align: center;
}

.nv1pc__disclaimer p {
	font-size: 11.5px;
	color: var(--nv1pc-muted);
	margin: 0;
	line-height: 1.6;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
	.nv1pc {
		padding: 18px 16px;
		border-radius: 12px;
	}
	.nv1pc__field-top {
		flex-wrap: wrap;
		gap: 8px;
	}
	.nv1pc__field-label {
		font-size: 13.5px;
		white-space: normal;
		line-height: 1.3;
	}
	.nv1pc__value-box {
		min-width: 110px;
	}
	.nv1pc__input {
		font-size: 13.5px;
	}
	.nv1pc__prefix,
	.nv1pc__suffix {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nv1pc * {
		transition: none !important;
	}
}
