/**
 * NH Housing Mortgage Calculator — front-end (reference site layout).
 */
.nhhm-calculator {
	--nhhm-blue: #002a86;
	--nhhm-blue-mid: #418fec;
	--nhhm-bg: #d1e4f6;
	--nhhm-white: #fff;
	font-family: "Montserrat", sans-serif;
	color: #000;
	margin: 2rem auto;
	max-width: 1140px;
}

.nhhm-calculator .centered {
	margin-left: auto;
	margin-right: auto;
	float: none;
}

/* —— Section 1: Afford —— */
.nhhm-section--afford {
	margin-bottom: 3rem;
}

.nhhm-results-top {
	background: linear-gradient(135deg, var(--nhhm-blue) 0%, var(--nhhm-blue-mid) 100%);
	color: var(--nhhm-white);
	text-align: center;
	padding: 2.5rem 1.5rem;
	margin-bottom: 2rem;
	border-radius: 4px;
}

.nhhm-results-top__eyebrow {
	font-size: 1.125rem;
	font-weight: 700;
	text-transform: uppercase;
	margin: 0 0 0.5rem;
}

.nhhm-results-top__subtitle {
	font-size: 1.2rem;
	margin: 0 0 1rem;
}

.nhhm-results-top__amount {
	font-size: clamp(2.25rem, 5vw, 3.25rem);
	font-weight: 300;
	margin: 0;
	line-height: 1.1;
}

.nhhm-results-top__payment {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 1rem 0 0;
}

.nhhm-calculator .calculator-form {
	padding: 0 15px;
}

.nhhm-calculator fieldset {
	border: 0;
	margin: 0 0 1.75rem;
	padding: 0;
	min-width: 0;
}

.nhhm-calculator .nhhm-sr-only,
.nhhm-calculator .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.nhhm-calculator fieldset.default-margin {
	margin-bottom: 2rem;
}

/* Bootstrap-style horizontal slider (reference site) */
.nhhm-calculator .slider {
	position: relative;
	margin-bottom: 0.75rem;
	padding: 1.75rem 0 0.25rem;
	user-select: none;
}

.nhhm-calculator .slider-horizontal {
	width: 100%;
	height: 20px;
	position: relative;
	cursor: pointer;
}

.nhhm-calculator .slider-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 8px;
	margin-top: -4px;
	background: #c5d9ef;
	border-radius: 4px;
}

.nhhm-calculator .slider-track-low,
.nhhm-calculator .slider-track-high,
.nhhm-calculator .slider-selection {
	position: absolute;
	height: 100%;
	top: 0;
}

.nhhm-calculator .slider-selection {
	background: var(--nhhm-blue-mid);
	border-radius: 4px 0 0 4px;
	z-index: 1;
}

.nhhm-calculator .slider-track-high {
	background: transparent;
	z-index: 0;
}

.nhhm-calculator .slider-handle {
	position: absolute;
	top: 50%;
	width: 22px;
	height: 22px;
	margin-top: -11px;
	margin-left: -11px;
	background: var(--nhhm-blue);
	border: 2px solid var(--nhhm-white);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	cursor: grab;
	z-index: 3;
	touch-action: none;
}

.nhhm-calculator .slider-handle:active {
	cursor: grabbing;
}

.nhhm-calculator .slider-handle.hide {
	display: none;
}

.nhhm-calculator .tooltip {
	position: absolute;
	z-index: 4;
	opacity: 1;
}

.nhhm-calculator .tooltip.top {
	margin-top: -36px;
	transform: translateX(-50%);
}

.nhhm-calculator .tooltip-inner {
	background: var(--nhhm-blue);
	color: var(--nhhm-white);
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.2rem 0.45rem;
	border-radius: 3px;
	white-space: nowrap;
}

.nhhm-calculator .tooltip-arrow {
	display: none;
}

.nhhm-calculator .tooltip-min,
.nhhm-calculator .tooltip-max {
	display: none !important;
}

.nhhm-calculator .form_control,
.nhhm-calculator .nhhm-text-input {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0.55rem 0.75rem;
	font-size: 1rem;
	border: 1px solid #9eb8d9;
	border-radius: 3px;
	margin-bottom: 0.35rem;
	box-sizing: border-box;
}

.nhhm-calculator label {
	display: block;
	font-weight: 700;
	color: var(--nhhm-blue);
	margin-bottom: 0.25rem;
	font-size: 0.95rem;
}

.nhhm-calculator .comment {
	display: block;
	font-size: 0.8125rem;
	line-height: 1.45;
	margin-top: 0.5rem;
	color: #333;
}

.nhhm-calculator .comment a {
	color: var(--nhhm-blue-mid);
	font-weight: 600;
}

.nhhm-calculator .input-group {
	display: flex;
	width: 100%;
}

.nhhm-calculator .input-group .form_control {
	flex: 1;
	margin-bottom: 0;
}

.nhhm-calculator .input-group-addon,
.nhhm-calculator .symbol-percent.input-group-addon {
	display: flex;
	align-items: center;
	padding: 0.55rem 0.65rem;
	background: #e8eef5;
	border: 1px solid #9eb8d9;
	border-left: 0;
	font-weight: 700;
	color: var(--nhhm-blue);
	white-space: nowrap;
}

.nhhm-calculator .buttoninput {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.5rem;
}

.nhhm-calculator .buttoninput .btn,
.nhhm-calculator .nhhm-town-open {
	display: inline-block;
	padding: 0.6rem 1rem;
	background: var(--nhhm-blue);
	color: var(--nhhm-white);
	border: 0;
	border-radius: 3px;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	text-align: center;
	margin: 0.5rem auto;
}

.nhhm-calculator .buttoninput .btn:hover,
.nhhm-calculator .nhhm-town-open:hover {
	background: var(--nhhm-blue-mid);
}

.nhhm-breakdown-panel {
	background: var(--nhhm-bg);
	padding: 1.5rem;
	margin: 2rem 15px 0;
	border-radius: 4px;
}

.nhhm-breakdown-panel h3 {
	color: var(--nhhm-blue);
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.nhhm-breakdown-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nhhm-breakdown-list li {
	display: flex;
	justify-content: space-between;
	padding: 0.6rem 0;
	border-bottom: 1px solid rgba(0, 42, 134, 0.12);
}

.nhhm-breakdown-list__total {
	font-weight: 700;
	color: var(--nhhm-blue);
	border-bottom: none;
	padding-top: 1rem;
}

/* —— Section 2: Budget (separate) —— */
.nhhm-section--budget {
	padding-top: 2.5rem;
	border-top: 4px solid var(--nhhm-blue-mid);
}

.nhhm-section--budget h2 {
	color: var(--nhhm-blue);
	font-size: 1.75rem;
	margin-bottom: 0.75rem;
}

.nhhm-budget-intro {
	max-width: 52rem;
	margin-bottom: 1.5rem;
}

.nhhm-budget-compare {
	margin-top: 2rem;
}

.nhhm-budget-box {
	background: var(--nhhm-white);
	border: 1px solid #c5d9ef;
	padding: 1.25rem;
	margin-bottom: 1.5rem;
	border-radius: 4px;
}

.nhhm-budget-box--potential {
	background: var(--nhhm-bg);
	border-color: var(--nhhm-blue-mid);
}

.nhhm-budget-box h3 {
	color: var(--nhhm-blue);
	font-size: 1.1rem;
	margin: 0 0 1rem;
}

.nhhm-budget-lines {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.nhhm-budget-lines li {
	display: flex;
	justify-content: space-between;
	padding: 0.35rem 0;
	font-size: 0.9rem;
}

.nhhm-budget-total {
	font-weight: 700;
	color: var(--nhhm-blue);
	margin: 0;
}

.nhhm-shock {
	text-align: center;
	margin-top: 2rem;
	padding: 1.5rem;
	background: var(--nhhm-blue);
	color: var(--nhhm-white);
	border-radius: 4px;
}

.nhhm-shock__label {
	margin: 0;
	font-size: 1.1rem;
}

.nhhm-shock__amount {
	font-size: 2rem;
	font-weight: 700;
	margin: 0.5rem 0 0;
}

.nhhm-disclaimer {
	font-size: 0.75rem;
	color: #555;
	margin-top: 2rem;
	line-height: 1.5;
}

/* Town popup */
.nhhm-town-popup {
	position: fixed;
	inset: 0;
	z-index: 100001;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.nhhm-town-popup[hidden] {
	display: none !important;
}

.nhhm-town-popup__panel {
	background: var(--nhhm-white);
	width: min(680px, 95vw);
	max-height: 85vh;
	overflow: auto;
	border-radius: 8px;
	padding: 1.25rem;
	position: relative;
}

.nhhm-town-popup h3 {
	color: var(--nhhm-blue);
	margin-top: 0;
}

.nhhm-town-popup__close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	border: 0;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: var(--nhhm-blue);
}

.nhhm-town-search {
	margin-bottom: 0.75rem;
}

.nhhm-town-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.35rem;
	max-height: 320px;
	overflow: auto;
	margin-bottom: 1rem;
}

.nhhm-town-option {
	text-align: left;
	border: 1px solid #c5d9ef;
	background: #f7fbff;
	border-radius: 4px;
	padding: 0.45rem 0.55rem;
	cursor: pointer;
}

.nhhm-town-option:hover {
	background: #e9f3ff;
}

.nhhm-town-selected {
	border-top: 1px solid #d8e4f1;
	padding-top: 0.75rem;
}

.nhhm-town-selected .btn_sm {
	background: var(--nhhm-blue);
	color: #fff;
	border: 0;
	padding: 0.6rem 0.9rem;
	border-radius: 4px;
	font-weight: 700;
	cursor: pointer;
}

@media (min-width: 992px) {
	.nhhm-afford-form {
		display: flex;
		flex-wrap: wrap;
	}

	.nhhm-afford-form fieldset {
		width: 50%;
		padding-right: 15px;
		box-sizing: border-box;
	}
}

@media (max-width: 767px) {
	.nhhm-town-list {
		grid-template-columns: 1fr;
	}

	.nhhm-calculator .buttoninput {
		flex-direction: column;
	}

	.nhhm-calculator .buttoninput-input,
	.nhhm-calculator .buttoninput-button {
		width: 100%;
		max-width: 100%;
	}
}

/* -------- Download / Next-steps action buttons -------- */
.nhhm-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin: 2rem 0 1rem;
}

.nhhm-actions .nhhm-btn {
	display: inline-block;
	padding: 0.85rem 2rem;
	border: 2px solid var(--nhhm-blue);
	border-radius: 6px;
	background: var(--nhhm-blue);
	color: var(--nhhm-white);
	font-weight: 700;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.nhhm-actions .nhhm-btn--next {
	background: var(--nhhm-white);
	color: var(--nhhm-blue);
}

.nhhm-actions .nhhm-btn:hover,
.nhhm-actions .nhhm-btn:focus {
	background: var(--nhhm-blue-mid);
	border-color: var(--nhhm-blue-mid);
	color: var(--nhhm-white);
}

/* -------- Download modal -------- */
.nhhm-download-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.nhhm-download-modal[hidden] {
	display: none !important;
}

.nhhm-download-modal__panel {
	background: var(--nhhm-white);
	width: min(520px, 95vw);
	max-height: 90vh;
	overflow: auto;
	border-radius: 8px;
	padding: 1.5rem;
	position: relative;
}

.nhhm-download-modal__panel h3 {
	color: var(--nhhm-blue);
	margin-top: 0;
}

.nhhm-download-modal__consent {
	font-size: 0.85rem;
	color: #555;
}

.nhhm-download-modal__msg {
	margin: 0.5rem 0;
	font-weight: 600;
	color: var(--nhhm-blue);
}

.nhhm-download-modal__msg.is-error {
	color: #b3261e;
}

.nhhm-download-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	border: 0;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: var(--nhhm-blue);
}

.nhhm-download-form fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 0.9rem;
	display: flex;
	flex-direction: column;
}

.nhhm-download-form label {
	font-weight: 600;
	margin-bottom: 0.25rem;
	color: var(--nhhm-blue);
}

.nhhm-download-form input {
	padding: 0.6rem 0.75rem;
	border: 1px solid #c5d9ef;
	border-radius: 4px;
	font-size: 1rem;
}

.nhhm-download-form .nhhm-btn {
	display: inline-block;
	padding: 0.75rem 2rem;
	border: 2px solid var(--nhhm-blue);
	border-radius: 6px;
	background: var(--nhhm-blue);
	color: var(--nhhm-white);
	font-weight: 700;
	cursor: pointer;
}

.nhhm-download-form .nhhm-btn:hover,
.nhhm-download-form .nhhm-btn:focus {
	background: var(--nhhm-blue-mid);
	border-color: var(--nhhm-blue-mid);
}

.nhhm-download-form .nhhm-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* -------- Print: keep only the calculator + results -------- */
@media print {
	.main_header,
	.top_header,
	.nhh_footer,
	.main_breadcrumb,
	[id^="page-banner"],
	.gtranslate_wrapper,
	.nhhm-actions,
	.nhhm-download-modal,
	.nhhm-town-popup,
	.tooltip-main {
		display: none !important;
	}

	body,
	.main_wrapper,
	.main_content,
	.middle_wrap {
		background: #fff !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.nhhm-calculator {
		box-shadow: none !important;
	}
}
