/**
 * Embeddable lead form ([p3_lead_form]).
 *
 * Self-contained styling that reads the theme's design tokens when present and
 * falls back to plain sRGB values otherwise, so the form looks right embedded in
 * any post or page (and on the older Safari the client reviews on - every colour
 * has a non-variable fallback and there is no color-mix/oklch here).
 */
.p3-lead {
	max-width: 560px;
	margin: 1.5rem auto;
}

.p3-lead-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	border: 1px solid #e3e3e3;
	border: 1px solid var(--border, #e3e3e3);
	border-radius: 14px;
	background: #ffffff;
	background: var(--background, #ffffff);
	padding: 1.5rem;
}

.p3-lead-head {
	margin-bottom: 0.25rem;
	text-align: center;
}

.p3-lead-head h3 {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	line-height: 1.2;
}

.p3-lead-head p {
	margin: 0;
	font-size: 0.95rem;
	color: #666666;
	color: var(--muted-foreground, #666666);
}

.p3-lead-form label {
	display: block;
	margin: 0;
}

.p3-lead-form input,
.p3-lead-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.8rem 1rem;
	border: 1px solid #d9d9d9;
	border: 1px solid var(--border, #d9d9d9);
	border-radius: 8px;
	font-size: 1rem;
	font-family: inherit;
	background: #ffffff;
	background: var(--background, #ffffff);
	color: #111111;
	color: var(--foreground, #111111);
}

.p3-lead-form textarea {
	min-height: 92px;
	resize: vertical;
}

.p3-lead-form input:focus-visible,
.p3-lead-form textarea:focus-visible {
	outline: 2px solid #c7dc00;
	outline: 2px solid var(--accent-lime, #c7dc00);
	outline-offset: 1px;
	border-color: #c7dc00;
	border-color: var(--accent-lime, #c7dc00);
}

.p3-lead-submit {
	cursor: pointer;
	border: 0;
	border-radius: 8px;
	padding: 0.9rem 1.5rem;
	font-size: 1rem;
	font-weight: 700;
	font-family: inherit;
	background: #111111;
	background: var(--foreground, #111111);
	color: #ffffff;
	color: var(--background, #ffffff);
}

.p3-lead-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* Honeypot: off-screen, never shown to a person. */
.p3-lead-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.p3-lead-error {
	margin: 0;
	padding: 0.7rem 0.9rem;
	border-radius: 8px;
	border: 1px solid #e6b3b3;
	background: #fbecec;
	color: #8a1f1f;
	font-size: 0.92rem;
}

.p3-lead-success {
	border: 1px solid #cfe6cf;
	background: #f1f9f1;
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
	text-align: center;
	font-size: 1.05rem;
	color: #1f5a1f;
}

/* RTL: right-align typed text and placeholders. */
[dir="rtl"] .p3-lead-form input,
[dir="rtl"] .p3-lead-form textarea {
	text-align: right;
}

/* Fields wrapper. Default: keep the same stacked column (name, phone, email,
   button) the form has always had. */
.p3-lead-fields {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* Wide single-row layout (shortcode layout="row", used at the end of articles):
   name / phone / email / button on one line so the form is short, not a tall
   stacked block. Falls back to a single stacked column on narrow screens. */
.p3-lead--row {
	max-width: 860px;
}

.p3-lead--row .p3-lead-head {
	text-align: center;
}

.p3-lead--row .p3-lead-fields {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr auto;
	gap: 0.6rem;
	align-items: stretch;
}

.p3-lead--row .p3-lead-fields label {
	margin: 0;
}

.p3-lead--row .p3-lead-fields input {
	height: 3rem;
}

.p3-lead--row .p3-lead-submit {
	height: 3rem;
	padding-block: 0;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* An optional message box spans the whole row rather than squeezing a column. */
.p3-lead--row .p3-lead-msg {
	grid-column: 1 / -1;
}

@media (max-width: 720px) {
	.p3-lead--row .p3-lead-fields {
		grid-template-columns: 1fr;
	}
}
