.rrm-widget {
	--rrm-accent: #3e4f23;
	--rrm-accent-text: #ffffff;
	--rrm-card-background: #fffdf9;
	--rrm-card-text: #201912;
	box-sizing: border-box;
	clear: both;
	margin: 24px 0;
	color: #201912;
	font-family: inherit;
}

.rrm-experiment[data-rrm-ready="0"] > .rrm-variant,
.rrm-experiment > .rrm-variant[hidden] {
	display: none !important;
}

.rrm-experiment[data-rrm-ready="1"] > .rrm-variant:not([hidden]) {
	display: block;
}

/*
 * Healthy Living James theme compatibility.
 *
 * The theme normally styles the Save Recipe form with the direct-child
 * selector `.cwp-food-content > .wpforms-container`. The experiment wrappers
 * necessarily break that relationship, so restore the same patterned control
 * treatment when the form is rendered inside Variant A.
 */
.cwp-food-content > .rrm-experiment .rrm-variant-a > .wpforms-container {
	background: var(--wp--preset--color--quaternary) url("/wp-content/themes/healthylivingjames-2024/assets/images/pattern-primary.jpg");
	background-size: 200px;
	border: none;
	padding: 16px !important;
}

.rrm-widget *,
.rrm-widget *::before,
.rrm-widget *::after {
	box-sizing: border-box;
}

.rrm-widget .rrm-card[hidden],
.rrm-widget .rrm-success[hidden] {
	display: none !important;
}

.rrm-preview-label {
	margin: 0 0 7px;
	color: #6b6258;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.rrm-card,
.rrm-success {
	display: flex;
	gap: 14px;
	padding: 18px;
	border: 1px solid #ddd8cf;
	border: 1px solid color-mix(in srgb, var(--rrm-card-text) 22%, transparent);
	border-radius: 10px;
	background: var(--rrm-card-background);
	color: var(--rrm-card-text);
}

.rrm-card__icon,
.rrm-success__icon {
	display: grid;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	background: color-mix(in srgb, var(--rrm-card-text) 14%, transparent);
	color: var(--rrm-card-text);
}

.rrm-card h3,
.rrm-success h3 {
	margin: 0 0 6px;
	padding: 0;
	color: var(--rrm-card-text);
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}

.rrm-dialog h3 {
	margin: 0 0 6px;
	padding: 0;
	color: #201912;
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}

.rrm-card p,
.rrm-success p {
	margin: 0 0 14px;
	font-size: 15px;
	line-height: 1.5;
}

.rrm-success p {
	margin-bottom: 0;
}

.rrm-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.rrm-quick-actions button,
.rrm-date-link,
.rrm-submit,
.rrm-close {
	font: inherit;
}

.rrm-quick-actions button {
	min-height: 40px;
	padding: 8px 13px;
	border: 1px solid currentColor;
	border-radius: 7px;
	background: var(--rrm-card-text);
	color: var(--rrm-card-background);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}

.rrm-quick-actions button:hover,
.rrm-quick-actions button:focus-visible {
	background: transparent;
	color: var(--rrm-card-text);
}

.rrm-date-link {
	margin: 12px 0 0;
	padding: 2px 0;
	border: 0;
	border-bottom: 1px solid currentColor;
	background: transparent;
	color: var(--rrm-card-text);
	cursor: pointer;
	font-size: 14px;
}

.rrm-dialog {
	width: min(520px, calc(100% - 24px));
	max-width: 520px;
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 80px rgba(32, 25, 18, 0.25);
	color: #201912;
}

.rrm-dialog::backdrop {
	background: rgba(32, 25, 18, 0.58);
	backdrop-filter: blur(2px);
}

.rrm-form {
	position: relative;
	padding: 28px;
}

.rrm-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #4b4842;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
}

.rrm-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 20px;
}

.rrm-field,
.rrm-field-row label {
	display: block;
	margin-top: 15px;
}

.rrm-field-row label {
	margin-top: 0;
}

.rrm-field > span,
.rrm-field-row label > span {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 700;
}

.rrm-field input,
.rrm-field-row input {
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 9px 11px;
	border: 1px solid #c9c6c0;
	border-radius: 7px;
	background: #fff;
	color: #201912;
	font: inherit;
}

.rrm-field input:focus,
.rrm-field-row input:focus {
	border-color: var(--rrm-accent);
	outline: 2px solid rgba(62, 79, 35, 0.2);
	outline: 2px solid color-mix(in srgb, var(--rrm-accent) 25%, transparent);
}

.rrm-submit {
	width: 100%;
	min-height: 48px;
	margin-top: 18px;
	padding: 11px 16px;
	border: 0;
	border-radius: 7px;
	background: var(--rrm-accent);
	color: var(--rrm-accent-text);
	cursor: pointer;
	font-weight: 700;
}

.rrm-submit:disabled {
	cursor: wait;
	opacity: 0.65;
}

.rrm-consent {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-top: 16px;
	font-size: 13px;
	line-height: 1.45;
}

.rrm-consent input {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin: 1px 0 0;
	accent-color: var(--rrm-accent);
}

.rrm-privacy {
	display: inline-block;
	margin-top: 9px;
	color: #5b5b52;
	font-size: 12px;
}

.rrm-message {
	min-height: 20px;
	margin-top: 12px;
	color: #a12622;
	font-size: 13px;
	font-weight: 600;
}

.rrm-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.rrm-admin-warning {
	padding: 10px;
	border-left: 4px solid #dba617;
	background: #fff8e5;
}

@media (max-width: 560px) {
	.rrm-card {
		padding: 16px;
	}

	.rrm-card__icon {
		display: none;
	}

	.rrm-dialog {
		width: 100%;
		max-width: none;
		max-height: 88dvh;
		margin: auto 0 0;
		border-radius: 18px 18px 0 0;
	}

	.rrm-form {
		padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
	}

	.rrm-quick-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.rrm-widget * {
		scroll-behavior: auto !important;
	}
}
