/* ==========================================================================
   Loan calculator page (/loan-calculator)
   Page-scoped and hand-written on purpose so it does not need a Prepros
   rebuild of style.css. Colors follow the palette in sass/style.scss:
   green #98ca3c, dkgreen #355c13, brown #3b2d20, yellow #cccc00,
   grey #f6f6f6, medgrey #cccccc, charcoal #666666.
   White text sits on dkgreen (not green) so it meets WCAG AA contrast.
   ========================================================================== */

.loancalc p,
.loancalc li,
.loancalc dd {
	text-wrap: pretty;
}

.loancalc h2 {
	margin: 0 0 15px 0;
}

.loancalc h3 {
	color: #3b2d20;
	margin: 0 0 15px 0;
}

.lc-intro {
	max-width: 850px;
	margin: 0 0 30px 0;
}

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

.lc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 30px;
	align-items: start;
}

@media only screen and (min-width: 960px) {
	.lc-grid {
		grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
	}
}

.lc-panel {
	background: #ffffff;
	box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3);
	border-radius: 3px;
	padding: 20px;
}

@media only screen and (min-width: 675px) {
	.lc-panel {
		padding: 25px;
	}
}

.lc-inputs {
	border-top: 5px solid #98ca3c;
}

.lc-table-panel {
	margin: 30px 0 0 0;
}

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

.lc-inputs label {
	display: block;
	font-weight: 700;
	color: #3b2d20;
	font-size: 0.9em;
	margin: 15px 0 5px 0;
}

.lc-inputs h3 + label {
	margin-top: 0;
}

.lc-inputs input,
.lc-inputs select {
	width: 100%;
	background: #ffffff;
	border: 1px solid #949494;
	color: #3b2d20;
	padding: 8px 10px;
	border-radius: 3px;
	font: inherit;
}

.lc-inputs select {
	-webkit-appearance: menulist-button;
}

.lc-inputs input:focus,
.lc-inputs select:focus,
.lc-btn:focus-visible,
.lc-scroll:focus-visible {
	outline: 3px solid #355c13;
	outline-offset: 2px;
}

.lc-inputs input[aria-invalid="true"] {
	border-color: #b42318;
}

.lc-muted {
	color: #666666;
	font-size: 0.8em;
	line-height: 1.5;
	margin: 15px 0 0 0;
}

/* ---------- Buttons (site button style, dkgreen for contrast) ---------- */

.lc-btn {
	display: inline-block;
	border: 2px solid #355c13;
	border-radius: 3px;
	background: #355c13;
	color: #ffffff;
	padding: 8px 20px;
	font: inherit;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.lc-btn:hover {
	background: #3b2d20;
	border-color: #3b2d20;
}

.lc-inputs .lc-btn {
	width: 100%;
	margin: 20px 0 0 0;
}

.lc-btn-secondary {
	background: #ffffff;
	color: #355c13;
	font-size: 0.85em;
}

.lc-btn-secondary:hover {
	background: #f6f6f6;
	border-color: #3b2d20;
	color: #3b2d20;
}

.lc-btn[disabled] {
	cursor: not-allowed;
	background: #f6f6f6;
	border-color: #cccccc;
	color: #666666;
}

.lc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 20px 0;
}

/* ---------- Messages ---------- */

.lc-error {
	color: #b42318;
	font-size: 0.9em;
	font-weight: 700;
	margin: 10px 0 0 0;
}

.lc-error:empty {
	display: none;
}

.lc-warning,
.lc-ok {
	font-size: 0.85em;
	line-height: 1.5;
	padding: 10px 15px;
	border-radius: 3px;
	margin: 15px 0 0 0;
}

.lc-warning {
	color: #3b2d20;
	background: #fbfbe6;
	border-left: 5px solid #cccc00;
}

.lc-ok {
	color: #3b2d20;
	background: #f4f9ec;
	border-left: 5px solid #98ca3c;
}

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

.lc-hero {
	background: #f6f6f6;
	border-left: 5px solid #98ca3c;
	border-radius: 3px;
	padding: 15px 20px;
	margin: 0 0 20px 0;
}

.lc-hero-label {
	display: block;
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #3b2d20;
}

.lc-amount {
	font-size: 2.2em;
	line-height: 1.2;
	font-weight: 700;
	color: #355c13;
	margin: 5px 0;
	font-variant-numeric: tabular-nums;
}

@media only screen and (min-width: 675px) {
	.lc-amount {
		font-size: 2.6em;
	}
}

.lc-hero .lc-muted {
	margin: 0;
}

.lc-stats {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0 25px;
	margin: 0;
}

@media only screen and (min-width: 480px) {
	.lc-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.lc-stat {
	border-bottom: 1px solid #e3e3e3;
	padding: 10px 0;
}

.lc-stat dt {
	font-size: 0.8em;
	color: #666666;
}

.lc-stat dd {
	margin: 0;
	font-weight: 700;
	color: #3b2d20;
	font-variant-numeric: tabular-nums;
}

.lc-notice {
	background: #f6f6f6;
	border-left: 5px solid #3b2d20;
	border-radius: 3px;
	padding: 15px 20px;
	margin: 20px 0 0 0;
	font-size: 0.85em;
	line-height: 1.6;
}

.lc-notice h4 {
	color: #3b2d20;
	margin: 0 0 8px 0;
	font-size: 1em;
}

.lc-notice p {
	margin: 0 0 10px 0;
}

.lc-small,
.lc-footnote {
	color: #666666;
	font-size: 0.75em;
	line-height: 1.5;
	margin: 15px 0 0 0;
}

.loancalc .lc-small:last-child {
	margin: 15px 0 0 0;
}

.lc-footnote {
	margin: 25px 0 0 0;
}

/* ---------- Schedule table (overrides the site-wide table rules) ---------- */

.lc-printhead {
	display: none;
}

.lc-scroll {
	overflow: auto;
	max-height: 560px;
	border: 1px solid #e3e3e3;
	border-radius: 3px;
}

.loancalc table {
	border-collapse: collapse;
	width: 100%;
	min-width: 700px;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
}

.loancalc table tr,
.loancalc table tr:first-child,
.loancalc table tr:nth-child(odd) {
	background: none;
	color: inherit;
}

.loancalc table tbody tr:nth-child(even) {
	background: #f6f6f6;
}

.loancalc table th {
	position: sticky;
	top: 0;
	background: #355c13;
	color: #ffffff;
	text-align: right;
	padding: 10px;
	white-space: nowrap;
}

.loancalc table td {
	padding: 7px 10px;
	text-align: right;
	border-top: 1px solid #e3e3e3;
	border-radius: 0;
	white-space: nowrap;
}

.loancalc table th:first-child,
.loancalc table th:nth-child(2),
.loancalc table td:first-child,
.loancalc table td:nth-child(2) {
	text-align: left;
	border-radius: 0;
}

.loancalc table td:last-child {
	border-radius: 0;
}

.loancalc table tr.lc-empty td {
	text-align: center;
	color: #666666;
	padding: 25px 10px;
	white-space: normal;
}

/* ---------- Print ---------- */

@media print {
	body > header,
	body > footer,
	.landscape,
	.lc-intro,
	.lc-inputs,
	.lc-actions,
	.lc-footnote,
	.lc-small {
		display: none !important;
	}

	.centeredcontent {
		padding: 0;
	}

	.lc-grid {
		display: block;
	}

	.lc-panel {
		padding: 10px 0;
		border: 0;
	}

	.lc-hero {
		padding: 5px 0;
		border: 0;
	}

	.lc-notice {
		border: 1px solid #999999;
	}

	.lc-warning,
	.lc-ok {
		border: 1px solid #999999;
	}

	.lc-table-panel {
		break-before: page;
	}

	.lc-printhead {
		display: block;
		margin: 0 0 10px 0;
		font-size: 0.8em;
	}

	.lc-scroll {
		max-height: none;
		overflow: visible;
		border: 0;
	}

	.loancalc table {
		min-width: 0;
		font-size: 9px;
	}

	.loancalc table th,
	.loancalc table td {
		position: static;
		padding: 3px 4px !important;
		border-top: 1px solid #cccccc;
	}
}
