/**
 * Recipe WP — submission form.
 *
 * Uses the same custom properties as the recipe card (--rwp-bg,
 * --rwp-accent…), so a theme that restyles the card restyles the form
 * too. Inputs mostly inherit the theme's own form styling.
 */

:where(.rwp-submit) {
	--rwp-bg: #ffffff;
	--rwp-bg-image: none;
	--rwp-text: inherit;
	--rwp-muted: #6b6b6b;
	--rwp-border: #d9d9d9;
	--rwp-accent: #b5401f;
	--rwp-accent-text: #ffffff;
	--rwp-error: #b3261e;
	--rwp-radius: 8px;
	--rwp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	--rwp-font-heading: inherit;
	--rwp-input-bg: #ffffff;
}

.rwp-submit {
	box-sizing: border-box;
	margin: 2em 0;
	padding: clamp(16px, 4vw, 32px);
	color: var(--rwp-text);
	background-color: var(--rwp-bg);
	background-image: var(--rwp-bg-image);
	border: 1px solid var(--rwp-border);
	border-radius: var(--rwp-radius);
	box-shadow: var(--rwp-shadow);
}

.rwp-submit *,
.rwp-submit *::before,
.rwp-submit *::after {
	box-sizing: border-box;
}

.rwp-submit__section {
	margin: 0 0 1.75em;
	padding: 0;
	border: 0;
}

.rwp-submit__section legend {
	width: 100%;
	margin-bottom: 0.75em;
	padding: 0 0 0.35em;
	font-family: var(--rwp-font-heading);
	font-size: 1.25rem;
	font-weight: 700;
	border-bottom: 1px solid var(--rwp-border);
}

.rwp-field {
	margin: 0 0 1em;
}

.rwp-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.rwp-help {
	display: block;
	margin: -2px 0 6px;
	font-size: 0.85em;
	color: var(--rwp-muted);
}

.rwp-req {
	color: var(--rwp-accent);
}

.rwp-submit input[type="text"],
.rwp-submit input[type="email"],
.rwp-submit input[type="number"],
.rwp-submit select,
.rwp-submit textarea {
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	color: inherit;
	background: var(--rwp-input-bg);
	border: 1px solid var(--rwp-border);
	border-radius: calc(var(--rwp-radius) / 2);
}

.rwp-submit textarea {
	min-height: 6em;
	line-height: 1.6;
	resize: vertical;
}

.rwp-submit input:focus-visible,
.rwp-submit select:focus-visible,
.rwp-submit textarea:focus-visible {
	outline: 2px solid var(--rwp-accent);
	outline-offset: 1px;
	border-color: var(--rwp-accent);
}

.rwp-submit [aria-invalid="true"] {
	border-color: var(--rwp-error);
}

.rwp-field-error {
	margin: -0.6em 0 1em;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--rwp-error);
}

.rwp-submit__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0 16px;
}

.rwp-submit__grid--2 {
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	align-items: end; /* Keeps side-by-side inputs level when help text wraps. */
}

.rwp-field--check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.rwp-field--check input {
	flex: none;
	width: 1.2em;
	height: 1.2em;
	margin-top: 0.2em;
	accent-color: var(--rwp-accent);
}

.rwp-field--check label {
	margin: 0;
	font-weight: 400;
}

.rwp-submit__errors {
	margin: 0 0 1.5em;
	padding: 14px 18px;
	color: var(--rwp-error);
	background: rgba(179, 38, 30, 0.06);
	border-left: 4px solid var(--rwp-error);
	border-radius: 4px;
}

.rwp-submit__errors p,
.rwp-submit__errors ul {
	margin: 0;
}

.rwp-submit__errors ul {
	margin-top: 6px;
	padding-left: 1.2em;
}

.rwp-submit__errors a {
	color: inherit;
}

.rwp-submit__actions {
	margin: 1.5em 0 0;
}

.rwp-submit .rwp-button {
	display: inline-block;
	padding: 12px 26px;
	font: inherit;
	font-weight: 700;
	color: var(--rwp-accent-text);
	text-decoration: none;
	background: var(--rwp-accent);
	border: 2px solid var(--rwp-accent);
	border-radius: 999px;
	cursor: pointer;
}

.rwp-submit .rwp-button:hover,
.rwp-submit .rwp-button:focus-visible {
	filter: brightness(0.9);
}

.rwp-submit--done h3 {
	margin-top: 0;
	font-family: var(--rwp-font-heading);
}

/* Honeypot: off-screen for people, still "visible" to bots reading the HTML. */
.rwp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
