/* AdvisorSuite Financial — calculator styles. Scoped under .mms-card / .mms-pricing. */

.mms-card {
	--mms-primary: #2a78d6;
	--mms-accent: #eb6834;
	--mms-ink: #0b0b0b;
	--mms-ink-2: #52514e;
	--mms-muted: #898781;
	--mms-line: #e1e0d9;
	--mms-surface: #fcfcfb;
	box-sizing: border-box;
	background: var(--mms-surface);
	border: 1px solid var(--mms-line);
	border-radius: 12px;
	padding: 20px;
	margin: 24px 0;
	color: var(--mms-ink);
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
}
.mms-card *,
.mms-card *::before,
.mms-card *::after {
	box-sizing: border-box;
}

.mms-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.mms-head-left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}
.mms-logo {
	max-height: 40px;
	max-width: 160px;
	width: auto;
	height: auto;
}
.mms-title {
	margin: 0;
	font-size: 18px;
	font-weight: 650;
	color: var(--mms-ink);
}
/* Doubled class beats the later `.mms-input { width: 100% }` rule. */
.mms-input.mms-currency {
	width: auto;
	flex: none;
}

.mms-body {
	display: grid;
	grid-template-columns: minmax(240px, 320px) 1fr;
	gap: 24px;
}
@media (max-width: 760px) {
	.mms-body {
		grid-template-columns: 1fr;
	}
}

/* Form */
.mms-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.mms-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-weight: 500;
}
.mms-field-label {
	font-size: 13px;
	color: var(--mms-ink-2);
}
.mms-help {
	font-size: 12px;
	font-weight: 400;
	color: var(--mms-muted);
}
.mms-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--mms-line);
	border-radius: 8px;
	background: #fff;
	color: var(--mms-ink);
	font: inherit;
}
.mms-input:focus {
	outline: 2px solid var(--mms-primary);
	outline-offset: 1px;
	border-color: var(--mms-primary);
}
.mms-input-wrap {
	position: relative;
	display: block;
}
.mms-input-wrap.is-money::before {
	content: "$";
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mms-muted);
	pointer-events: none;
}
.mms-input-wrap.is-money .mms-input {
	padding-left: 24px;
}
.mms-input-wrap.is-pct::after {
	content: "%";
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mms-muted);
	pointer-events: none;
}
.mms-input-wrap.is-pct .mms-input {
	padding-right: 26px;
}

/* Results */
.mms-results {
	min-width: 0;
}
.mms-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}
.mms-stat {
	background: #f9f9f7;
	border: 1px solid var(--mms-line);
	border-radius: 10px;
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.mms-stat-label {
	font-size: 12px;
	color: var(--mms-ink-2);
}
.mms-stat-value {
	font-size: 19px;
	font-weight: 700;
	color: var(--mms-ink);
}
.mms-stat.is-good .mms-stat-value {
	color: #006300;
}
.mms-stat.is-warn .mms-stat-value {
	color: #b02a2a;
}

.mms-chartwrap {
	position: relative;
	margin-bottom: 8px;
}
.mms-canvas {
	display: block;
	width: 100%;
}
.mms-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 12.5px;
	color: var(--mms-ink-2);
	margin-top: 4px;
}
.mms-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.mms-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 3px;
	border: 2px solid transparent;
}
.mms-swatch-dashed {
	border-style: dashed;
}
.mms-tooltip {
	position: absolute;
	z-index: 5;
	background: #fff;
	border: 1px solid var(--mms-line);
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(11, 11, 11, 0.12);
	padding: 8px 10px;
	font-size: 12.5px;
	pointer-events: none;
	white-space: nowrap;
}
.mms-tooltip .mms-swatch {
	margin-right: 5px;
}

/* Amortization / payoff tables */
.mms-details {
	margin: 8px 0 12px;
}
.mms-details summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	color: var(--mms-primary);
}
.mms-tablewrap {
	overflow-x: auto;
	margin-top: 8px;
}
.mms-table {
	border-collapse: collapse;
	width: 100%;
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
}
.mms-table th,
.mms-table td {
	text-align: right;
	padding: 6px 10px;
	border-bottom: 1px solid var(--mms-line);
	white-space: nowrap;
}
.mms-table th:first-child,
.mms-table td:first-child {
	text-align: left;
}
.mms-table th {
	color: var(--mms-ink-2);
	font-weight: 600;
}

.mms-note {
	background: #f6f2e8;
	border: 1px solid #e7dcc2;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13.5px;
	margin: 8px 0;
}

.mms-disclaimer {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--mms-muted);
	border-top: 1px solid var(--mms-line);
	padding-top: 10px;
}
/* Free-tier watermark: pinned under the card header, so it reads immediately
   without scrolling. Deliberately branded (accent rule + colored mark) rather
   than muted grey, but it stays a single slim row and never covers content. */
.mms-brandbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	padding: 9px 12px;
	background: #eef3fb;
	border: 1px solid #c9dbf3;
	border-left: 4px solid var(--mms-primary);
	border-radius: 8px;
	font-size: 13.5px;
	line-height: 1.3;
	color: var(--mms-ink-2);
}
.mms-brandbar-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 5px;
	background: var(--mms-primary);
	color: #fff;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.4px;
}
.mms-brandbar strong {
	color: var(--mms-primary);
	font-weight: 700;
}

/* Premium tools (Save / Load / Export CSV / PDF) */
.mms-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}
.mms-tool {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--mms-line);
	border-radius: 8px;
	background: #fff;
	color: var(--mms-ink-2);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 11px;
	cursor: pointer;
}
.mms-tool:hover:not(:disabled) {
	border-color: var(--mms-primary);
	color: var(--mms-primary);
}
.mms-tool:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}
.mms-tool-icon {
	font-size: 12px;
	line-height: 1;
}
.mms-tools-hint {
	flex-basis: 100%;
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--mms-muted);
}

/* ------------------------------------------------------ branded report ---
   Screen-hidden letterhead and footer. They live inside the card so that the
   browser's own "Save as PDF" produces a report on the firm's letterhead
   without any PDF library or external service. */
.mms-report-head,
.mms-report-foot {
	display: none;
}
.mms-report-brand {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	min-width: 0;
}
.mms-report-logo {
	max-height: 52px;
	max-width: 220px;
	width: auto;
	height: auto;
}
.mms-report-firm {
	font-size: 18px;
	font-weight: 700;
	color: var(--mms-primary);
}
.mms-report-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	flex: 1 1 auto;
	min-width: 0;
	gap: 2px;
	text-align: right;
}
.mms-report-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--mms-ink-2);
}
.mms-report-date {
	font-size: 11.5px;
	color: var(--mms-muted);
}

/* ------------------------------------------------------ saved scenarios --- */
.mms-scenarios {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex-basis: 100%;
	margin-top: 2px;
}
.mms-scenario-picker,
.mms-scenario-name {
	flex: 1 1 190px;
	min-width: 0;
	font-size: 13px;
	padding: 7px 10px;
}
.mms-scenario-status {
	flex-basis: 100%;
	font-size: 12px;
	color: var(--mms-muted);
	min-height: 16px;
}

/* Printing / "Save as PDF": isolate the one calculator being printed. */
@media print {
	.mms-print-target .mms-report-head {
		display: flex !important;
		flex-wrap: wrap;
		align-items: flex-end;
		justify-content: space-between;
		gap: 10px 16px;
		padding: 0 0 12px;
		margin: 0 0 16px;
		border-bottom: 3px solid var(--mms-primary);
	}
	.mms-print-target .mms-report-foot {
		display: flex !important;
		flex-direction: column;
		gap: 3px;
		margin-top: 16px;
		padding-top: 10px;
		border-top: 1px solid var(--mms-line);
		font-size: 10.5px;
		color: var(--mms-muted);
	}
	.mms-print-target .mms-report-foot span:first-child {
		font-weight: 700;
		color: var(--mms-ink-2);
	}
	.mms-print-target .mms-head,
	.mms-print-target .mms-disclaimer {
		display: none !important;
	}
	.mms-print-mode .mms-card:not(.mms-print-target) {
		display: none !important;
	}
	.mms-tools {
		display: none !important;
	}
	.mms-card {
		break-inside: avoid;
		margin: 0;
	}
	.mms-body {
		grid-template-columns: 1fr;
	}
	.mms-details[open] .mms-tablewrap {
		overflow: visible;
	}
}

/* Debt payoff rows */
.mms-debt-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.mms-debt-row {
	display: grid;
	grid-template-columns: 1.4fr 1fr 0.8fr 1fr auto;
	gap: 8px;
	align-items: end;
	padding: 10px;
	border: 1px solid var(--mms-line);
	border-radius: 10px;
	background: #f9f9f7;
}
@media (max-width: 760px) {
	.mms-debt-row {
		grid-template-columns: 1fr 1fr;
	}
}
.mms-remove {
	border: 1px solid var(--mms-line);
	background: #fff;
	border-radius: 8px;
	width: 32px;
	height: 36px;
	font-size: 16px;
	cursor: pointer;
	color: var(--mms-ink-2);
}
.mms-remove:hover {
	color: #b02a2a;
	border-color: #b02a2a;
}

/* Buttons */
.mms-btn {
	display: inline-block;
	border: 0;
	border-radius: 8px;
	background: var(--mms-primary, #2a78d6);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 10px 16px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}
.mms-btn:hover {
	filter: brightness(0.92);
	color: #fff;
}
.mms-btn-ghost {
	background: transparent;
	color: var(--mms-primary, #2a78d6);
	border: 1px dashed var(--mms-line);
}
.mms-btn-ghost:hover {
	filter: none;
	border-color: var(--mms-primary, #2a78d6);
	color: var(--mms-primary, #2a78d6);
}

/* Pricing table ([advisorsuite_pricing]) */
.mms-pricing {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin: 24px 0;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.mms-tier {
	border: 1px solid #e1e0d9;
	border-radius: 12px;
	padding: 20px;
	background: #fcfcfb;
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: center;
}
.mms-tier h4 {
	margin: 0;
	font-size: 17px;
}
.mms-tier .mms-tier-price {
	font-size: 28px;
	font-weight: 750;
	color: #0b0b0b;
}
.mms-tier .mms-tier-price small {
	font-size: 13px;
	font-weight: 400;
	color: #898781;
}
.mms-tier p {
	margin: 0;
	color: #52514e;
	font-size: 14px;
}
.mms-tier form {
	margin: 8px 0 0;
}
.mms-tier .mms-btn {
	width: 100%;
}
