/* =========================================================
   MORTGAGE CALCULATOR
   Specific styles only for calculators/mortgage.tpl
   ========================================================= */

.mortgage-calculator,
.mortgage-calculator *,
.mortgage-calculator *::before,
.mortgage-calculator *::after {
	box-sizing: border-box;
}

.mortgage-calculator {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	overflow: hidden;
}

.mortgage-layout {
	display: grid;
	grid-template-columns: minmax(0, 520px) minmax(340px, 1fr);
	gap: 24px;
	align-items: start;
	justify-content: center;
}

.mortgage-layout > * {
	min-width: 0;
}

.mortgage-card {
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding: 22px;
	border: 1px solid #eceded;
	border-radius: 18px;
	background: #ffffff;
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
}

.mortgage-card-title {
	margin: 0 0 18px;
	color: #404549;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.35;
	text-transform: none;
}

.mortgage-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

.mortgage-field-group {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 14px;
}

.mortgage-field label {
	display: block;
	margin-bottom: 7px;
	color: #404549;
	font-weight: 800;
	line-height: 1.35;
}

.mortgage-field input,
.mortgage-field select {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #e2e5e8;
	border-radius: 12px;
	background: #f9fafb;
	color: #2f3438;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 46px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.mortgage-field select {
	padding-right: 34px;
	cursor: pointer;
}

.mortgage-field input:focus,
.mortgage-field select:focus {
	border-color: #ff485b;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(255, 72, 91, 0.12);
}

.mortgage-input-wrap {
	position: relative;
	width: 100%;
}

.mortgage-input-wrap input {
	padding-right: 54px;
}

.mortgage-input-wrap span {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	color: #7a8288;
	font-size: 14px;
	font-weight: 800;
	pointer-events: none;
}

.mortgage-hint {
	margin-top: 7px;
	color: #777f86;
	font-size: 13px;
	line-height: 1.45;
}

.mortgage-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}

.mortgage-actions .btn,
.mortgage-schedule-toggle {
	min-height: 42px;
	border-radius: 10px;
	font-weight: 800;
}

.mortgage-error {
	min-height: 20px;
	margin-top: 14px;
	color: #dc2626;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
}


/* =========================================================
   RESULT CARD
   ========================================================= */

.mortgage-main-result {
	margin-bottom: 16px;
	padding: 16px;
	border-radius: 14px;
	background: linear-gradient(135deg, #fff5f6 0%, #f8fafc 100%);
	color: #2f3438;
	font-size: 21px;
	font-weight: 900;
	line-height: 1.35;
	word-break: break-word;
}

.mortgage-result-list {
	overflow: hidden;
	border: 1px solid #edf0f3;
	border-radius: 14px;
}

.mortgage-result-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 15px;
	border-bottom: 1px solid #edf0f3;
}

.mortgage-result-row:last-child {
	border-bottom: 0;
}

.mortgage-result-row span {
	color: #555f67;
	line-height: 1.35;
}

.mortgage-result-row strong {
	color: #2f3438;
	font-weight: 900;
	text-align: right;
	word-break: break-word;
}

.mortgage-result-row-main {
	background: #f9fafb;
}

.mortgage-formula {
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: 14px;
	background: #f8fafc;
	color: #555f67;
	font-size: 14px;
	line-height: 1.55;
}

.mortgage-note {
	margin-top: 12px;
	padding: 13px 15px;
	border-radius: 14px;
	background: #fff8e8;
	color: #6f5a22;
	font-size: 13px;
	line-height: 1.55;
}


/* =========================================================
   PAYMENT SCHEDULE
   ========================================================= */

.mortgage-schedule-card {
	margin-top: 24px;
}

.mortgage-schedule-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 16px;
}

.mortgage-schedule-head .mortgage-card-title {
	margin-bottom: 6px;
}

.mortgage-schedule-subtitle {
	margin: 0;
	color: #777f86;
	font-size: 14px;
	line-height: 1.5;
}

.mortgage-table-wrap {
	width: 100%;
	overflow-x: auto;
	border: 1px solid #edf0f3;
	border-radius: 14px;
	background: #ffffff;
}

.mortgage-table {
	width: 100%;
	min-width: 720px;
	border-collapse: collapse;
}

.mortgage-table th,
.mortgage-table td {
	padding: 12px 14px;
	border-bottom: 1px solid #edf0f3;
	color: #404549;
	font-size: 14px;
	line-height: 1.35;
	text-align: right;
	white-space: nowrap;
}

.mortgage-table th:first-child,
.mortgage-table td:first-child {
	text-align: left;
}

.mortgage-table th {
	background: #f9fafb;
	color: #555f67;
	font-weight: 900;
}

.mortgage-table td {
	font-weight: 700;
}

.mortgage-table tr:last-child td {
	border-bottom: 0;
}

.mortgage-table tbody tr:hover td {
	background: #fffafa;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media only screen and (max-width: 991px) {
	.mortgage-calculator {
		max-width: 720px;
	}

	.mortgage-layout {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.mortgage-schedule-card {
		margin-top: 18px;
	}
}

@media only screen and (max-width: 767px) {
	.mortgage-card {
		padding: 18px;
		border-radius: 16px;
	}

	.mortgage-card-title {
		margin-bottom: 14px;
		font-size: 17px;
	}

	.mortgage-field-group {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.mortgage-schedule-head {
		flex-direction: column;
		align-items: stretch;
	}

	.mortgage-schedule-toggle {
		width: 100%;
	}

	.mortgage-main-result {
		padding: 14px;
		font-size: 19px;
	}

	.mortgage-result-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
		padding: 12px 14px;
	}

	.mortgage-result-row strong {
		text-align: left;
	}

	.mortgage-actions {
		flex-direction: column;
	}

	.mortgage-actions .btn {
		width: 100%;
	}

	.mortgage-table th,
	.mortgage-table td {
		padding: 11px 12px;
		font-size: 13px;
	}
}

@media only screen and (max-width: 420px) {
	.mortgage-card {
		padding: 14px;
		border-radius: 14px;
	}

	.mortgage-field input,
	.mortgage-field select {
		height: 44px;
		border-radius: 10px;
		font-size: 14px;
		line-height: 44px;
	}

	.mortgage-main-result {
		font-size: 18px;
	}

	.mortgage-formula,
	.mortgage-note {
		padding: 12px;
		border-radius: 12px;
	}
}