.msai-checkout {
	max-width: 560px;
	margin: 0 auto;
}

.msai-checkout--widget {
	width: 100%;
}

.msai-checkout-card,
.msai-checkout-status {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 242, 0.96));
	border: 1px solid rgba(20, 38, 29, 0.1);
	border-radius: 28px;
	box-shadow: 0 18px 50px rgba(20, 38, 29, 0.08);
	padding: 24px;
	color: #153128;
}

.msai-checkout-eyebrow {
	margin: 0 0 8px;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: #5a7c6d;
}

.msai-checkout-summary h2,
.msai-checkout-payment h3,
.msai-checkout-status h3 {
	margin: 0;
	color: #11261e;
}

.msai-checkout-price {
	margin: 14px 0 6px;
	font-size: clamp(2rem, 3vw, 3rem);
	font-weight: 700;
	color: #0f281f;
}

.msai-checkout-interval {
	margin: 0;
	color: #506b61;
}

.msai-checkout-copy {
	margin: 18px 0 0;
	color: #405b52;
	line-height: 1.65;
}

#wfacp-e-form .msai-checkout-renewal-note,
.woocommerce-checkout .msai-checkout-renewal-note {
	box-sizing: border-box;
	max-width: 100%;
	margin: 10px 0 0;
	color: #68727d;
	font-size: 13px !important;
	font-style: italic !important;
	line-height: 1.45;
	overflow-wrap: anywhere;
	text-align: center;
}

#wfacp-e-form .msai-checkout-renewal-note em,
.woocommerce-checkout .msai-checkout-renewal-note em {
	font-size: inherit !important;
	font-style: inherit !important;
}

.msai-checkout-section {
	margin-top: 22px;
}

.msai-checkout-section h3 {
	margin: 0 0 10px;
	font-size: 1rem;
}

.msai-checkout-section ul {
	margin: 0;
	padding-left: 18px;
	display: grid;
	gap: 8px;
}

.msai-checkout-benefits {
	list-style: disc;
}

.msai-checkout-trust {
	margin-top: 24px;
	padding: 18px;
	border-radius: 20px;
	background: rgba(238, 244, 240, 0.88);
	display: grid;
	gap: 8px;
}

.msai-checkout-trust p {
	margin: 0;
	color: #3c584e;
}

.msai-checkout-step {
	display: grid;
	gap: 8px;
	margin-top: 18px;
}

.msai-checkout-step label {
	font-weight: 600;
}

.msai-checkout-step input {
	width: 100%;
	padding: 14px 16px;
	border-radius: 16px;
	border: 1px solid rgba(20, 38, 29, 0.14);
	background: rgba(255, 255, 255, 0.95);
	font: inherit;
}

.msai-checkout-help {
	margin: 0;
	color: #5a7267;
	line-height: 1.55;
}

.msai-checkout-actions {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.msai-checkout-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 20px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #14352b 0%, #2a5446 100%);
	color: #f8fbf7;
	text-decoration: none;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.msai-checkout-button--secondary {
	background: rgba(255, 255, 255, 0.95);
	color: #16352b;
	border: 1px solid rgba(20, 38, 29, 0.16);
}

.msai-checkout-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.msai-checkout-status-area {
	padding: 14px 16px;
	border-radius: 16px;
	background: rgba(240, 244, 239, 0.92);
	color: #26463a;
}

.msai-checkout-status-area.is-success {
	background: rgba(232, 245, 237, 0.98);
	color: #1e5c42;
}

.msai-checkout-status-area.is-warning {
	background: rgba(255, 246, 226, 0.98);
	color: #775724;
}

.msai-checkout-status--success {
	border-color: rgba(57, 117, 88, 0.2);
	background: linear-gradient(180deg, rgba(238, 249, 242, 0.98), rgba(244, 249, 245, 0.96));
}

.msai-checkout-status--warning {
	border-color: rgba(184, 140, 60, 0.25);
	background: linear-gradient(180deg, rgba(255, 248, 231, 0.98), rgba(252, 246, 235, 0.96));
}

.msai-checkout-status--neutral {
	border-color: rgba(20, 38, 29, 0.1);
}

.msai-checkout-components {
	display: grid;
	gap: 16px;
}

.msai-checkout-widget {
	display: grid;
	gap: 16px;
}

.msai-checkout-widget__gate {
	display: grid;
	gap: 16px;
}

.msai-checkout-component-shell {
	min-height: 220px;
	border-radius: 24px;
	border: 1px solid rgba(20, 38, 29, 0.12);
	background: rgba(255, 255, 255, 0.96);
	padding: 18px;
}

/*
 * WooCommerce always injects its PhotoSwipe lightbox markup
 * (#photoswipe-fullscreen-dialog) into the footer regardless of whether
 * the page has a product gallery. A prior performance pass correctly
 * dequeued the photoswipe.css/js this checkout never uses for an actual
 * gallery, but that stylesheet was also the only thing keeping this
 * hidden-by-default dialog hidden - without it the markup rendered as
 * visible, unstyled buttons in normal document flow. Restoring only the
 * one rule that matters (hidden until PhotoSwipe's own JS would open it)
 * rather than the whole removed stylesheet.
 */
#photoswipe-fullscreen-dialog {
	display: none;
}

/*
 * Unified checkout checkbox system - Woo/FunnelKit Terms & Conditions and
 * the MaditSpirit Progressive commitment checkbox share one visual control,
 * even though their generated markup differs (core Woo's own terms field vs
 * our own woocommerce_form_field() call for msai_progressive_legal). Three
 * selector groups are kept - not for different visuals, but because this
 * checkout genuinely renders under three different DOM contexts that each
 * needed proving separately: classic .woocommerce-checkout ancestor,
 * FunnelKit's own markup which drops that ancestor, and WFACP's own
 * later-loading stylesheet which re-forces labels back to block. Each group
 * below sets the identical layout + control appearance; nothing here
 * differs between Terms and commitment on purpose.
 *
 * The control itself is a REAL, unmodified <input type="checkbox"> - only
 * appearance:none plus a border/background/checkmark drawn directly on that
 * same element (not a sibling, not the label). Native browser rendering was
 * the actual cause of the "unclear checked state" complaint: nothing here
 * previously drew any checked-state indicator at all, so whatever the host
 * theme/WFACP stylesheet happened to do to native checkboxes was the only
 * visual anyone ever saw. Owning the whole appearance removes that
 * dependency entirely, for both checkboxes, in every context.
 */
.woocommerce-checkout .msai-progressive-legal,
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .form-row,
.woocommerce-checkout .validate-required.woocommerce-validated,
.msai-progressive-legal,
.msai-progressive-legal .woocommerce-input-wrapper {
	text-align: left !important;
	width: 100%;
}
.woocommerce-checkout .msai-progressive-legal label,
.woocommerce-checkout .woocommerce-terms-and-conditions-checkbox-text,
.woocommerce-checkout label.woocommerce-form__label-for-checkbox,
.msai-progressive-legal label.checkbox,
body #wfacp-e-form #wfacp_checkout_form .msai-progressive-legal label.checkbox {
	display: flex !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	gap: 10px !important;
	width: 100%;
	margin: 0 !important;
	padding-left: 0 !important;
	text-align: left !important;
	line-height: 1.45;
	color: inherit !important;
	cursor: pointer;
}
.woocommerce-checkout .msai-progressive-legal input[type="checkbox"],
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper input[type="checkbox"],
.msai-progressive-legal label.checkbox input[type="checkbox"],
body #wfacp-e-form #wfacp_checkout_form .msai-progressive-legal label.checkbox input[type="checkbox"] {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: relative !important;
	float: none !important;
	flex: 0 0 19px !important;
	width: 19px !important;
	height: 19px !important;
	margin: 1px 0 0 !important;
	padding: 0;
	border: 1.5px solid #b7c2cf !important;
	border-radius: 5px !important;
	background: #fff !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
.woocommerce-checkout .msai-progressive-legal input[type="checkbox"]:checked,
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper input[type="checkbox"]:checked,
.msai-progressive-legal label.checkbox input[type="checkbox"]:checked,
body #wfacp-e-form #wfacp_checkout_form .msai-progressive-legal label.checkbox input[type="checkbox"]:checked {
	border-color: #123d9d !important;
	background: #123d9d !important;
}
.woocommerce-checkout .msai-progressive-legal input[type="checkbox"]:checked::after,
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper input[type="checkbox"]:checked::after,
.msai-progressive-legal label.checkbox input[type="checkbox"]:checked::after,
body #wfacp-e-form #wfacp_checkout_form .msai-progressive-legal label.checkbox input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.woocommerce-checkout .msai-progressive-legal input[type="checkbox"]:focus-visible,
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper input[type="checkbox"]:focus-visible,
.msai-progressive-legal label.checkbox input[type="checkbox"]:focus-visible,
body #wfacp-e-form #wfacp_checkout_form .msai-progressive-legal label.checkbox input[type="checkbox"]:focus-visible {
	outline: 2px solid #123d9d !important;
	outline-offset: 2px;
}
.woocommerce-checkout .msai-progressive-legal label>span,
.woocommerce-checkout .woocommerce-terms-and-conditions-checkbox-text,
.msai-progressive-legal__text {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left !important;
	overflow-wrap: anywhere;
}
.msai-progressive-legal label.checkbox > .required {
	flex: 0 0 auto;
	margin-left: 2px;
}

/*
 * Mobile checkout horizontal overflow. Root cause: the FunnelKit checkout
 * form's Elementor widget (.elementor-widget-wfacp_form) is set to
 * Elementor's "Initial" width control, which on narrow viewports resolves to
 * a computed width a few pixels wider than the column's actual content box
 * (confirmed live: 366px widget in a 360px available column at 390px
 * viewport - a 6px base overflow that FunnelKit's own internal negative-
 * margin "bleed" rows then compound further). On desktop this same
 * "Initial" setting intentionally renders the form narrower than its column
 * (918px in a 988px column) for readability, so the override below is
 * scoped to mobile only - forcing width:100% on desktop would undo that
 * intentional narrowing. min-width:0 lets the flex/grid ancestors actually
 * honor the 100% cap instead of sizing to content.
 */
@media (max-width: 768px) {
	.elementor-widget-wfacp_form.elementor-widget__width-initial {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}
}
.woocommerce-checkout .woocommerce-terms-and-conditions-checkbox-text a,
.msai-progressive-legal__text a {
	color: #155cc9 !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
	position: relative;
	z-index: 1;
}
