/*
 * LEAD-01K — generic styling for the smq-lead plugin surfaces (theme-owned; the plugin owns markup,
 * states and behaviour). DS-002 tokens only; no MT5-specific rules.
 *
 * Loaded by functions.php: on any page that renders the `smq/lead-form` block (wp_enqueue_block_style)
 * and, through the registered handle `smq-lead`, on the plugin's utility routes
 * (/confirmar-interes/, /gestionar-interes/).
 *
 * Surface-agnostic: text inherits the surrounding colour, so the form works on light pages and on
 * navy bands (MT5 launch-list slot). Contrast (WCAG 2.x, measured):
 * - inputs: navy-950 on white 19.2:1; border gray-600 on white 5.98:1 (non-text ≥ 3:1);
 * - submit: white on blue-interactive-strong 5.13:1 (DS-A11Y-01; was blue-interactive 3.87:1) — passes
 *   as normal text; the 19px bold size is kept unchanged (hover brightness(0.9): 4.88:1).
 * - errors: message text keeps the inherited colour (full contrast); red-500 is only a non-text marker
 *   (3.91:1 on white, 4.89:1 on navy-950). "Error:" prefix → never colour-only.
 * - status marker: blue-interactive (3.87:1 on white, 4.95:1 on navy-950).
 * Focus: the theme's global :focus-visible ring (site.css) is kept, not overridden.
 */

/* ================= Lead form (block smq/lead-form) ================= */
/* The wrapper follows the surrounding layout (block themes constrain it to the content width); the
   readable line length is set on the inner form and status instead. */
.smq-lead-form {
	width: 100%;
	font-family: var(--smq-font-text);
	font-size: 1rem;
	line-height: 1.55;
	color: inherit;
}
.smq-lead-form p {
	margin: 0;
}
/* PRG target (tabindex="-1"): receives focus after the redirect; it is not a control, no ring. */
.smq-lead-form[tabindex="-1"]:focus {
	outline: none;
}
.smq-lead-form__form,
.smq-lead-form__status {
	max-width: 36rem;
}
.smq-lead-form__form {
	display: flex;
	flex-direction: column;
	gap: var(--smq-space-4);
	margin: 0;
}
.smq-lead-form__intro {
	font-weight: 600;
	font-size: 1.05rem;
}
.smq-lead-form__field {
	display: flex;
	flex-direction: column;
	gap: var(--smq-space-2);
	min-width: 0;
}
.smq-lead-form__field > label {
	font-weight: 600;
	font-size: 0.95rem;
}
.smq-lead-form input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem; /* ≥ 16px: no zoom-on-focus on mobile */
	color: var(--smq-navy-950);
	background: var(--smq-white);
	border: 1px solid var(--smq-gray-600);
	border-radius: 4px;
}
.smq-lead-form input[type="email"][aria-invalid="true"] {
	border: 2px solid var(--smq-red-500);
	padding: 11px 13px;
}
/* Consent: checkbox aligned with the first line of a wrapping label. */
.smq-lead-form__field--consent {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: var(--smq-space-3);
	row-gap: var(--smq-space-2);
	align-items: start;
}
.smq-lead-form__field--consent input[type="checkbox"] {
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--smq-blue-interactive);
}
.smq-lead-form__field--consent > label {
	font-weight: 400;
	font-size: 0.95rem;
	cursor: pointer;
}
.smq-lead-form__field--consent .smq-lead-form__error {
	grid-column: 2;
}
.smq-lead-form__notice {
	font-size: 0.85rem;
	line-height: 1.5;
}
/* Privacy-policy link in the notice: inherits the surface text colour (full contrast on light pages and
   navy bands, unlike the global blue link on white); the underline keeps it distinguishable. */
.smq-lead-form__notice a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.smq-lead-form__error {
	padding-left: var(--smq-space-3);
	border-left: 3px solid var(--smq-red-500);
	font-size: 0.9rem;
	font-weight: 600;
}
.smq-lead-form__submit {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px var(--smq-space-5);
	font-family: var(--smq-font-text);
	font-size: 1.1875rem; /* 19px bold = WCAG large text (see header) */
	font-weight: 700;
	line-height: 1.2;
	color: var(--smq-white);
	background: var(--smq-blue-interactive-strong);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	transition: filter 0.15s ease;
}
.smq-lead-form__submit:hover {
	filter: brightness(0.9);
}
/* Status region: an empty live region takes no space; a message gets a marker (never colour-only:
   the text states the outcome). */
.smq-lead-form__status:empty {
	display: none;
}
.smq-lead-form__status {
	padding: var(--smq-space-3) var(--smq-space-3) var(--smq-space-3) var(--smq-space-4);
	border-left: 4px solid var(--smq-blue-interactive);
	margin-bottom: var(--smq-space-4);
	font-size: 0.95rem;
}
.smq-lead-form__status[role="alert"] {
	border-left-color: var(--smq-red-500);
	font-weight: 600;
}
.smq-lead-form__status--closed {
	border-left-color: var(--smq-gray-600);
}
.smq-lead-form--placeholder {
	font-size: 0.95rem;
}

@media (max-width: 767px) {
	.smq-lead-form__submit {
		align-self: stretch; /* full-width tap target on phones */
	}
}

/* ================= Utility pages (/confirmar-interes/, /gestionar-interes/) ================= */
.smq-lead-utility__main {
	box-sizing: border-box;
	width: 100%;
	max-width: 40rem;
	margin: 0 auto;
	padding: var(--smq-space-7) var(--smq-space-4) var(--smq-space-8);
	font-family: var(--smq-font-text);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--smq-navy-950);
}
.smq-lead-utility__main h1 {
	margin: 0 0 var(--smq-space-4);
	font-family: var(--smq-font-display);
	font-size: clamp(1.6rem, 4vw, 2.1rem);
	line-height: 1.2;
}
.smq-lead-utility__main p {
	margin: 0 0 var(--smq-space-4);
}
.smq-lead-utility__main a {
	color: var(--smq-navy-950);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.smq-lead-utility__form {
	margin: 0 0 var(--smq-space-4);
}
.smq-lead-utility__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px var(--smq-space-5);
	font-family: var(--smq-font-text);
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--smq-white);
	background: var(--smq-blue-interactive-strong);
	border: 2px solid var(--smq-blue-interactive-strong);
	border-radius: 4px;
	cursor: pointer;
}
/* Secondary / wider-scope action: outlined, never the default emphasis. */
.smq-lead-utility__button--secondary {
	font-size: 1rem;
	font-weight: 600;
	color: var(--smq-navy-950);
	background: var(--smq-white);
	border-color: var(--smq-gray-600);
}
.smq-lead-utility__button:hover {
	filter: brightness(0.92);
}
.smq-lead-utility__note {
	font-size: 0.9rem;
	color: var(--smq-gray-600);
}
@media (max-width: 767px) {
	.smq-lead-utility__main {
		padding: var(--smq-space-6) var(--smq-space-3) var(--smq-space-7);
	}
	.smq-lead-utility__button {
		width: 100%;
	}
}
