/* MSP Membership – front-end styles (scoped to .mspm) */
.mspm {
	--mspm-primary: #0f4c5c;
	--mspm-primary-ink: #ffffff;
	--mspm-accent: #e2f1f3;
	--mspm-border: #d8dee4;
	--mspm-muted: #5f6b76;
	--mspm-bg: #ffffff;
	--mspm-soft: #f5f7f9;
	--mspm-radius: 10px;
	--mspm-ok: #1a7f37;
	--mspm-warn: #9a6700;
	--mspm-err: #b42318;
	--mspm-primary-hover: #0b3a46;
	--mspm-hero-ink: #ffffff;
	font-size: 16px;
	line-height: 1.55;
	max-width: 960px;
	margin: 0 auto;
	color: inherit;
}
.mspm *, .mspm *::before, .mspm *::after { box-sizing: border-box; }
.mspm-muted { color: var(--mspm-muted); }
.mspm-small { font-size: .875em; }
.mspm-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }

/* Grid & fields */
.mspm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.mspm-w-full, .mspm-section-title, .mspm-paragraph { grid-column: 1 / -1; }
.mspm-section-title { margin: 22px 0 0; padding-bottom: 8px; border-bottom: 2px solid var(--mspm-accent); font-size: 1.15em; color: var(--mspm-primary); }
.mspm-section-title:first-child { margin-top: 0; }
.mspm-paragraph p { margin: 0; color: var(--mspm-muted); }
.mspm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mspm-field[hidden], .mspm-section-title[hidden], .mspm-paragraph[hidden] { display: none !important; }
.mspm-label { font-weight: 600; font-size: .95em; }
.mspm-req { color: var(--mspm-err); }
.mspm-pass { position: relative; display: block; }
.mspm-pass input { padding-right: 70px !important; }
.mspm-pass__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--mspm-primary); font: inherit; font-size: .85em; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.mspm-field-error { color: var(--mspm-err); font-size: .875em; font-weight: 600; }
.mspm-field-error:empty { display: none; }
.mspm-field input.is-invalid { border-color: var(--mspm-err); }
.mspm-field input[type="password"] { width: 100%; padding: 10px 12px; border: 1px solid var(--mspm-border); border-radius: 8px; background: var(--mspm-bg); font: inherit; color: inherit; min-height: 44px; }
.mspm-help, .mspm-hint { color: var(--mspm-muted); font-size: .85em; }
.mspm-field input[type="text"], .mspm-field input[type="email"], .mspm-field input[type="tel"],
.mspm-field input[type="number"], .mspm-field input[type="date"], .mspm-field select, .mspm-field textarea,
.mspm-verify input[type="text"] {
	width: 100%; padding: 10px 12px; border: 1px solid var(--mspm-border); border-radius: 8px;
	background: var(--mspm-bg); font: inherit; color: inherit; min-height: 44px;
}
.mspm-field textarea { min-height: 96px; resize: vertical; }
.mspm-field input:focus, .mspm-field select:focus, .mspm-field textarea:focus, .mspm-verify input:focus {
	outline: 2px solid var(--mspm-primary); outline-offset: 1px; border-color: var(--mspm-primary);
}
.mspm-field input[type="file"] { padding: 10px; border: 1px dashed var(--mspm-border); border-radius: 8px; background: var(--mspm-soft); width: 100%; }
.mspm-choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mspm-choices label, .mspm-consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.mspm-choices input, .mspm-consent input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--mspm-primary); }
.mspm-consent { padding: 12px 14px; background: var(--mspm-soft); border-radius: 8px; }
.mspm-file-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.mspm-file-list li { font-size: .92em; }
.mspm-file-list li::before { content: "📎 "; }
.mspm-remove { margin-left: 8px; color: var(--mspm-err); font-size: .85em; }

/* Membership type cards */
.mspm-type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mspm-type-card { position: relative; cursor: pointer; }
.mspm-type-card input { position: absolute; opacity: 0; inset: 0; }
.mspm-type-card__body { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 2px solid var(--mspm-border); border-radius: var(--mspm-radius); transition: border-color .15s, background .15s; }
.mspm-type-card__fee { font-size: 1.6em; font-weight: 700; color: var(--mspm-primary); line-height: 1.2; }
.mspm-type-card small { color: var(--mspm-muted); }
.mspm-type-card small.mspm-type-card__note { display: block; margin-top: 8px; font-size: .75em; line-height: 1.45; font-weight: 400; }
.mspm-type-card input:checked + .mspm-type-card__body { border-color: var(--mspm-primary); background: var(--mspm-accent); }
.mspm-type-card input:focus-visible + .mspm-type-card__body { outline: 2px solid var(--mspm-primary); outline-offset: 2px; }

/* Buttons */
.mspm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
	border-radius: 8px; border: 1px solid var(--mspm-primary); background: var(--mspm-bg); color: var(--mspm-primary);
	font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.mspm-btn:hover, .mspm-btn:focus-visible { background: var(--mspm-accent); color: var(--mspm-primary); }
.mspm-btn--primary { background: var(--mspm-primary); color: var(--mspm-primary-ink); }
.mspm-btn--primary:hover, .mspm-btn--primary:focus-visible { background: var(--mspm-primary-hover); border-color: var(--mspm-primary-hover); color: var(--mspm-primary-ink); }
.mspm-btn--small { min-height: 34px; padding: 6px 12px; font-size: .9em; }
.mspm-btn.is-busy { opacity: .6; cursor: progress; }
.mspm-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.mspm-inline-form { display: inline-block; margin: 0; }

/* Notices */
.mspm-notice { padding: 14px 16px; border-radius: 8px; border-left: 4px solid var(--mspm-primary); background: var(--mspm-accent); margin: 0 0 18px; }
.mspm-notice ul { margin: 6px 0 0 18px; padding: 0; }
.mspm-notice .mspm-btn { margin-top: 10px; }
.mspm-notice--success { border-color: var(--mspm-ok); background: color-mix(in srgb, var(--mspm-ok) 10%, #fff); }
.mspm-notice--warning { border-color: var(--mspm-warn); background: color-mix(in srgb, var(--mspm-warn) 10%, #fff); }
.mspm-notice--error { border-color: var(--mspm-err); background: color-mix(in srgb, var(--mspm-err) 9%, #fff); }
.mspm-renew { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.mspm-renew .mspm-btn { margin: 0; }
.mspm-renew-note { margin: 0 0 18px; }

/* Badges */
.mspm-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78em; font-weight: 600; background: color-mix(in srgb, var(--mspm-muted) 14%, #fff); color: color-mix(in srgb, var(--mspm-muted) 70%, #000); vertical-align: middle; }
.mspm-badge--active { background: color-mix(in srgb, var(--mspm-ok) 14%, #fff); color: color-mix(in srgb, var(--mspm-ok) 85%, #000); }
.mspm-badge--pending, .mspm-badge--info_requested, .mspm-badge--expired { background: color-mix(in srgb, var(--mspm-warn) 15%, #fff); color: color-mix(in srgb, var(--mspm-warn) 80%, #000); }
.mspm-badge--approved { background: var(--mspm-accent); color: var(--mspm-primary); }
.mspm-badge--lapsed, .mspm-badge--rejected, .mspm-badge--cancelled { background: color-mix(in srgb, var(--mspm-err) 13%, #fff); color: color-mix(in srgb, var(--mspm-err) 85%, #000); }

/* Dashboard */
.mspm-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding: 22px 24px; border-radius: 14px; background: var(--mspm-primary); color: var(--mspm-hero-ink); margin-bottom: 20px; }
.mspm-hero__eyebrow { margin: 0; color: var(--mspm-hero-ink); font-size: .85em; text-transform: uppercase; letter-spacing: .06em; }
.mspm-hero__name { margin: 2px 0 8px; color: var(--mspm-hero-ink); font-size: 1.6em; line-height: 1.2; }
.mspm-hero__meta { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 26px; margin: 0; align-self: center; }
.mspm-hero__meta dt { font-size: .78em; color: var(--mspm-hero-ink); }
.mspm-hero__meta dd { margin: 0; font-weight: 700; color: var(--mspm-hero-ink); }
.mspm-hero a { color: inherit; }
.mspm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--mspm-border); margin: 8px 0 18px; overflow-x: auto; }
.mspm-tab { padding: 10px 16px; text-decoration: none; color: var(--mspm-muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.mspm-tab.is-active, .mspm-tab:hover { color: var(--mspm-primary); border-bottom-color: var(--mspm-primary); }
.mspm-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mspm-doc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--mspm-border); border-radius: var(--mspm-radius); }
.mspm-doc__icon { font-size: 1.6em; }
.mspm-doc__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mspm-doc__body small { color: var(--mspm-muted); }
.mspm-doc__actions { display: flex; align-items: center; gap: 12px; }
.mspm-details { margin-bottom: 18px; border: 1px solid var(--mspm-border); border-radius: var(--mspm-radius); padding: 12px 16px; }
.mspm-details summary { cursor: pointer; font-weight: 600; }
.mspm-summary h4 { margin: 18px 0 8px; color: var(--mspm-primary); }
.mspm-dl { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 6px 16px; margin: 0; }
.mspm-dl dt { color: var(--mspm-muted); }
.mspm-dl dd { margin: 0; overflow-wrap: anywhere; }
.mspm-table-wrap { overflow-x: auto; }
.mspm-table { width: 100%; border-collapse: collapse; }
.mspm-table th, .mspm-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--mspm-border); vertical-align: top; }
.mspm-logout { margin-top: 30px; text-align: right; font-size: .9em; }
.mspm-login { max-width: 420px; }

/* Payment */
.mspm-pay { max-width: 560px; }
.mspm-pay__card { border: 1px solid var(--mspm-border); border-radius: 14px; padding: 24px; }
.mspm-pay__card h2 { margin-top: 0; }
.mspm-pay__amount { font-size: 1.5em; font-weight: 700; color: var(--mspm-primary); }
.mspm-pay__methods { display: grid; gap: 10px; margin-top: 20px; }
.mspm-btn--gateway { width: 100%; min-height: 52px; justify-content: space-between; }
.mspm-gw__total { font-variant-numeric: tabular-nums; }
.mspm-gw__note { margin: -4px 0 4px; font-size: .85em; color: var(--mspm-muted); text-align: right; }
.mspm-btn--billplz { background: var(--mspm-primary); color: var(--mspm-primary-ink); }
.mspm-btn--billplz:hover, .mspm-btn--billplz:focus-visible { background: var(--mspm-primary-hover); color: var(--mspm-primary-ink); }
.mspm-pay__done { text-align: center; padding: 30px 10px; }
.mspm-pay__tick { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: color-mix(in srgb, var(--mspm-ok) 14%, #fff); color: var(--mspm-ok); font-size: 34px; line-height: 64px; }

/* Verify */
.mspm-verify { max-width: 520px; }
.mspm-verify__row { display: flex; gap: 8px; margin-top: 6px; }
.mspm-verify__result { margin-top: 18px; padding: 16px; border-radius: 10px; }
.mspm-verify__result--ok { background: color-mix(in srgb, var(--mspm-ok) 12%, #fff); border-left: 4px solid var(--mspm-ok); }
.mspm-verify__result--no { background: color-mix(in srgb, var(--mspm-err) 12%, #fff); border-left: 4px solid var(--mspm-err); }

@media (max-width: 640px) {
	.mspm-grid { grid-template-columns: 1fr; }
	.mspm-hero__meta { grid-template-columns: 1fr 1fr; }
	.mspm-dl { grid-template-columns: 1fr; gap: 2px; }
	.mspm-dl dd { margin-bottom: 8px; }
	.mspm-doc { flex-wrap: wrap; }
	.mspm-doc__actions { width: 100%; justify-content: flex-end; }
	.mspm-table thead { display: none; }
	.mspm-table tr { display: block; border-bottom: 1px solid var(--mspm-border); padding: 8px 0; }
	.mspm-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; }
	.mspm-table td[data-label]::before { content: attr(data-label); color: var(--mspm-muted); }
}

/* [msp_auth_buttons] – header buttons */
.mspm.mspm-auth { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: none; margin: 0; font-size: 15px; line-height: 1.2; vertical-align: middle; }
/* align="left|center|right": positions the buttons in the header row or block they are placed in */
.mspm.mspm-auth--left, .mspm.mspm-auth--center, .mspm.mspm-auth--right { display: flex; width: fit-content; }
.mspm.mspm-auth--left { justify-content: flex-start; margin-right: auto; }
.mspm.mspm-auth--center { justify-content: center; margin-left: auto; margin-right: auto; }
.mspm.mspm-auth--right { justify-content: flex-end; margin-left: auto; }
/* The Shortcode block wraps output in <p>: move that wrapper too. */
p:has(> .mspm-auth--right:only-child) { margin-left: auto; margin-right: 0; }
p:has(> .mspm-auth--center:only-child) { margin-left: auto; margin-right: auto; }
p:has(> .mspm-auth--left:only-child) { margin-right: auto; }
:where(p, div):has(> .mspm-auth:only-child) { margin-top: 0; margin-bottom: 0; }
/* Elementor: in a row container widgets are only as wide as their content, so move the widget itself. */
.elementor .elementor-widget:has(.mspm-auth--right) { margin-inline-start: auto !important; }
.elementor .elementor-widget:has(.mspm-auth--left) { margin-inline-end: auto !important; }
.elementor .elementor-widget:has(.mspm-auth--center) { margin-inline: auto !important; }
.elementor .elementor-widget:has(.mspm-auth--right) .elementor-shortcode { display: flex; justify-content: flex-end; }
.mspm-auth .mspm-auth__btn { min-height: 40px; padding: 8px 18px; white-space: nowrap; text-decoration: none !important; }
.mspm-auth--small .mspm-auth__btn { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.mspm-auth--large .mspm-auth__btn { min-height: 48px; padding: 12px 24px; font-size: 16px; }
.mspm-auth .mspm-btn:not(.mspm-btn--primary) { background: transparent; }

.mspm-account { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--mspm-border); }
.mspm-account h3 { margin: 0 0 6px; }

/* Login / forgot / reset (Member Dashboard, logged out) */
.mspm.mspm-login { max-width: 440px; }
.mspm-login h3 { margin: 0 0 12px; }
.mspm-login__form .mspm-field { margin-bottom: 14px; }
.mspm-login__form .mspm-field input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--mspm-border); border-radius: 8px; background: var(--mspm-bg); font: inherit; color: inherit; min-height: 44px; }
.mspm-login__form .mspm-actions { margin-top: 8px; }
.mspm-login__form .mspm-btn--primary { width: 100%; }
.mspm-login__remember { background: none; padding: 0; }
.mspm-login__links { margin-top: 14px; font-size: .92em; }

/* [msp_member_directory] */
.mspm-directory { max-width: 860px; }
.mspm-directory__search { margin-bottom: 16px; }
.mspm-directory__search input { width: 100%; padding: 10px 14px; border: 1px solid var(--mspm-border); border-radius: 8px; background: var(--mspm-bg); font: inherit; color: inherit; min-height: 44px; }
.mspm-directory__search input:focus { outline: 2px solid var(--mspm-primary); outline-offset: 1px; }
.mspm-directory__none { margin: 10px 0 0; color: var(--mspm-muted); }
.mspm-directory__group { border: 1px solid var(--mspm-border); border-radius: var(--mspm-radius); margin-bottom: 12px; background: var(--mspm-bg); overflow: hidden; }
.mspm-directory__group[hidden] { display: none; }
.mspm-directory__summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.1em; color: var(--mspm-primary); }
.mspm-directory__summary::-webkit-details-marker { display: none; }
.mspm-directory__summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 4px 0 auto; transition: transform .2s; flex: none; }
.mspm-directory__group[open] > .mspm-directory__summary::after { transform: rotate(-135deg); margin-top: 4px; }
.mspm-directory__summary:hover, .mspm-directory__summary:focus-visible { background: var(--mspm-accent); outline: none; }
.mspm-directory__label { flex: 1; }
.mspm-directory__count { min-width: 2.2em; padding: 2px 10px; border-radius: 999px; background: var(--mspm-primary); color: var(--mspm-primary-ink); font-size: .8em; text-align: center; font-variant-numeric: tabular-nums; }
.mspm-directory__list { margin: 0; padding: 4px 20px 16px 52px; columns: 2 280px; column-gap: 32px; border-top: 1px solid var(--mspm-border); }
.mspm-directory__list li { padding: 7px 0; break-inside: avoid; border-bottom: 1px dashed var(--mspm-border); }
.mspm-directory__list li[hidden] { display: none; }
.mspm-directory__no { display: block; font-size: .8em; color: var(--mspm-muted); }
.mspm-directory__empty { margin: 0; padding: 14px 20px 18px; color: var(--mspm-muted); border-top: 1px solid var(--mspm-border); }
@media (max-width: 640px) { .mspm-directory__list { columns: 1; padding-left: 40px; } }
