.mortgage-calculator {
	--mortgage-blue: #0a8ece;
	--mortgage-ink: #0c1b22;
	--mortgage-muted: #5c6b72;
	--mortgage-paper: #eef3f5;
	background: #fff;
	color: var(--mortgage-ink);
	padding: clamp(52px, 7vw, 105px) max(20px, calc((100vw - 1180px) / 2));
}

.mortgage-calculator__intro {
	margin: 0 auto clamp(34px, 5vw, 58px);
	max-width: 780px;
	text-align: center;
}

.mortgage-calculator__kicker {
	color: var(--mortgage-blue);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	margin: 0 0 10px;
}

.mortgage-calculator__intro h2 {
	font-size: clamp(30px, 4vw, 48px);
	font-weight: 400;
	line-height: 1.15;
	margin: 0 0 18px;
}

.mortgage-calculator__intro p:last-child {
	color: var(--mortgage-muted);
	font-size: 17px;
	line-height: 1.85;
	margin: 0;
}

.mortgage-form {
	background: #fff;
	border: 1px solid #dce5e9;
	box-shadow: 0 24px 70px rgba(12, 27, 34, .09);
	margin: 0 auto;
	max-width: 1180px;
}

.mortgage-form__modes {
	background: var(--mortgage-paper);
	border: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 8px;
}

.mortgage-mode {
	cursor: pointer;
	display: block;
	margin: 0;
	position: relative;
	text-align: center;
}

.mortgage-mode input {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.mortgage-mode span {
	border-radius: 5px;
	display: block;
	font-size: 16px;
	font-weight: 600;
	padding: 15px 18px;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.mortgage-mode input:checked + span {
	background: #fff;
	box-shadow: 0 5px 18px rgba(12, 27, 34, .08);
	color: var(--mortgage-blue);
}

.mortgage-mode input:focus-visible + span {
	box-shadow: 0 0 0 3px rgba(10, 142, 206, .24);
}

.mortgage-form__body {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr);
}

.mortgage-form__fields {
	display: grid;
	gap: 38px;
	padding: clamp(28px, 5vw, 62px);
}

.mortgage-field[hidden] {
	display: none;
}

.mortgage-field__heading {
	align-items: center;
	display: flex;
	gap: 22px;
	justify-content: space-between;
	margin-bottom: 16px;
}

.mortgage-field__heading label {
	font-size: 16px;
	font-weight: 600;
}

.mortgage-input-wrap {
	align-items: center;
	background: #fff;
	border: 1px solid #b9c9d0;
	border-radius: 5px;
	display: flex;
	flex: 0 0 190px;
	min-height: 48px;
	overflow: hidden;
}

.mortgage-input-wrap:focus-within {
	border-color: var(--mortgage-blue);
	box-shadow: 0 0 0 3px rgba(10, 142, 206, .13);
}

.mortgage-input-wrap input {
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--mortgage-ink);
	direction: ltr;
	font-size: 18px;
	font-weight: 600;
	min-width: 0;
	outline: 0;
	padding: 10px 13px;
	text-align: right;
	width: 100%;
}

.mortgage-input-wrap span {
	border-right: 1px solid #dce5e9;
	color: var(--mortgage-muted);
	font-size: 14px;
	padding: 13px 12px;
	white-space: nowrap;
}

.mortgage-input-wrap--short {
	flex-basis: 150px;
}

.mortgage-range input[type="range"] {
	accent-color: var(--mortgage-blue);
	cursor: pointer;
	display: block;
	direction: ltr;
	margin: 0;
	width: 100%;
}

.mortgage-range__limits {
	color: #78909a;
	direction: ltr;
	display: flex;
	font-size: 12px;
	justify-content: space-between;
	margin-top: 5px;
}

.mortgage-result {
	background: var(--mortgage-ink);
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(34px, 4.5vw, 58px);
}

.mortgage-result__label {
	color: #bed0d8;
	font-size: 15px;
	margin: 0 0 8px;
}

.mortgage-result__value {
	color: #fff;
	direction: ltr;
	font-size: clamp(44px, 5vw, 68px);
	font-weight: 300;
	line-height: 1;
	margin: 0 0 34px;
	text-align: right;
}

.mortgage-result__value small {
	color: var(--mortgage-blue);
	font-size: .45em;
	font-weight: 600;
}

.mortgage-result__details {
	border-block: 1px solid rgba(255, 255, 255, .16);
	margin-bottom: 28px;
	padding-block: 9px;
}

.mortgage-result__details div {
	display: flex;
	font-size: 13px;
	gap: 18px;
	justify-content: space-between;
	padding-block: 9px;
}

.mortgage-result__details span {
	color: #bed0d8;
}

.mortgage-result__details strong {
	direction: ltr;
	font-weight: 600;
}

.mortgage-result button {
	background: var(--mortgage-blue);
	border: 1px solid var(--mortgage-blue);
	border-radius: 5px;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	font-weight: 700;
	min-height: 52px;
	padding: 10px 24px;
	width: 100%;
}

.mortgage-result button:hover,
.mortgage-result button:focus-visible {
	background: #fff;
	border-color: #fff;
	color: var(--mortgage-ink);
}

.mortgage-result__hint {
	color: #9fb2bb;
	font-size: 11px;
	line-height: 1.65;
	margin: 17px 0 0;
}

.mortgage-form__error {
	background: #fff1f0;
	color: #a22b23;
	font-size: 14px;
	margin: 0;
	padding: 13px 30px;
	text-align: center;
}

.mortgage-calculator__notes {
	margin: clamp(38px, 5vw, 65px) auto 0;
}

.mortgage-calculator__notes h2 {
	font-size: 22px;
	font-weight: 500;
	margin: 0 0 15px;
}

.mortgage-calculator__notes ul {
	color: var(--mortgage-muted);
	font-size: 13px;
	line-height: 1.8;
	margin: 0;
	padding-right: 20px;
}

@media (max-width: 820px) {
	.mortgage-form__body {
		grid-template-columns: 1fr;
	}

	.mortgage-result {
		min-height: 390px;
	}
}

@media (max-width: 560px) {
	.mortgage-calculator {
		padding-inline: 14px;
	}

	.mortgage-form__modes {
		grid-template-columns: 1fr;
	}

	.mortgage-mode span {
		padding-block: 12px;
	}

	.mortgage-form__fields {
		gap: 32px;
		padding: 28px 20px 34px;
	}

	.mortgage-field__heading {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
	}

	.mortgage-input-wrap,
	.mortgage-input-wrap--short {
		flex-basis: auto;
		width: 100%;
	}

	.mortgage-result {
		min-height: 0;
		padding: 36px 24px;
	}
}
