/* ==========================================================================
   Mortgage Calculator — self-contained styles
   Scoped to #mortgage-calculator so it renders correctly regardless of
   whether the theme's own tools-row / tools-field / tools-btn CSS loads.
   !important is used only where needed to beat theme-level button/link
   styles (this is what was causing the yellow overflow on Reset).
   ========================================================================== */

#mortgage-calculator,
#mortgage-calculator * {
	box-sizing: border-box !important;
}

#mortgage-calculator {
	--mc-bg: #ede8e2;
	--mc-maroon: #7a1e2b;
	--mc-maroon-dark: #611722;
	--mc-gray: #58595b;
	--mc-gray-dark: #414243;
	--mc-border: #d8d2c8;
	--mc-text: #2b2b2b;

	position: relative;
	background: var(--mc-bg);
	padding: 40px;
	font-family: "Helvetica Neue", Arial, sans-serif;
	color: var(--mc-text);
	overflow: hidden;
	display: block;
	width: 100%;
}

/* Decorative background image, if the theme provides one — kept subtle
   and non-blocking so it never interferes with the form itself. */
#mortgage-calculator .tools-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}
#mortgage-calculator .tools-bg-img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0.06;
}

#mortgage-calculator .tools-col-left,
#mortgage-calculator .tools-col-right {
	position: relative;
	z-index: 1;
}

#mortgage-calculator .tools-col-left {
	max-width: 640px;
	margin: 0 0 32px;
}

#mortgage-calculator .gsite-title h2 {
	margin: 0 0 10px;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--mc-text);
}

#mortgage-calculator .gsite-title h2 small {
	display: block;
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mc-gray);
}

#mortgage-calculator .tools-col-left-collapse p,
#mortgage-calculator .tools-col-right-intro p {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #6b6b6b;
	max-width: 720px;
}

#mortgage-calculator .tools-col-right-intro {
	display: none; /* duplicate of the intro text already shown above the form */
}

/* Form layout ------------------------------------------------------------ */

#mortgage-calculator .tools-form {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	margin: 0 -10px;
}

#mortgage-calculator .tools-field {
	width: 100%;
	padding: 0 10px;
	margin-bottom: 20px;
}

#mortgage-calculator .tools-field.field-6 {
	width: 50%;
}

#mortgage-calculator .tools-field.field-12 {
	width: 100%;
}

@media (max-width: 640px) {
	#mortgage-calculator .tools-field.field-6 {
		width: 100%;
	}
}

#mortgage-calculator .tools-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mc-text);
	margin-bottom: 8px;
}

#mortgage-calculator .tools-field label span {
	color: var(--mc-maroon);
	margin-left: 2px;
}

#mortgage-calculator .tools-field input[type="text"],
#mortgage-calculator .tools-field select {
	display: block !important;
	width: 100% !important;
	padding: 12px 14px !important;
	border: 1px solid var(--mc-border) !important;
	background: #fff !important;
	font-size: 14px !important;
	color: var(--mc-text) !important;
	outline: none !important;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border-radius: 0 !important;
	line-height: normal !important;
	height: auto !important;
	box-shadow: none !important;
	float: none !important;
}

#mortgage-calculator .tools-field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--mc-gray-dark) 50%),
		linear-gradient(135deg, var(--mc-gray-dark) 50%, transparent 50%);
	background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 15px) calc(50% - 3px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 36px !important;
	cursor: pointer;
}

#mortgage-calculator .tools-field input:focus,
#mortgage-calculator .tools-field select:focus {
	border-color: var(--mc-maroon) !important;
}

#mortgage-calculator .tools-field input[disabled] {
	background: #fff !important;
	color: var(--mc-text) !important;
	opacity: 1 !important;
}

/* Buttons ----------------------------------------------------------------- */

#mortgage-calculator .tools-btn {
	width: 100%;
	padding: 0 10px;
	display: flex !important;
	flex-wrap: wrap;
	gap: 12px;
	margin: 4px 0 24px;
}

#mortgage-calculator .tools-btn-col {
	flex: 1 1 0;
	min-width: 140px;
	position: static !important;
	float: none !important;
	display: block !important;
	height: auto !important;
	width: auto !important;
}

#mortgage-calculator .tools-btn button {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	position: static !important;
	float: none !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 16px 20px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	cursor: pointer !important;
	box-shadow: none !important;
	line-height: normal !important;
}

#mortgage-calculator #fnnc-calculate,
#mortgage-calculator #fnnc-amortize {
	background: var(--mc-maroon) !important;
	color: #fff !important;
}

#mortgage-calculator #fnnc-calculate:hover,
#mortgage-calculator #fnnc-amortize:hover {
	background: var(--mc-maroon-dark) !important;
}

#mortgage-calculator #fnnc-reset.gsite-button {
	background: var(--mc-gray) !important;
	color: #fff !important;
}

#mortgage-calculator #fnnc-reset.gsite-button:hover {
	background: var(--mc-gray-dark) !important;
}

/* Hide the invisible popup-trigger link the markup carries over */
#mortgage-calculator .trigger-popup-amortize.hidden {
	display: none !important;
}

#mortgage-calculator .tools-collapse-btn.hidden {
	display: none !important;
}

/* Popup / Amortization modal ---------------------------------------------- */

#popup-amortize.aiosp-hide {
	display: none !important;
}

#popup-amortize {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 18, 16, 0.75);
	padding: 20px;
	font-family: "Helvetica Neue", Arial, sans-serif;
}

#popup-amortize .amortize-options-container {
	position: relative;
	background: #fff;
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 30px 34px 34px;
	color: #2b2b2b;
}

#popup-amortize h2 {
	margin: 0 0 12px;
	padding-bottom: 12px;
	border-bottom: 3px solid #7a1e2b;
	font-size: 18px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

#popup-amortize .action-message {
	font-size: 14px;
	line-height: 1.7;
	margin: 0 0 4px;
	color: #444;
}

#popup-amortize .amortize-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none !important;
	border: none !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #58595b;
	padding: 0 4px !important;
	width: auto !important;
	height: auto !important;
}

#popup-amortize .amortize-close:hover {
	color: #7a1e2b;
}

#popup-amortize .amortize-tablewrap {
	overflow-x: auto;
	margin-top: 16px;
}

#popup-amortize table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

#popup-amortize thead th {
	background: #58595b;
	color: #fff;
	padding: 10px 14px;
	font-weight: 600;
}

#popup-amortize tbody td {
	padding: 9px 14px;
	border-bottom: 1px solid #e2ddd4;
}

#popup-amortize tbody tr:nth-child(even) {
	background: #f7f5f2;
}
