/* The Curiosi Pro Membership Manager – front-end styles.
 * Theme-friendly: inherits fonts, uses CSS custom properties you can override in your theme:
 * .cpmm { --cpmm-accent: #your-brand; }
 */
.cpmm,
.cpmm-member-card,
.cpmm-print {
	/* The Curiosi brand. Replace the hex values with the exact brand palette if they differ. */
	--cpmm-navy: #1b2559;
	--cpmm-purple: #6c3bd1;
	--cpmm-purple-dark: #5527b0;
	--cpmm-lime: #b8e62e;
	--cpmm-accent: var(--cpmm-purple);
	--cpmm-accent-contrast: #fff;
	color: var(--cpmm-navy);
	font-size: max(16px, 1rem);
	line-height: 1.55;
	--cpmm-border: rgba(0, 0, 0, 0.12);
	--cpmm-muted: rgba(0, 0, 0, 0.6);
	--cpmm-surface: rgba(0, 0, 0, 0.03);
	--cpmm-radius: 8px;
	--cpmm-success: #0f7b3e;
	--cpmm-error: #b42318;
	box-sizing: border-box;
}
.cpmm *, .cpmm *::before, .cpmm *::after { box-sizing: inherit; }

/* Notices */
.cpmm-notice { padding: 12px 16px; border-radius: var(--cpmm-radius); margin: 0 0 16px; border-left: 4px solid var(--cpmm-accent); background: var(--cpmm-surface); }
.cpmm-notice ul { margin: 0; padding-left: 18px; }
.cpmm-notice--success { border-left-color: var(--cpmm-success); }
.cpmm-notice--error { border-left-color: var(--cpmm-error); }

/* Forms */
.cpmm-form-wrap { max-width: 560px; }
.cpmm-account .cpmm-form { max-width: 640px; }
.cpmm-form { margin: 0 0 24px; }
.cpmm-form--secondary { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--cpmm-border); }
.cpmm-field { margin: 0 0 14px; }
.cpmm-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.cpmm-field--checkbox label, .cpmm-field label:has(input[type="checkbox"]) { font-weight: normal; }
.cpmm-field input[type="text"], .cpmm-field input[type="email"], .cpmm-field input[type="password"],
.cpmm-field input[type="tel"], .cpmm-field input[type="url"], .cpmm-field input[type="number"],
.cpmm-field input[type="date"], .cpmm-field select, .cpmm-field textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--cpmm-border); border-radius: 6px; font: inherit; background: #fff; color: inherit;
}
.cpmm-field input:focus, .cpmm-field select:focus, .cpmm-field textarea:focus { outline: 2px solid var(--cpmm-accent); outline-offset: 1px; }
.cpmm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cpmm-req { color: var(--cpmm-error); }
.cpmm-help { display: block; color: var(--cpmm-muted); font-size: 0.875em; margin-top: 4px; }
.cpmm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cpmm-password { display: flex; gap: 6px; }
.cpmm-password input { flex: 1; }
.cpmm-toggle-pass { padding: 0 12px; border: 1px solid var(--cpmm-border); border-radius: 6px; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.cpmm-avatar-preview { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 50%; margin-top: 8px; }
.cpmm-fieldset { border: 1px solid var(--cpmm-border); border-radius: var(--cpmm-radius); padding: 12px 16px; margin: 16px 0; }
.cpmm-alt { font-size: 0.9375em; }

/* Plan choice in registration */
.cpmm-plan-choice { border: 0; padding: 0; margin: 0 0 16px; }
.cpmm-plan-choice legend { font-weight: 600; margin-bottom: 8px; }
.cpmm-plan-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--cpmm-border); border-radius: 6px; margin-bottom: 8px; cursor: pointer; }
.cpmm-plan-option:has(input:checked) { border-color: var(--cpmm-accent); box-shadow: 0 0 0 1px var(--cpmm-accent); }
.cpmm-plan-option__name { font-weight: 600; flex: 1; }

/* Buttons */
.cpmm-button { display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--cpmm-accent); color: var(--cpmm-accent); background: transparent; text-decoration: none; font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; text-align: center; }
.cpmm-button:hover, .cpmm-button:focus { opacity: 0.9; text-decoration: none; }
.cpmm-button--primary { background: var(--cpmm-accent); color: var(--cpmm-accent-contrast); }
.cpmm-button.is-disabled { opacity: 0.55; cursor: default; }
.cpmm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 0; }
.cpmm-link-button { background: none; border: 0; padding: 0; color: var(--cpmm-error); text-decoration: underline; cursor: pointer; font: inherit; margin-top: 12px; }

/* Plans */
.cpmm-plans__grid { display: grid; grid-template-columns: repeat(var(--cpmm-cols, 3), minmax(0, 1fr)); gap: 20px; }
.cpmm-plan { display: flex; flex-direction: column; border: 1px solid var(--cpmm-border); border-radius: var(--cpmm-radius); padding: 24px; background: #fff; }
.cpmm-plan.is-current { border-color: var(--cpmm-accent); box-shadow: 0 0 0 2px var(--cpmm-accent); }
.cpmm-plan__name { margin: 0 0 8px; }
.cpmm-price { font-size: 1.5em; font-weight: 700; margin-bottom: 12px; }
.cpmm-price__period { font-size: 0.55em; font-weight: 400; color: var(--cpmm-muted); }
.cpmm-price__trial { display: block; font-size: 0.5em; font-weight: 600; color: var(--cpmm-success); }
.cpmm-plan__features { list-style: none; padding: 0; margin: 0 0 16px; flex: 1; }
.cpmm-plan__features li { padding: 6px 0 6px 22px; position: relative; border-bottom: 1px solid var(--cpmm-border); }
.cpmm-plan__features li::before { content: "✓"; position: absolute; left: 0; color: var(--cpmm-success); font-weight: 700; }
.cpmm-plan__cta .cpmm-button { width: 100%; }

/* Locked content */
.cpmm-teaser { position: relative; max-height: 12em; overflow: hidden; }
.cpmm-teaser::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4em; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); }
.cpmm-locked__box { border: 1px dashed var(--cpmm-border); border-radius: var(--cpmm-radius); padding: 24px; text-align: center; background: var(--cpmm-surface); margin: 16px 0; }
.cpmm-locked__icon { display: inline-flex; color: var(--cpmm-accent); margin-bottom: 8px; }
.cpmm-locked__plans { color: var(--cpmm-muted); font-size: 0.9375em; }
.cpmm-locked__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 0; }

/* Account */
.cpmm-account__header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cpmm-account__avatar { border-radius: 50%; }
.cpmm-account__title { margin: 0; }
.cpmm-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--cpmm-border); margin-bottom: 20px; }
.cpmm-tabs__tab { padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cpmm-tabs__tab.is-active { border-bottom-color: var(--cpmm-accent); font-weight: 600; }
.cpmm-card { border: 1px solid var(--cpmm-border); border-radius: var(--cpmm-radius); padding: 20px; margin-bottom: 20px; background: #fff; }
.cpmm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.cpmm-dl dt { color: var(--cpmm-muted); }
.cpmm-dl dd { margin: 0; }
.cpmm-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8125em; font-weight: 600; background: var(--cpmm-surface); }
.cpmm-badge--active, .cpmm-badge--approved, .cpmm-badge--completed { background: #e3f5ea; color: #0f5c2f; }
.cpmm-badge--pending, .cpmm-badge--pending_approval, .cpmm-badge--pending_verification, .cpmm-badge--on_hold { background: #fff4d6; color: #7a5300; }
.cpmm-badge--expired, .cpmm-badge--cancelled, .cpmm-badge--rejected, .cpmm-badge--suspended, .cpmm-badge--failed, .cpmm-badge--refunded { background: #fde8e7; color: #8a1c13; }
.cpmm-table-wrap { overflow-x: auto; }
.cpmm-table { width: 100%; border-collapse: collapse; }
.cpmm-table th, .cpmm-table td { padding: 10px 8px; border-bottom: 1px solid var(--cpmm-border); text-align: left; }
.cpmm-table .num { text-align: right; }

/* Member card */
.cpmm-member-card { max-width: 420px; border-radius: 14px; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--cpmm-accent), #3b6ea5); box-shadow: 0 8px 24px rgba(0,0,0,0.15); margin: 0 0 16px; }
.cpmm-member-card__top { display: flex; justify-content: space-between; padding: 14px 18px; font-weight: 600; background: rgba(0,0,0,0.15); }
.cpmm-member-card__plan { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125em; }
.cpmm-member-card__body { display: flex; gap: 16px; align-items: center; padding: 18px; }
.cpmm-member-card__avatar { border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); }
.cpmm-member-card__name { font-size: 1.25em; font-weight: 700; }
.cpmm-member-card__meta { font-size: 0.875em; opacity: 0.9; }

/* Print pages (invoice / certificate) */
.cpmm-print { margin: 0; padding: 32px 16px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #1f2933; background: #fff; }
.cpmm-invoice, .cpmm-certificate { max-width: 760px; margin: 0 auto; }
.cpmm-invoice__head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.cpmm-invoice__meta { text-align: right; }
.cpmm-invoice__to { margin-bottom: 24px; }
.cpmm-invoice__foot { color: #6b7280; margin-top: 16px; }
.cpmm-certificate { text-align: center; border: 6px double var(--cpmm-accent); padding: 48px 24px; }
.cpmm-certificate__kicker { text-transform: uppercase; letter-spacing: 0.2em; color: #6b7280; }
.cpmm-certificate__name { font-size: 2.5em; margin: 8px 0; }
.cpmm-certificate .cpmm-member-card { margin: 24px auto; text-align: left; }
@media print { .cpmm-no-print { display: none !important; } .cpmm-print { padding: 0; } }

@media (max-width: 720px) {
	.cpmm-plans__grid { grid-template-columns: 1fr; }
	.cpmm-row { grid-template-columns: 1fr; }
	.cpmm-dl { grid-template-columns: 1fr; gap: 2px; }
	.cpmm-dl dd { margin-bottom: 8px; }
}

/* ---- 1.1.0: brand, accessibility and review screen ---- */
.cpmm h2, .cpmm h3, .cpmm-plan__name { color: var(--cpmm-navy); }
.cpmm-button { min-height: 48px; padding: 12px 20px; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.cpmm-button--primary { background: var(--cpmm-purple); border-color: var(--cpmm-purple); color: #fff; }
.cpmm-button--primary:hover, .cpmm-button--primary:focus { background: var(--cpmm-purple-dark); border-color: var(--cpmm-purple-dark); opacity: 1; }
.cpmm-button:focus-visible, .cpmm-tabs__tab:focus-visible, .cpmm a:focus-visible { outline: 3px solid var(--cpmm-lime); outline-offset: 2px; }
.cpmm-button[disabled] { opacity: .6; cursor: progress; }
.cpmm-field input, .cpmm-field select, .cpmm-field textarea { min-height: 48px; font-size: 1rem; }
.cpmm-field input[type="checkbox"], .cpmm-field input[type="radio"] { width: 22px; height: 22px; min-height: 0; vertical-align: middle; }
.cpmm-tabs__tab { min-height: 48px; display: inline-flex; align-items: center; }
.cpmm-plan.is-current, .cpmm-option--featured { box-shadow: 0 0 0 2px var(--cpmm-purple); border-color: var(--cpmm-purple); }
.cpmm-price__trial { color: var(--cpmm-navy); background: var(--cpmm-lime); border-radius: 999px; padding: 2px 10px; display: inline-block; margin-top: 6px; font-size: .5em; }
.cpmm-plan__renewal { font-size: .9375rem; color: var(--cpmm-navy); opacity: .85; margin: 0 0 12px; }
.cpmm-plan__features li::before { color: var(--cpmm-purple); }
.cpmm-badge--trial { background: var(--cpmm-lime); color: var(--cpmm-navy); }
.cpmm-review { max-width: 760px; }
.cpmm-review__title { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.cpmm-review__price { font-size: .8em; }
.cpmm-options { display: grid; gap: 16px; margin: 16px 0; }
.cpmm-option { border: 1px solid var(--cpmm-border); border-radius: 12px; padding: 20px; background: #fff; }
.cpmm-option h3 { margin: 0 0 12px; font-size: 1.2rem; }
.cpmm-terms { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.cpmm-terms dt { font-weight: 600; }
.cpmm-terms dd { margin: 0; }
.cpmm-disclosure, .cpmm-cancel-terms, .cpmm-methods { font-size: 1rem; margin: 0 0 12px; }
.cpmm-disclosure { border-left: 4px solid var(--cpmm-lime); padding-left: 12px; }
.cpmm-rzp-status:empty { display: none; }
.cpmm-notice { font-size: 1rem; }
.cpmm-locked__icon { color: var(--cpmm-purple); }
.cpmm-tabs__tab.is-active { border-bottom-color: var(--cpmm-purple); }
@media (max-width: 720px) {
	.cpmm-terms { grid-template-columns: 1fr; gap: 2px; }
	.cpmm-terms dd { margin-bottom: 8px; }
	.cpmm-option .cpmm-button, .cpmm-plan__cta .cpmm-button { width: 100%; }
	.cpmm-actions .cpmm-button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .cpmm * { transition: none !important; } }
/* Readability floor: no member-facing text below 16px. */
.cpmm small, .cpmm .cpmm-help, .cpmm-alt, .cpmm-locked__plans, .cpmm-member-card__meta { font-size: 1rem; }
.cpmm .cpmm-price__period { font-size: 1rem; }
.cpmm .cpmm-price__trial { font-size: 1rem; font-weight: 600; }
.cpmm-badge { font-size: 1rem; }
.cpmm .cpmm-plan__renewal { font-size: 1rem; }

/* 1.1.1: billing state, test labels, explicit AutoPay cancellation */
.cpmm-badge--test { background: #ede7fb; color: #4a2596; font-size: 1rem; }
.cpmm-card--warning { border-left: 4px solid #b8e62e; }
.cpmm-open-billing h3 { font-size: 1.125rem; margin-top: 0; }
.cpmm .cpmm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 1rem; line-height: 1.5; margin: 12px 0; }
.cpmm .cpmm-check input[type="checkbox"] { width: 24px; height: 24px; flex: 0 0 24px; margin-top: 2px; }
.cpmm-billing-status--cancel_requested, .cpmm-billing-status--unknown { color: #8a1c13; font-weight: 600; }
.cpmm-scheduled-plan { font-size: 1rem; }
