/* MemberMath v1.3.0 — dark design system (approved mockup v4).
 * Every color and font flows through CSS custom properties set inline by the
 * shortcode from WP Admin settings. Inputs carry hard resets so The7 /
 * Elementor form styling cannot bleed in. */

.membermath {
	--mm-bg1: #0b3866;
	--mm-bg2: #062748;
	--mm-ink: #ffffff;
	--mm-ink-soft: #b8d4ea;
	--mm-accent: #00ace7;
	--mm-light: #9fdbef;
	--mm-cta: #00ace7;
	--mm-cta-ink: #ffffff;
	--mm-green: #7ee2a8;
	--mm-red: #ffb3b3;
	--mm-font-head: "Roboto Slab", Georgia, serif;
	--mm-font-body: "Noto Sans", -apple-system, sans-serif;

	font-family: var(--mm-font-body);
	background: linear-gradient(165deg, var(--mm-bg1), var(--mm-bg2));
	border-radius: 16px;
	/* The card contributes zero space above itself — external spacing
	 * belongs to Elementor. Interior padding is the original 28px
	 * (v1.4.4 revert of the 10px top experiment). */
	margin-top: 0;
	padding: 28px;
	color: var(--mm-ink);
	max-width: 720px;
	margin: 0 auto;
	box-shadow: 0 8px 30px rgba(4, 32, 61, 0.25);
}

.membermath *,
.membermath *::before,
.membermath *::after { box-sizing: border-box; }

.membermath .mm-loading,
.membermath .mm-error { padding: 10px 4px; color: var(--mm-ink-soft); font-size: 0.95em; }
.membermath .mm-error { color: var(--mm-red); }

.membermath .mm-title {
	font-family: var(--mm-font-head);
	font-weight: 800;
	font-size: 26px;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--mm-ink);
}

.membermath .mm-sub { margin: 0 0 22px; color: var(--mm-ink-soft); font-size: 15px; }

/* ------------------------------------------------------------------ */
/* Tabs                                                                */
/* ------------------------------------------------------------------ */

.membermath .mm-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 14px;
	background: rgba(255, 255, 255, 0.08);
	padding: 5px;
	border-radius: 12px;
}

.membermath .mm-tab {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	box-shadow: none;
	flex: 1;
	text-align: center;
	padding: 11px 8px;
	border-radius: 8px;
	font-family: var(--mm-font-body);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	color: var(--mm-ink-soft);
	cursor: pointer;
	margin: 0;
}

.membermath .mm-tab.is-active { background: #fff; color: #0b2b4a; }
.membermath .mm-tab:focus-visible { outline: 3px solid var(--mm-accent); outline-offset: 1px; }

.membermath .mm-tab-sub { margin: 0 0 18px; color: var(--mm-ink-soft); font-size: 14px; }
.membermath .mm-tab-sub[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* Form grid & fields                                                  */
/* ------------------------------------------------------------------ */

.membermath .mm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.membermath .mm-span2 { grid-column: 1 / -1; }

.membermath .mm-field label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	font-weight: 700;
	font-size: 13.5px;
	margin: 0 0 7px;
	color: var(--mm-ink);
	line-height: 1.35;
}

.membermath .mm-label { display: inline-flex; align-items: center; gap: 6px; }
.membermath .mm-req { color: var(--mm-light); font-weight: 400; font-size: 12px; }
.membermath .mm-opt { color: var(--mm-ink-soft); font-weight: 400; font-size: 12px; }

.membermath .mm-input {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 10px;
	border: 0;
	overflow: hidden;
	height: 52px;
}

.membermath .mm-input:focus-within { outline: 3px solid var(--mm-accent); outline-offset: 1px; }
.membermath .mm-input .mm-fix { padding: 0 2px 0 14px; color: #47586a; font-weight: 600; font-size: 16px; flex: none; }
.membermath .mm-input .mm-fix.right { padding: 0 14px 0 2px; }

/* Hard resets: keep theme form styles out. Inputs and selects styled
 * separately so select text stays vertically centered. */
.membermath .mm-input input {
	all: unset;
	flex: 1;
	min-width: 0;
	height: 100% !important;
	min-height: 0 !important;
	max-height: none !important;
	padding: 0 14px 0 6px !important;
	margin: 0 !important;
	font-family: var(--mm-font-body) !important;
	font-weight: 600;
	font-size: 17px !important;
	line-height: normal !important;
	color: #0b2b4a !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	vertical-align: middle;
}

.membermath .mm-input select {
	flex: 1;
	min-width: 0;
	height: 100% !important;
	min-height: 0 !important;
	max-height: none !important;
	border: 0 !important;
	outline: 0;
	/* Custom chevron so the control is obviously a dropdown — theme resets
	 * suppress the native arrow. Color matches the $/% affix (#47586a). */
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-color: #fff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2347586a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 12px 8px !important;
	box-shadow: none !important;
	padding: 0 40px 0 14px !important;
	margin: 0 !important;
	cursor: pointer;
	font-family: var(--mm-font-body) !important;
	font-weight: 600;
	font-size: 17px !important;
	line-height: normal !important;
	color: #0b2b4a !important;
	border-radius: 0;
}

.membermath .mm-input select::-ms-expand { display: none; }

.membermath .mm-input input::placeholder { color: #9db0c2; font-weight: 400; opacity: 1; }

/* ------------------------------------------------------------------ */
/* Tooltips                                                            */
/* ------------------------------------------------------------------ */

.membermath .mm-tip {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
	font-family: var(--mm-font-body);
	font-size: 11px;
	font-weight: 800;
	width: 17px;
	height: 17px;
	line-height: 17px;
	padding: 0;
	text-align: center;
	border-radius: 50%;
	cursor: help;
	position: relative;
	flex: none;
	box-shadow: none;
}

.membermath .mm-tip::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #04203d;
	color: #fff;
	font-weight: 400;
	font-size: 12px;
	line-height: 1.45;
	padding: 8px 10px;
	border-radius: 6px;
	width: max-content;
	max-width: 230px;
	text-align: left;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	z-index: 20;
}

.membermath .mm-tip:hover::after,
.membermath .mm-tip:focus-visible::after { opacity: 1; }
.membermath .mm-tip:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 1px; }

/* ------------------------------------------------------------------ */
/* Sliders                                                             */
/* ------------------------------------------------------------------ */

.membermath .mm-slider-value {
	color: var(--mm-light);
	font-weight: 800;
	font-size: 15px;
	white-space: nowrap;
}

.membermath input[type="range"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	width: 100%;
	height: 8px !important;
	min-height: 0 !important;
	max-height: none !important;
	border-radius: 4px !important;
	background: linear-gradient(to right, var(--mm-accent) var(--fill, 50%), rgba(255, 255, 255, 0.22) var(--fill, 50%)) !important;
	outline: none;
	margin: 14px 0 6px !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	display: block;
}

.membermath input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #fff;
	border: 4px solid var(--mm-accent);
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.membermath input[type="range"]::-moz-range-thumb {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #fff;
	border: 4px solid var(--mm-accent);
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.membermath input[type="range"]:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

/* Locked single-stop slider (e.g. 15-year land loans, FHA/VA 30-year,
 * single-term model years): thumb at the right, track fully filled,
 * control disabled — never an ambiguous grey slider. */
.membermath input[type="range"].is-locked { cursor: not-allowed; opacity: 0.92; }
.membermath input[type="range"].is-locked::-webkit-slider-thumb { cursor: not-allowed; }
.membermath input[type="range"].is-locked::-moz-range-thumb { cursor: not-allowed; }
.membermath .mm-ticks.is-locked { justify-content: flex-end; }
.membermath .mm-ticks.is-locked .mm-tick { flex: none; text-align: right; }
.membermath .mm-locked-note { margin: 4px 0 0; font-size: 12.5px; color: var(--mm-ink-soft); }

.membermath .mm-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--mm-ink-soft); }
.membermath .mm-tick { flex: 1; text-align: center; }
.membermath .mm-tick:first-child { text-align: left; }
.membermath .mm-tick:last-child { text-align: right; }
.membermath .mm-tick .mm-tick-label { display: block; }
.membermath .mm-tick.is-active .mm-tick-label { color: var(--mm-ink); font-weight: 800; }

.membermath .mm-tick-sub {
	display: block;
	font-size: 10px;
	color: var(--mm-light);
	font-weight: 700;
	letter-spacing: 0.03em;
}

/* ------------------------------------------------------------------ */
/* Eligibility message                                                 */
/* ------------------------------------------------------------------ */

.membermath .mm-msg {
	margin-top: 18px;
	padding: 12px 16px;
	border-left: 4px solid var(--mm-light);
	background: rgba(159, 219, 239, 0.12);
	border-radius: 0 10px 10px 0;
	font-size: 14px;
	color: var(--mm-ink);
}

.membermath .mm-msg[hidden] { display: none; }

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

.membermath .mm-results {
	margin-top: 22px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	padding: 24px 22px 22px;
	text-align: center;
	transition: border-color 0.25s ease;
}

.membermath.mm-mode-standard .mm-results { border-color: var(--mm-light); }

.membermath .mm-kicker {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mm-ink-soft);
	margin: 0 0 4px;
}

.membermath .mm-hero {
	font-family: var(--mm-font-head);
	font-weight: 900;
	font-size: 52px;
	line-height: 1.05;
	color: var(--mm-ink);
}

.membermath .mm-hero .mm-per { font-size: 20px; font-weight: 700; color: var(--mm-ink-soft); }
.membermath .mm-hero-sub { margin-top: 4px; font-size: 14px; color: var(--mm-ink-soft); }

.membermath .mm-lines { margin: 18px 0 0; padding: 0; list-style: none; text-align: left; }

.membermath .mm-lines li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 2px;
	margin: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 15px;
	color: var(--mm-ink-soft);
}

.membermath .mm-lines li strong { color: var(--mm-ink); font-weight: 700; text-align: right; }
.membermath .mm-lines li strong.mm-save { color: var(--mm-green); }
.membermath .mm-lines li strong.mm-cost { color: var(--mm-red); }

.membermath .mm-gate { padding: 26px 10px; color: var(--mm-ink-soft); font-size: 15px; }
.membermath .mm-hint { padding: 20px 10px; color: var(--mm-ink-soft); font-size: 15px; margin: 0; }

/* ------------------------------------------------------------------ */
/* CTA                                                                 */
/* ------------------------------------------------------------------ */

.membermath a.mm-cta {
	display: block;
	width: 100%;
	margin-top: 18px;
	background: var(--mm-cta);
	color: var(--mm-cta-ink);
	text-decoration: none;
	text-align: center;
	font-family: var(--mm-font-body);
	font-weight: 800;
	font-size: 17px;
	padding: 16px;
	border-radius: 10px;
	transition: filter 0.15s ease;
}

.membermath a.mm-cta:hover,
.membermath a.mm-cta:focus-visible { filter: brightness(1.08); color: var(--mm-cta-ink); }

.membermath .mm-cta-note { margin: 10px 0 0; font-size: 12.5px; color: var(--mm-ink-soft); text-align: center; }
.membermath .mm-pi-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--mm-ink-soft); text-align: center; }

/* Server-rendered crawlable description; doubles as the loading state and
 * is replaced by the calculator when JS boots. */
.membermath .mm-seo { margin: 0; color: var(--mm-ink-soft); font-size: 14.5px; line-height: 1.65; }

/* Link-styled tab (navigates instead of switching panes). */
.membermath a.mm-tab-link { text-decoration: none !important; display: flex; align-items: center; justify-content: center; }
.membermath a.mm-tab-link:hover { color: var(--mm-ink); }

/* ------------------------------------------------------------------ */
/* Disclaimer (outside the card, on the page background)               */
/* ------------------------------------------------------------------ */

.membermath-disclaimer {
	max-width: 720px;
	margin: 12px auto 0;
	font-size: 12.5px;
	line-height: 1.55;
	color: #6b7c8d;
}

.membermath-disclaimer:empty { display: none; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 560px) {
	.membermath { padding: 20px 16px; border-radius: 14px; }
	.membermath .mm-title { font-size: 22px; }
	.membermath .mm-grid { grid-template-columns: 1fr; gap: 16px; }
	.membermath .mm-hero { font-size: 42px; }
	.membermath .mm-tabs { flex-direction: column; }
	/* Thin out crowded tick labels; endpoints and the active stop stay. */
	.membermath .mm-ticks .mm-tick:nth-child(even):not(.is-active) .mm-tick-label { visibility: hidden; }
	.membermath .mm-ticks .mm-tick:not(.is-active) .mm-tick-sub { visibility: hidden; }
	.membermath .mm-results { padding: 20px 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.membermath * { transition: none !important; }
}
