/*
 * Marafiki member portal: Log in, Create account, Join (pricing) and My Marafiki.
 * Loaded only on those four pages. The brand color comes from Marafiki → Settings.
 */

.mp {
	--mp-primary: #2f6f4e;
	--mp-primary-dark: color-mix(in srgb, var(--mp-primary) 78%, #000);
	--mp-primary-tint: color-mix(in srgb, var(--mp-primary) 16%, #fff);
	--mp-ink: #1f2a24;
	--mp-ink-2: #3e4641;
	--mp-muted: #4f5852;
	--mp-subtle: #5b625d;
	--mp-ground: #f7f4ec;
	--mp-surface: #fffdf8;
	--mp-sand: #ebe5d6;
	--mp-line: #e3dccb;
	--mp-field: #cfc6b2;
	--mp-amber-bg: #f6e2c4;
	--mp-amber-ink: #6b3a0f;
	--mp-display: 'Young Serif', Georgia, 'Times New Roman', serif;
	--mp-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;

	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--mp-ground);
	color: var(--mp-ink);
	font-family: var(--mp-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body.marafiki-portal { margin: 0; background: #f7f4ec; }
.mp *, .mp *::before, .mp *::after { box-sizing: border-box; }
.mp a { color: var(--mp-primary); }
.mp a:hover { color: var(--mp-primary-dark); }
.mp p, .mp h1, .mp h2, .mp h3, .mp ul, .mp ol, .mp dl, .mp dd { margin: 0; }
.mp :focus-visible { outline: 2px solid var(--mp-primary); outline-offset: 2px; }

/* ---------- Type ---------- */
.mp-display { font-family: var(--mp-display); font-weight: 400; line-height: 1.1; color: inherit; }
.mp-h1 { font-size: clamp(32px, 4.2vw, 46px); }
.mp-h1--xl { font-size: clamp(34px, 5vw, 56px); text-wrap: balance; }
.mp-h2 { font-size: 26px; }
.mp-h2--lg { font-size: 28px; }
.mp-lede { font-size: 17px; color: var(--mp-muted); }
.mp-muted { color: var(--mp-muted); }
.mp-small { font-size: 14px; color: var(--mp-subtle); }
.mp-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a4b14; }
.mp-stack { display: flex; flex-direction: column; gap: 8px; }
.mp-stack--lg { gap: 16px; }

/* ---------- Header ---------- */
.mp-header {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
	padding: 16px clamp(16px, 4vw, 48px);
	background: var(--mp-surface);
	border-bottom: 1px solid var(--mp-line);
}
.mp-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--mp-ink); text-decoration: none; }
.mp .mp-brand { color: var(--mp-ink); }
.mp-brand img { max-height: 44px; width: auto; }
.mp-mark {
	width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
	background: var(--mp-primary); color: #fff;
	font-family: var(--mp-display); font-size: 18px;
}
.mp-brandname { font-family: var(--mp-display); font-size: 20px; }
.mp-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; font-weight: 600; }
.mp-nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.mp-nav a.mp-nav__quiet { color: var(--mp-ink-2); }

/* ---------- Buttons ---------- */
.mp .mp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1.5px solid var(--mp-primary);
	background: var(--mp-primary); color: #fff;
	font: inherit; font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.mp .mp-btn:hover { background: var(--mp-primary-dark); border-color: var(--mp-primary-dark); color: #fff; }
.mp .mp-btn--outline { background: transparent; color: var(--mp-primary); }
.mp .mp-btn--outline:hover { background: var(--mp-primary-tint); color: var(--mp-primary-dark); }
.mp .mp-btn--dark { background: var(--mp-ink); border-color: var(--mp-ink); }
.mp .mp-btn--dark:hover { background: #000; border-color: #000; }
.mp .mp-btn--block { display: flex; width: 100%; min-height: 52px; font-size: 17px; }

/* ---------- Layout ---------- */
.mp-main { flex-grow: 1; width: 100%; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 32px); display: flex; flex-direction: column; gap: 28px; }
.mp-main--narrow { max-width: 752px; }
.mp-main--mid { max-width: 1072px; gap: 40px; }
.mp-main--wide { max-width: 1192px; }
.mp-card { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: 18px; padding: clamp(20px, 3vw, 32px); }

/* ---------- Forms ---------- */
.mp-form { display: flex; flex-direction: column; gap: 18px; }
.mp-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.mp-field .mp-optional { font-weight: 400; color: var(--mp-subtle); }
.mp-label { display: block; }
.mp .mp-input {
	width: 100%; min-height: 48px; padding: 0 14px;
	border: 1px solid var(--mp-field); border-radius: 10px;
	background: #fff; color: var(--mp-ink);
	font: inherit; font-weight: 400; font-size: 16px; box-shadow: none;
}
.mp .mp-input:focus { outline: 2px solid var(--mp-primary); outline-offset: 1px; border-color: var(--mp-primary); }
.mp-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 400; line-height: 1.5; }
.mp-check input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--mp-primary); }
.mp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.mp-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.mp-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mp-fieldset + .mp-fieldset { padding-top: 20px; border-top: 1px solid var(--mp-line); }
.mp-fieldset legend { float: left; width: 100%; padding: 0; font-family: var(--mp-display); font-size: 22px; } /* float = laid out like a heading, not drawn on the border */
.mp-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.mp-divider { padding-top: 24px; border-top: 1px solid var(--mp-line); display: flex; flex-direction: column; gap: 12px; }

/* ---------- Steps ---------- */
.mp-steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; font-weight: 600; color: var(--mp-subtle); }
.mp-steps li { display: flex; align-items: center; gap: 8px; }
.mp-steps span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #a39b88; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.mp-steps .is-current { color: var(--mp-ink); }
.mp-steps .is-current span { background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; }

/* ---------- Login ---------- */
.mp-split { min-height: 100vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.mp-split__brand {
	background: var(--mp-primary); color: #fff;
	padding: clamp(32px, 6vw, 72px);
	display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.mp .mp-split__brand .mp-brand { color: #fff; }
.mp-split__brand .mp-mark { width: 44px; height: 44px; background: var(--mp-ground); color: var(--mp-ink); font-size: 20px; }
.mp-split__brand .mp-brandname { font-size: 22px; }
.mp-split__brand h1 { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.08; }
.mp-split__brand p { font-size: 18px; line-height: 1.55; color: #e8f1ec; max-width: 460px; }
.mp-split__form { display: flex; align-items: center; justify-content: center; padding: clamp(32px, 6vw, 72px) clamp(16px, 5vw, 72px); }
.mp-split__inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }
.mp-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.mp-chips li { padding: 6px 12px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; font-size: 14px; }

/* ---------- Pricing ---------- */
.mp-center { text-align: center; align-items: center; }
.mp-center .mp-lede { max-width: 560px; font-size: 18px; line-height: 1.55; }
.mp-tiers { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: stretch; }
.mp-tier { display: flex; flex-direction: column; gap: 22px; padding: 32px; background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: 18px; }
.mp-tier--featured { border: 2px solid var(--mp-primary); }
.mp-tier .mp-btn { margin-top: auto; }
.mp-badge { padding: 6px 12px; border-radius: 999px; background: var(--mp-amber-bg); color: var(--mp-amber-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.mp-price { display: flex; align-items: baseline; gap: 8px; }
.mp-price strong { font-family: var(--mp-display); font-weight: 400; font-size: 52px; line-height: 1; }
.mp-price span { color: var(--mp-muted); }
.mp-checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; line-height: 1.45; }
.mp-checks li { display: flex; gap: 12px; }
.mp-checks svg { flex-shrink: 0; margin-top: 2px; stroke: var(--mp-primary); }
.mp-orgs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 32px; background: var(--mp-sand); border-radius: 18px; }
.mp-orgs p { color: var(--mp-ink-2); max-width: 560px; }
.mp-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; font-size: 15px; color: var(--mp-muted); }
.mp-trust span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Member home ---------- */
.mp-welcome { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.mp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #dcebe2; color: #1d4a33; font-size: 14px; font-weight: 700; }
.mp-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2f6f4e; }
.mp-dash { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
.mp-dash__full { grid-column: 1 / -1; }
.mp-dash .mp-card { display: flex; flex-direction: column; gap: 18px; }
.mp-pillars { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.mp .mp-pillar {
	display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
	min-height: 96px; padding: 16px; border-radius: 14px;
	border: 1px solid var(--mp-field); background: #fff; color: var(--mp-ink);
	font: inherit; text-align: left; cursor: pointer; box-shadow: none;
}
.mp .mp-pillar:hover { border-color: var(--mp-primary); background: #fff; color: var(--mp-ink); }
.mp .mp-pillar[aria-pressed="true"] { background: var(--mp-primary); border: 2px solid var(--mp-primary); color: #fff; }
.mp-pillar strong { font-size: 16px; }
.mp-pillar span { font-size: 14px; opacity: .85; }
.mp-statuses { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mp-statuses li { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.mp-s-done { background: #dcebe2; color: #1d4a33; }
.mp-s-due { background: var(--mp-amber-bg); color: var(--mp-amber-ink); }
.mp-s-clin { background: #dbe6f2; color: #1d3c5e; }
.mp-s-na { background: #e7e3da; color: var(--mp-ink-2); }
.mp-next { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: #f3efe4; }
.mp-next small { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mp-subtle); }
.mp-dash .mp-card--soon { border-style: dashed; border-color: #c9bfa8; gap: 10px; }
.mp-dash .mp-card--sand { background: var(--mp-sand); border-color: var(--mp-sand); gap: 14px; }
.mp-summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; }
.mp-summary dt { color: var(--mp-muted); }
.mp-summary dd { font-weight: 600; }
.mp-self-start { align-self: flex-start; }
.mp-habit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--mp-line); }

/* ---------- Notices ---------- */
.mp-notice { padding: 14px 16px; border-radius: 12px; background: var(--mp-surface); border: 1px solid var(--mp-line); font-size: 15px; }
.mp-notice--error { background: #fbeae6; border-color: #e7b7ab; color: #6e1f12; }
.mp-notice--success { background: #dcebe2; border-color: #b6d3c2; color: #1d4a33; }
.mp-notice ul { margin: 0; padding-left: 18px; }
.mp-notice a { font-weight: 700; }
/* WooCommerce notices printed inside the portal */
.mp .woocommerce-error, .mp .woocommerce-message, .mp .woocommerce-info {
	list-style: none; margin: 0; padding: 14px 16px; border-radius: 12px; font-size: 15px;
	background: var(--mp-surface); border: 1px solid var(--mp-line); color: var(--mp-ink);
}
.mp .woocommerce-error { background: #fbeae6; border-color: #e7b7ab; color: #6e1f12; }
.mp .woocommerce-message { background: #dcebe2; border-color: #b6d3c2; color: #1d4a33; }
.mp .woocommerce-error::before, .mp .woocommerce-message::before, .mp .woocommerce-info::before { content: none; }
.mp .woocommerce-notices-wrapper:empty { display: none; }

/* ---------- Small states ---------- */
.mp-soon { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--mp-sand); color: var(--mp-ink-2); font-size: 13px; font-weight: 700; }
.mp .mp-pillar--static { cursor: default; }
.mp .mp-pillar--static:hover { border-color: var(--mp-field); }
.mp-tier.is-picked { box-shadow: 0 0 0 4px var(--mp-primary-tint); }
.mp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Billing switch (Join) ---------- */
.mp-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mp-sand); }
.mp .mp-switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; color: var(--mp-ink-2); font-weight: 700; font-size: 15px; text-decoration: none; }
.mp .mp-switch a:hover { color: var(--mp-ink); background: rgba(255,255,255,.5); }
.mp .mp-switch a[aria-current="page"] { background: var(--mp-primary); color: #fff; }

/* ---------- Organization inquiry ---------- */
.mp .mp-textarea { min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.mp-checkgrid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); font-weight: 400; }
.mp-done-icon { width: 52px; height: 52px; border-radius: 50%; background: #dcebe2; display: flex; align-items: center; justify-content: center; }

/* ---------- My Marafiki home ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mp-home { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.mp-home__main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.mp-home__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.mp-home__pair { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
.mp-home .mp-card { display: flex; flex-direction: column; gap: 14px; }
.mp-home .mp-card--soon { border-style: dashed; border-color: #c9bfa8; gap: 10px; }
.mp-home .mp-card--sand { background: var(--mp-sand); border-color: var(--mp-sand); gap: 12px; }
.mp-side-card { padding: 24px; }
.mp-pillars--compact { list-style: none; padding: 0; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.mp .mp-pillars--compact .mp-pillar { min-height: 0; padding: 14px; border-radius: 12px; gap: 4px; }
.mp-pillars--compact .mp-pillar strong { font-size: 15px; }
.mp-pillars--compact .mp-pillar span { font-size: 13px; color: var(--mp-muted); opacity: 1; }
.mp-statuses--sm li { padding: 5px 11px; font-size: 13px; }
.mp-season__left { font-size: 14px; font-weight: 700; color: #8a4b14; white-space: nowrap; }
.mp-progress { height: 10px; border-radius: 999px; background: var(--mp-sand); overflow: hidden; }
.mp-progress span { display: block; height: 100%; border-radius: 999px; background: var(--mp-primary); }
.mp-season-list { list-style: none; padding: 12px 0 0; border-top: 1px solid var(--mp-line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--mp-muted); }
.mp-season-list li { display: flex; justify-content: space-between; gap: 10px; }
.mp-season-list li.is-current { color: var(--mp-ink); font-weight: 700; }
.mp-links { list-style: none; padding: 0; display: flex; flex-direction: column; }
.mp-links li + li { border-top: 1px solid var(--mp-line); }
.mp .mp-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 600; text-decoration: none; }

/* Announcement */
.mp-news { display: flex; align-items: flex-start; gap: 16px; padding: 20px 20px 20px 24px; border-radius: 18px; background: var(--mp-primary); color: #fff; }
.mp-news form { margin: 0; flex-shrink: 0; }
.mp-news__icon { flex-shrink: 0; margin-top: 2px; }
.mp-news__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-news__kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.mp-news__title { font-family: var(--mp-display); font-size: 22px; line-height: 1.25; }
.mp-news__text { font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.92); }
.mp .mp-news a { color: #fff; font-weight: 700; }
.mp .mp-news__close { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.mp .mp-news__close:hover { background: rgba(255,255,255,.26); }
.mp-nav a .screen-reader-text { position: absolute; }
.mp-pillars--compact { grid-template-columns: repeat(auto-fit, minmax(min(124px, 100%), 1fr)); }
.mp-home .mp-row { flex-wrap: nowrap; }
.mp-home .mp-row > .mp-stack, .mp-home .mp-row > h2 { flex: 1 1 auto; min-width: 0; }
.mp-home .mp-row > .mp-soon, .mp-home .mp-row > .mp-season__left { flex-shrink: 0; }
@media (max-width: 420px) { .mp-home .mp-row { flex-wrap: wrap; } }
