/* =========================================================
   Mortgage Calculator Agent Presence — v2.0 Stylesheet
   ========================================================= */

.mortgage-calculator-wrap {
	--mc-primary:   #2563eb;
	--mc-bg:        #f8fafc;
	--mc-card:      #ffffff;
	--mc-border:    #e2e8f0;
	--mc-text:      #1e293b;
	--mc-muted:     #64748b;
	--mc-radius:    12px;
	--mc-shadow:    0 2px 16px rgba(0,0,0,.07);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--mc-text);
	max-width: 860px;
	margin: 0 auto 2.5rem;
	box-sizing: border-box;
}

.mortgage-calculator-wrap *,
.mortgage-calculator-wrap *::before,
.mortgage-calculator-wrap *::after {
	box-sizing: inherit;
}

/* ---------- Heading ---------- */
.mc-title {
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	font-weight: 700;
	color: var(--mc-text);
	margin: 0 0 .4rem;
}

.mc-description {
	color: var(--mc-muted);
	margin: 0 0 1.25rem;
	font-size: .92rem;
	line-height: 1.6;
}

/* =========================================================
   INPUTS PANEL
   ========================================================= */
.mc-inputs {
	background: var(--mc-card);
	border: 1px solid var(--mc-border);
	border-radius: var(--mc-radius);
	box-shadow: var(--mc-shadow);
	padding: 1.5rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem 1.5rem;
	margin-bottom: 1.25rem;
}

@media (max-width: 560px) {
	.mc-inputs { grid-template-columns: 1fr; }
}

.mc-field-full {
	grid-column: 1 / -1;
}

/* ---------- Field ---------- */
.mc-field label {
	display: block;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--mc-muted);
	margin-bottom: .45rem;
}

/* Label row — label left, input right */
.mc-label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: .5rem;
}

.mc-label-row label {
	margin-bottom: 0;
	flex-shrink: 0;
}

.mc-input-group {
	display: flex;
	align-items: center;
	gap: .5rem;
}

/* Compact inline input width (used on slider label rows) */
.mc-inline-input {
	width: 140px;
	flex-shrink: 0;
}

.mc-inline-input input {
	text-align: right;
}

/* ---------- Text inputs ---------- */

/*
 * All symbol wrappers use flex so the $ / % sits beside the input
 * rather than floating on top of it with absolute positioning.
 */
.mc-input-wrap {
	display: flex;
	align-items: stretch;
	border: 1.5px solid var(--mc-border);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}

.mc-input-wrap:focus-within {
	border-color: var(--mc-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc-primary) 18%, transparent);
}

.mc-input-wrap input {
	flex: 1;
	min-width: 0;
	padding: .55rem .5rem;
	border: none;
	outline: none;
	font-size: .95rem;
	color: var(--mc-text);
	background: transparent;
	-moz-appearance: textfield;
}

.mc-input-wrap input::-webkit-inner-spin-button,
.mc-input-wrap input::-webkit-outer-spin-button { opacity: 1; }

/* Dollar prefix tag */
.mc-sym {
	display: flex;
	align-items: center;
	padding: 0 .5rem;
	font-size: .88rem;
	color: var(--mc-muted);
	background: #f8fafc;
	border-right: 1px solid var(--mc-border);
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1;
}

/* Percent suffix tag */
.mc-sym-right {
	display: flex;
	align-items: center;
	padding: 0 .5rem;
	font-size: .88rem;
	color: var(--mc-muted);
	background: #f8fafc;
	border-left: 1px solid var(--mc-border);
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1;
}

/* Down payment % badge */
.mc-dp-pct {
	background: var(--mc-primary);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	border-radius: 5px;
	padding: .2rem .45rem;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ---------- Range slider ---------- */
.mc-slider {
	width: 100%;
	height: 4px;
	appearance: none;
	-webkit-appearance: none;
	background: var(--mc-border);
	border-radius: 99px;
	outline: none;
	cursor: pointer;
	display: block;
}

.mc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--mc-primary);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.2);
	cursor: pointer;
	transition: transform .1s;
}
.mc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.mc-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--mc-primary);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.2);
	cursor: pointer;
}

.mc-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: .7rem;
	color: var(--mc-muted);
	margin-top: .3rem;
}

/* ---------- Live rate note ---------- */
.mc-rate-note {
	margin: .6rem 0 0;
	font-size: .78rem;
	color: var(--mc-muted);
	line-height: 1.6;
	padding: .55rem .7rem;
	background: #f0f7ff;
	border-left: 3px solid var(--mc-primary);
	border-radius: 0 6px 6px 0;
}
.mc-rate-note strong { color: var(--mc-text); }
.mc-rate-note a { color: var(--mc-primary); text-decoration: none; }
.mc-rate-note a:hover { text-decoration: underline; }
.mc-rate-dot {
	display: inline-block;
	width: 7px; height: 7px;
	background: #22c55e;
	border-radius: 50%;
	margin-right: .35rem;
	vertical-align: middle;
}
.mc-rate-source {
	font-size: .72rem;
	color: var(--mc-muted);
}

/* ---------- Select ---------- */
.mc-select-wrap select {
	width: 100%;
	padding: .55rem .75rem;
	border: 1.5px solid var(--mc-border);
	border-radius: 8px;
	font-size: .95rem;
	color: var(--mc-text);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .75rem center;
	appearance: none;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.mc-select-wrap select:focus {
	outline: none;
	border-color: var(--mc-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc-primary) 18%, transparent);
}

/* ---------- PMI toggle row ---------- */
.mc-pmi-row {
	border-top: 1px solid var(--mc-border);
	padding-top: 1rem;
}

.mc-pmi-header {
	display: flex;
	align-items: flex-start;
}

.mc-pmi-label-group {
	display: flex;
	flex-direction: column;
	gap: .25rem;
}

.mc-pmi-title {
	font-size: .82rem;
	font-weight: 600;
	color: var(--mc-text);
}

.mc-pmi-subtitle {
	font-size: .72rem;
	color: var(--mc-muted);
}

/* Toggle switch */
.mc-toggle-wrap {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: .35rem;
}

.mc-toggle {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
	flex-shrink: 0;
}

.mc-toggle input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.mc-toggle-track {
	position: relative;
	width: 56px;
	height: 30px;
	background: #cbd5e1;
	border-radius: 99px;
	transition: background .25s;
	flex-shrink: 0;
	border: 2px solid #94a3b8;
}

.mc-toggle input:checked ~ .mc-toggle-track {
	background: var(--mc-primary);
	border-color: var(--mc-primary);
}

.mc-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
	transition: transform .25s;
}

.mc-toggle input:checked ~ .mc-toggle-track .mc-toggle-thumb {
	transform: translateX(26px);
}

/* On/Off label beside the toggle */
.mc-toggle-text {
	font-size: .85rem;
	font-weight: 700;
	min-width: 26px;
	text-align: right;
}

.mc-toggle-on  { color: var(--mc-primary); }
.mc-toggle-off { color: #94a3b8; }

.mc-pmi-rate-wrap {
	margin-top: .85rem;
}

.mc-pmi-rate-wrap label {
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--mc-muted);
	margin-bottom: .4rem;
	display: block;
}

/* =========================================================
   RESULTS PANEL
   ========================================================= */
.mc-results {
	background: var(--mc-card);
	border: 1px solid var(--mc-border);
	border-radius: var(--mc-radius);
	box-shadow: var(--mc-shadow);
	overflow: hidden;
}

.mc-total-wrap {
	text-align: center;
	padding: 1.4rem 1rem 1.25rem;
	background: var(--mc-primary);
}

.mc-total-label {
	display: block;
	color: rgba(255,255,255,.8);
	font-size: .75rem;
	letter-spacing: .09em;
	text-transform: uppercase;
	margin-bottom: .4rem;
}

.mc-total-value {
	display: block;
	color: #fff;
	font-size: clamp(2rem, 6vw, 2.75rem);
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1;
}

.mc-results-body {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
}

/* Breakdown list */
.mc-breakdown {
	flex: 1 1 280px;
	padding: 1.25rem 1.5rem;
	border-right: 1px solid var(--mc-border);
}

@media (max-width: 560px) {
	.mc-breakdown { border-right: none; border-bottom: 1px solid var(--mc-border); }
}

.mc-breakdown-row {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .5rem 0;
	font-size: .87rem;
	border-bottom: 1px dashed var(--mc-border);
	color: var(--mc-muted);
}
.mc-breakdown-row:last-child { border-bottom: none; }
.mc-breakdown-row span:last-child {
	font-weight: 600;
	color: var(--mc-text);
	margin-left: auto;
}

.mc-bk-swatch {
	width: 10px;
	height: 10px;
	border-radius: 3px;
	flex-shrink: 0;
}

.mc-mi-breakdown-row.mc-hidden { display: none; }

/* Donut + legend */
.mc-chart-wrap {
	flex: 1 1 220px;
	padding: 1.25rem 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.mc-donut { max-width: 140px; }

.mc-legend { width: 100%; }

.mc-legend-item {
	display: flex;
	align-items: center;
	gap: .45rem;
	font-size: .78rem;
	color: var(--mc-muted);
	margin-bottom: .3rem;
}
.mc-legend-swatch {
	width: 10px; height: 10px;
	border-radius: 3px;
	flex-shrink: 0;
}
.mc-legend-item span:last-child {
	font-weight: 600;
	color: var(--mc-text);
	margin-left: auto;
}
