/**
 * Framed Minds — Terms Gate
 * Brand tokens: #151515 text, #FFFFFF bg, #F4F1E8 warm surface,
 * #E7EAED border, #BCCF97 primary accent, #96CA42 active micro-accent.
 */

#fm-terms-gate .fm-tg-intro {
	color: #151515;
	margin: 0 0 1.25em;
}

.fm-tg-doc {
	background: #ffffff;
	border: 1px solid #e7eaed;
	border-radius: 10px;
	margin: 0 0 1.5em;
	overflow: hidden;
}

.fm-tg-doc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 14px 18px;
	background: #f4f1e8;
	border-bottom: 1px solid #e7eaed;
}

.fm-tg-doc-title {
	margin: 0;
	font-size: 1.05em;
	color: #151515;
}

.fm-tg-status {
	font-size: 0.85em;
	color: #151515;
	background: #ffffff;
	border: 1px solid #e7eaed;
	border-radius: 999px;
	padding: 4px 12px;
	white-space: nowrap;
}

.fm-tg-doc.is-unlocked .fm-tg-status {
	background: #bccf97;
	border-color: #bccf97;
}

/* Reading progress */
.fm-tg-progress {
	height: 4px;
	background: #e7eaed;
}

.fm-tg-progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: #96ca42;
	transition: width 120ms ease-out;
}

/* The scrollable pane */
.fm-tg-pane {
	height: 320px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	outline-offset: -2px;
}

.fm-tg-pane:focus-visible {
	outline: 2px solid #bccf97;
}

.fm-tg-pane-inner {
	padding: 18px 22px 28px;
	color: #151515;
	font-size: 0.95em;
	line-height: 1.65;
}

.fm-tg-pane-inner h1,
.fm-tg-pane-inner h2,
.fm-tg-pane-inner h3 {
	color: #151515;
}

/* Consent checkboxes rendered by the gate (privacy, etc.) */
.fm-tg-consent-field {
	margin-top: 0.5em;
}

/* Locked checkbox affordance — applies to the native #tos box too once gated */
input.fm-tg-locked {
	cursor: not-allowed;
	opacity: 0.45;
}

label.fm-tg-locked-label {
	opacity: 0.6;
}

/* Gated submit button */
.fm-tg-submit-locked {
	opacity: 0.5;
	cursor: not-allowed !important;
}

@media (max-width: 640px) {
	.fm-tg-pane {
		height: 260px;
	}
	.fm-tg-doc-header {
		padding: 12px 14px;
	}
	.fm-tg-pane-inner {
		padding: 14px 16px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fm-tg-progress-bar {
		transition: none;
	}
}

/* Status pill when scroll-through is not enforced */
.fm-tg-status-open {
	background: #ffffff;
	border-color: #e7eaed;
}
.fm-tg-doc.is-unlocked .fm-tg-status-open {
	background: #ffffff;
	border-color: #e7eaed;
}

/* Unified consent group — checkboxes stacked and aligned */
.fm-tg-consents {
	margin-top: 1.25em;
	padding-top: 1.25em;
	border-top: 1px solid #e7eaed;
}

.fm-tg-consents .pmpro_form_field.fm-tg-consent-field {
	margin: 0 0 0.35em !important;
	padding: 0 !important;
}

.fm-tg-consents .fm-tg-consent-field .pmpro_form_label {
	margin: 0;
	padding: 0;
}

.fm-tg-consents .fm-tg-consent-field:last-child {
	margin-bottom: 0;
}

.fm-tg-consents .pmpro_form_label {
	display: flex;
	align-items: baseline;
	gap: 0.55em;
	color: #151515;
}

.fm-tg-consents input[type="checkbox"] {
	flex: 0 0 auto;
	accent-color: #96ca42;
	transform: translateY(2px);
}

/* ---------------------------------------------------------------------------
 * PMPro checkout: discount code always expanded + highlighted
 * (Moved here from theme custom.css so plugin version bumps cache-bust it
 * everywhere, including the BuddyBoss app webview.)
 * ------------------------------------------------------------------------- */

#other_discount_code_p {
	display: none !important; /* toggle link redundant once expanded */
}

#other_discount_code_fields {
	display: block !important; /* overrides PMPro's inline display:none */
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	background: #f4f1e8;
	border: 1px solid #e7eaed;
	border-radius: 10px;
	padding: 16px 18px 18px;
	margin-top: 1.25em;
	overflow: hidden;
}

#other_discount_code_fields *,
#other_discount_code_fields *::before,
#other_discount_code_fields *::after {
	box-sizing: border-box;
}

#other_discount_code_fields .pmpro_form_label {
	display: block;
	font-weight: 600;
	color: #151515;
	margin-bottom: 8px;
}

#other_discount_code_fields .pmpro_form_fields-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	width: 100%;
	max-width: 100%;
}

#pmpro_other_discount_code {
	flex: 1 1 180px;
	min-width: 0;
	width: auto;
	max-width: 100%;
	background: #ffffff;
	border: 1px solid #e7eaed;
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0;
}

#other_discount_code_button {
	flex: 0 0 auto;
	background: #bccf97;
	color: #151515;
	border: none;
	border-radius: 999px;
	padding: 10px 22px;
	margin: 0;
	cursor: pointer;
}

#other_discount_code_button:hover {
	background: #96ca42;
}

@media (max-width: 480px) {
	#pmpro_other_discount_code,
	#other_discount_code_button {
		flex: 1 1 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Checkout page horizontal-overflow guards (scoped to PMPro checkout body)
 * ------------------------------------------------------------------------- */

body.pmpro-checkout .pmpro_card,
body.pmpro-checkout .pmpro_form,
body.pmpro-checkout .pmpro_card_content,
body.pmpro-checkout .pmpro_card_actions {
	max-width: 100%;
	box-sizing: border-box;
	min-width: 0;
}

body.pmpro-checkout .pmpro_form_field,
body.pmpro-checkout .pmpro_form_fields {
	max-width: 100%;
	min-width: 0;
}

body.pmpro-checkout .pmpro_form_input-text {
	max-width: 100%;
}
