/**
 * Force light theme text colors inside the scoped Pico wrapper.
 * Without this, :root:not([data-theme]) dark-mode variables leak in
 * and headings render as light grey on PMPro's white card backgrounds.
 */
.pico.pmpro-pico-scope,
.pico.pmpro-pico-scope[data-theme="light"] {
	color-scheme: light;
	--pico-color: #1f2937;
	--pico-h1-color: #111827;
	--pico-h2-color: #1f2937;
	--pico-h3-color: #374151;
	--pmpro--color--border--variation: #aaa;
	--pico-form-element-spacing-vertical: 0.25rem;
	--pico-form-element-spacing-horizontal: 0.5rem;
}

/**
 * Overrides inside scoped Pico PMPro content.
 * Keeps custom segmented radios intact and adds light PMPro spacing tweaks.
 */

.pmpro-pico-scope .radio-wrapper-20,
.pmpro-pico-scope .radio-wrapper-20 * {
	box-sizing: border-box;
}

.pmpro-pico-scope .radio-wrapper-20 input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	clip: rect(0 0 0 0);
	clip-path: inset(100%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
	margin: 0;
}

.pmpro-pico-scope .radio-wrapper-20 input[type="radio"]:focus {
	outline: 0;
	border-color: #2260ff;
	box-shadow: 0 0 0 4px #b5c9fc;
}

.pmpro-pico-scope .radio-wrapper-20 input[type="radio"]:checked + span,
.pmpro-pico-scope .radio-wrapper-20 input[type="radio"]:checked + .name {
	box-shadow: 0 0 0 0.0625em #0043ed;
	background-color: #dee7ff;
	z-index: 1;
	color: #0043ed;
}

.pmpro-pico-scope .radio-wrapper-20 label span,
.pmpro-pico-scope .radio-wrapper-20 label .name {
	display: block;
	cursor: pointer;
	background-color: #fff;
	padding: 0.375em 0.75em;
	position: relative;
	margin-left: 0.0625em;
	box-shadow: 0 0 0 0.0625em #b5bfd9;
	letter-spacing: 0.05em;
	color: #3e4963;
	text-align: center;
	transition: background-color 0.5s ease;
	border: 0;
	border-radius: 0;
	min-height: auto;
	width: auto;
}

.pmpro-pico-scope .radio-wrapper-20 label:first-child span,
.pmpro-pico-scope .radio-wrapper-20 label:first-child .name {
	border-radius: 0.375em 0 0 0.375em;
}

.pmpro-pico-scope .radio-wrapper-20 label:last-child span,
.pmpro-pico-scope .radio-wrapper-20 label:last-child .name {
	border-radius: 0 0.375em 0.375em 0;
}

.pmpro-pico-scope .pmpro_section,
.pmpro-pico-scope .pmpro_card {
	margin-bottom: 1.5rem;
}

.pico input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=reset], [type=file]),
.pico select,
.pico textarea {
	margin-bottom: 0.1rem;
}

.pico.pmpro-pico-scope input[type="submit"],
.pico.pmpro-pico-scope button[type="submit"],
.pico.pmpro-pico-scope .pmpro_btn {
	margin-bottom: 0;
	box-shadow: none;
	--pico-form-element-spacing-vertical: 0.75rem;
}

/**
 * Pico's custom checkbox icon uses a white stroke, which disappears on light
 * card backgrounds. Use native checkboxes with visible borders instead.
 */
.pico.pmpro-pico-scope input[type="checkbox"]:not([role="switch"]) {
	appearance: auto;
	-webkit-appearance: checkbox;
	-moz-appearance: checkbox;
	width: 1.125rem;
	height: 1.125rem;
	min-width: 1.125rem;
	min-height: 1.125rem;
	margin: 0 0.5rem 0 0;
	padding: 0;
	border: 1px solid #767676;
	background-color: #fff;
	background-image: none !important;
	box-shadow: none;
	cursor: pointer;
	vertical-align: middle;
	position: relative;
	opacity: 1;
	pointer-events: auto;
	accent-color: var(--pico-primary, #0172ad);
}

.pico.pmpro-pico-scope input[type="checkbox"]:not([role="switch"]):checked {
	background-color: #fff;
	border-color: #767676;
}

.pico.pmpro-pico-scope label:has(> input[type="checkbox"]),
.pico.pmpro-pico-scope .pmpro_form_label-inline {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.5rem;
	width: auto;
	max-width: 100%;
	cursor: pointer;
}

.pico.pmpro-pico-scope label:has(> input[type="checkbox"]) input[type="checkbox"],
.pico.pmpro-pico-scope .pmpro_form_label-inline input[type="checkbox"] {
	margin-top: 0.15rem;
	flex-shrink: 0;
}
