/* ==========================================================================
   Website forms (.la24crm-form)
   Contact, customization, newsletter and online preview shortcodes.

   Text colours follow the surrounding section (currentColor), so the same
   form works on light pages and dark footers; fields keep their own light
   surface. Add class="la24crm-form--on-dark" to the shortcode for dark
   fields on a dark background.
   Logical properties throughout, so the same rules serve LTR and RTL.
   ========================================================================== */

.la24crm-form {
	--la24crm-form-primary: #3a3a39;
	--la24crm-form-accent:  #ffcc44;
	--la24crm-form-dark:    #3a3a39;
	--la24crm-form-field:   #ffffff;
	--la24crm-form-ink:     #3a3a39;
	--la24crm-form-border:  #d9d7d0;
	--la24crm-form-error:   #b42318;
	--la24crm-form-success: #1d7348;
	--la24crm-form-radius:  12px;
	--la24crm-form-ease:    cubic-bezier(.4, 0, .2, 1);

	position: relative;
	width: 100%;
	font-family: inherit;
	text-align: start;
	/* The layout follows the form's own width: a form in a narrow column
	   (homepage sidebar, footer) stacks like it does on a phone. */
	container: la24crm-form / inline-size;
}

.la24crm-form,
.la24crm-form *,
.la24crm-form *::before,
.la24crm-form *::after {
	box-sizing: border-box;
}

/* ── Heading ─────────────────────────────────────────────────────────── */

.la24crm-form__head {
	margin-block-end: 22px;
}

.la24crm-form .la24crm-form__title {
	margin: 0 0 6px;
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1.5;
	color: inherit;
}

.la24crm-form__desc {
	margin: 0;
	font-size: .95rem;
	line-height: 1.8;
	opacity: .78;
}

/* ── Fields ──────────────────────────────────────────────────────────── */

.la24crm-form__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 20px;
}

.la24crm-form__field--full,
.la24crm-form__actions {
	grid-column: 1 / -1;
}

.la24crm-form__label {
	display: block;
	margin-block-end: 8px;
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.5;
}

.la24crm-form__req {
	color: var(--la24crm-form-error);
}

.la24crm-form input[type="text"],
.la24crm-form input[type="email"],
.la24crm-form input[type="url"],
.la24crm-form input[type="tel"],
.la24crm-form select,
.la24crm-form textarea {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 16px;
	font: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--la24crm-form-ink);
	background-color: var(--la24crm-form-field);
	border: 1px solid var(--la24crm-form-border);
	border-radius: var(--la24crm-form-radius);
	box-shadow: none;
	transition:
		border-color .2s var(--la24crm-form-ease),
		box-shadow   .2s var(--la24crm-form-ease);
}

/* Emails and URLs are typed left to right; keep them aligned with the page. */
.la24crm-form input[dir="ltr"] {
	text-align: start;
}

[dir="rtl"] .la24crm-form input[dir="ltr"],
.rtl .la24crm-form input[dir="ltr"] {
	text-align: end;
}

.la24crm-form textarea {
	min-height: 140px;
	resize: vertical;
}

.la24crm-form input:hover,
.la24crm-form select:hover,
.la24crm-form textarea:hover {
	border-color: color-mix(in srgb, var(--la24crm-form-primary) 45%, var(--la24crm-form-border));
}

.la24crm-form input:focus,
.la24crm-form select:focus,
.la24crm-form textarea:focus {
	border-color: var(--la24crm-form-primary);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--la24crm-form-primary) 22%, transparent);
}

.la24crm-form [aria-invalid="true"] {
	border-color: var(--la24crm-form-error);
}

.la24crm-form [aria-invalid="true"]:focus {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--la24crm-form-error) 20%, transparent);
}

.la24crm-form__help,
.la24crm-form__error {
	margin: 6px 0 0;
	font-size: .86rem;
	line-height: 1.7;
}

.la24crm-form__help {
	opacity: .72;
}

.la24crm-form__error {
	font-weight: 600;
	color: var(--la24crm-form-error);
}

.la24crm-form__error[hidden] {
	display: none;
}

/* ── Checkbox ────────────────────────────────────────────────────────── */

.la24crm-form__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: .9rem;
	line-height: 1.7;
	cursor: pointer;
}

.la24crm-form__check input {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
	accent-color: var(--la24crm-form-primary);
}

.la24crm-form__check input:focus-visible {
	outline: 2px solid var(--la24crm-form-primary);
	outline-offset: 2px;
}

/* ── Submit ──────────────────────────────────────────────────────────── */

.la24crm-form .la24crm-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 50px;
	margin: 0;
	padding: 14px 30px;
	font: inherit;
	font-size: .98rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	text-transform: none;
	letter-spacing: normal;
	background-color: var(--la24crm-form-primary);
	border: 1px solid var(--la24crm-form-primary);
	border-block-end: 2px solid var(--la24crm-form-accent);
	border-radius: var(--la24crm-form-radius);
	box-shadow: none;
	cursor: pointer;
	transition:
		background-color .2s var(--la24crm-form-ease),
		border-color     .2s var(--la24crm-form-ease);
	width: 100%;
}

.la24crm-form .la24crm-form__submit:hover {
	color: #fff;
	background-color: var(--la24crm-form-dark);
	border-color: var(--la24crm-form-dark);
	border-block-end-color: var(--la24crm-form-accent);
}

.la24crm-form .la24crm-form__submit:focus {
	outline: none;
}

.la24crm-form .la24crm-form__submit:focus-visible {
	outline: 2px solid transparent;
	box-shadow:
		0 0 0 2px #fff,
		0 0 0 4px var(--la24crm-form-accent);
}

.la24crm-form .la24crm-form__submit[disabled] {
	cursor: progress;
	opacity: .8;
}

.la24crm-form__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: la24crm-form-spin .7s linear infinite;
}

.la24crm-form.is-busy .la24crm-form__spinner {
	display: inline-block;
}

@keyframes la24crm-form-spin {
	to { transform: rotate(360deg); }
}

/* ── Status ──────────────────────────────────────────────────────────── */

.la24crm-form__status {
	margin-block-start: 18px;
	padding: 14px 18px;
	font-size: .95rem;
	line-height: 1.8;
	color: var(--la24crm-form-ink);
	border-radius: var(--la24crm-form-radius);
	border: 1px solid var(--la24crm-form-border);
	border-inline-start-width: 4px;
	background: var(--la24crm-form-field);
}

.la24crm-form__status[hidden] {
	display: none;
}

.la24crm-form__status:focus {
	outline: 2px solid transparent;
}

.la24crm-form__status.is-success {
	border-color: color-mix(in srgb, var(--la24crm-form-success) 35%, transparent);
	border-inline-start-color: var(--la24crm-form-success);
	background: color-mix(in srgb, var(--la24crm-form-success) 7%, #fff);
}

.la24crm-form__status.is-info {
	border-color: color-mix(in srgb, var(--la24crm-form-primary) 30%, transparent);
	border-inline-start-color: var(--la24crm-form-primary);
	background: color-mix(in srgb, var(--la24crm-form-primary) 7%, #fff);
}

.la24crm-form__status.is-error {
	border-color: color-mix(in srgb, var(--la24crm-form-error) 30%, transparent);
	border-inline-start-color: var(--la24crm-form-error);
	background: color-mix(in srgb, var(--la24crm-form-error) 6%, #fff);
}

.la24crm-form__message,
.la24crm-form__link {
	margin: 0;
}

/* Small status mark; the message text carries the meaning. */
.la24crm-form__status.is-success .la24crm-form__message,
.la24crm-form__status.is-error .la24crm-form__message {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.la24crm-form__status.is-success .la24crm-form__message::before,
.la24crm-form__status.is-error .la24crm-form__message::before {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-block-start: 2px;
	border-radius: 50%;
	font-size: .8rem;
	font-weight: 800;
	line-height: 1;
	color: #fff;
}

.la24crm-form__status.is-success .la24crm-form__message::before {
	content: "\2713";
	content: "\2713" / "";
	background: var(--la24crm-form-success);
}

.la24crm-form__status.is-error .la24crm-form__message::before {
	content: "!";
	content: "!" / "";
	background: var(--la24crm-form-error);
}

.la24crm-form.is-busy .la24crm-form__status.is-info {
	opacity: .85;
}

.la24crm-form__link {
	margin-block-start: 12px;
}

/* The preview link after a demo request: a button, same family as the submit button. */
.la24crm-form .la24crm-form__link-button,
.la24crm-form .la24crm-form__link-button:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 22px;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--la24crm-form-dark);
	text-decoration: none;
	background-color: var(--la24crm-form-accent);
	border: 1px solid var(--la24crm-form-accent);
	border-radius: var(--la24crm-form-radius);
	transition: background-color .2s var(--la24crm-form-ease), color .2s var(--la24crm-form-ease);
}

/* "Opens in a new tab" mark, drawn so it mirrors nothing in RTL. */
.la24crm-form .la24crm-form__link-button::after {
	content: "\2197";
	content: "\2197" / "";
	font-size: .9em;
}

[dir="rtl"] .la24crm-form .la24crm-form__link-button::after,
.rtl .la24crm-form .la24crm-form__link-button::after {
	content: "\2196";
	content: "\2196" / "";
}

.la24crm-form .la24crm-form__link-button:hover {
	color: #fff;
	background-color: var(--la24crm-form-dark);
	border-color: var(--la24crm-form-dark);
}

.la24crm-form .la24crm-form__link-button:focus-visible {
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--la24crm-form-primary);
}

.la24crm-form__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Honeypot ────────────────────────────────────────────────────────── */

.la24crm-form__hp {
	position: absolute !important;
	inset-inline-start: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── Inline layout (newsletter) ──────────────────────────────────────── */

.la24crm-form--inline .la24crm-form__head {
	margin-block-end: 16px;
}

.la24crm-form--inline .la24crm-form__fields {
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
}

.la24crm-form--inline .la24crm-form__field--email {
	grid-column: 1;
	grid-row: 1;
}

.la24crm-form--inline .la24crm-form__actions {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	/* line up with the input, below its label */
	padding-block-start: calc(.92rem * 1.5 + 8px);
}

.la24crm-form--inline .la24crm-form__field--checkbox {
	grid-column: 1 / -1;
	grid-row: 2;
}

/* ── Dark background ─────────────────────────────────────────────────── */

.la24crm-form--on-dark {
	--la24crm-form-field:  rgba(255, 255, 255, .08);
	--la24crm-form-ink:    #f5f6fb;
	--la24crm-form-border: rgba(255, 255, 255, .22);
	--la24crm-form-error:  #ff8a80;
	--la24crm-form-success: #6fd3a0;
}

.la24crm-form--on-dark .la24crm-form__submit {
	color: var(--la24crm-form-dark);
	background-color: var(--la24crm-form-accent);
	border-color: var(--la24crm-form-accent);
}

.la24crm-form--on-dark .la24crm-form__submit:focus-visible {
	box-shadow: 0 0 0 2px var(--la24crm-form-dark), 0 0 0 4px var(--la24crm-form-accent);
}

.la24crm-form--on-dark .la24crm-form__submit:hover {
	color: #fff;
}

.la24crm-form--on-dark .la24crm-form__status {
	background: rgba(255, 255, 255, .06);
}


/* ── Notice for administrators ───────────────────────────────────────── */

.la24crm-form-notice {
	margin: 0;
	padding: 14px 18px;
	border: 1px dashed #c9c7c0;
	border-radius: 12px;
	font-size: .92rem;
}

/* ── Responsive (container query: same browser baseline as color-mix) ── */

@container la24crm-form (max-width: 560px) {
	.la24crm-form__fields {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.la24crm-form .la24crm-form__submit {
		width: 100%;
	}

	.la24crm-form--inline .la24crm-form__fields {
		grid-template-columns: minmax(0, 1fr);
	}

	.la24crm-form--inline .la24crm-form__field--email,
	.la24crm-form--inline .la24crm-form__actions,
	.la24crm-form--inline .la24crm-form__field--checkbox {
		grid-column: 1;
		grid-row: auto;
		padding-block-start: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.la24crm-form .la24crm-form__submit,
	.la24crm-form input,
	.la24crm-form select,
	.la24crm-form textarea {
		transition: none;
	}

	.la24crm-form__spinner {
		animation-duration: 1.6s;
	}
}

@media (forced-colors: active) {
	.la24crm-form .la24crm-form__submit,
	.la24crm-form__status {
		border: 1px solid CanvasText;
	}
}
