/*
 * Mellow Lead Magnet.
 * Two designs:
 * - .mst-lm--simple : the form only (first name, email, button, consent). Fonts, colors and buttons come from the theme.
 * - .mst-lm--full   : branded box with cover, title and subtitle.
 *   Brand: Cream #FFFAF1, Oat #F3EAD8, Mellow Gold #F2C14E, Espresso #2B1E15.
 */

/* ---------- Common: layout only ---------- */
.mst-lm { --mst-lm-error: #A3321E; container-type: inline-size; container-name: mstlm; }
.mst-lm *, .mst-lm *::before, .mst-lm *::after { box-sizing: border-box; }
.mst-lm__body { container-type: inline-size; container-name: mstlmbody; min-width: 0; }

/* Horizontal bar: first name + email + button */
.mst-lm .mst-lm__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
	gap: 10px;
	align-items: end;
}
.mst-lm .mst-lm__field { min-width: 0; }
.mst-lm .mst-lm__field label { display: block; margin: 0 0 4px; font-size: 0.8125rem; font-weight: 600; }
.mst-lm .mst-lm__field input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 46px;
	margin: 0;
	padding-left: 12px;
	padding-right: 12px;
	font-size: 16px; /* No zoom on iPhone. */
}
.mst-lm .mst-lm__field input[aria-invalid="true"] { border-color: var(--mst-lm-error); }
.mst-lm .mst-lm__button { min-height: 46px; margin: 0; white-space: nowrap; cursor: pointer; }
.mst-lm .mst-lm__button[disabled] { opacity: 0.7; cursor: wait; }

.mst-lm .mst-lm__consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 0.875rem; line-height: 1.45; text-align: left; }
.mst-lm .mst-lm__consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; }
.mst-lm .mst-lm__consent label { margin: 0; font-size: inherit; font-weight: 400; }
.mst-lm .mst-lm__consent a { text-decoration: underline; }

.mst-lm .mst-lm__small { margin: 8px 0 0; font-size: 0.8125rem; opacity: 0.8; }
.mst-lm .mst-lm__error { margin: 10px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--mst-lm-error); }
.mst-lm .mst-lm__error:empty { display: none; }
.mst-lm .mst-lm__success { margin: 0; font-weight: 600; }
.mst-lm .mst-lm__success:empty { display: none; }
.mst-lm .mst-lm__success:focus { outline: none; }

.mst-lm input:focus-visible,
.mst-lm .mst-lm__button:focus-visible,
.mst-lm a:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

.mst-lm .mst-lm__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.mst-lm .mst-lm__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; }

/* Mobile and narrow columns: first name on top, email below, then the button, all full width,
   so the whole email address stays visible. */
@container mstlmbody (max-width: 560px) {
	.mst-lm .mst-lm__row { grid-template-columns: minmax(0, 1fr); }
	.mst-lm .mst-lm__button { width: 100%; }
}
@media (max-width: 640px) {
	.mst-lm .mst-lm__row { grid-template-columns: minmax(0, 1fr); }
	.mst-lm .mst-lm__button { width: 100%; }
}

/* Consent sentence (no checkbox) and reCAPTCHA notice. */
.mst-lm p.mst-lm__notice { display: block; margin: 12px 0 0; }
.mst-lm .mst-lm__recaptcha { font-size: 0.75rem; }
.mst-lm .mst-lm__recaptcha a { text-decoration: underline; color: inherit; }
/* The reCAPTCHA notice is shown in the form, so Google's floating badge can be hidden (allowed by Google). */
.grecaptcha-badge { visibility: hidden !important; }

/* ---------- Full design (branded box) ---------- */
.mst-lm--full {
	--mst-lm-cream: #FFFAF1;
	--mst-lm-oat: #F3EAD8;
	--mst-lm-gold: #F2C14E;
	--mst-lm-gold-dark: #E3AE2F;
	--mst-lm-espresso: #2B1E15;
	--mst-lm-serif: "Fraunces", Georgia, "Times New Roman", serif;
	--mst-lm-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	display: block;
	margin: 40px 0;
	padding: 28px;
	background: var(--mst-lm-cream);
	border: 2px solid var(--mst-lm-oat);
	border-radius: 16px;
	color: var(--mst-lm-espresso);
	font-family: var(--mst-lm-sans);
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
}
.mst-lm--full.mst-lm--image .mst-lm__inner {
	display: grid;
	grid-template-columns: minmax(150px, min(30%, 280px)) minmax(0, 1fr);
	gap: 32px;
	align-items: center;
}
.mst-lm--full .mst-lm__cover { background: var(--mst-lm-oat); border-radius: 12px; padding: 18px; }
.mst-lm--full .mst-lm__cover img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 24px rgba(43, 30, 21, 0.18); }
.mst-lm--full .mst-lm__title {
	margin: 0 0 8px;
	padding: 0;
	font-family: var(--mst-lm-serif);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	color: var(--mst-lm-espresso);
	text-transform: none;
}
.mst-lm--full .mst-lm__subtitle { margin: 0 0 20px; color: var(--mst-lm-espresso); font-size: 1rem; }
.mst-lm--full .mst-lm__field label,
.mst-lm--full .mst-lm__consent label,
.mst-lm--full .mst-lm__consent a { color: var(--mst-lm-espresso); }
.mst-lm--full .mst-lm__field input {
	height: 48px;
	padding: 0 14px;
	font-family: inherit;
	color: var(--mst-lm-espresso);
	background: #FFFFFF;
	border: 1.5px solid #D9CBB0;
	border-radius: 10px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.mst-lm--full .mst-lm__field input:focus { border-color: var(--mst-lm-espresso); }
.mst-lm--full .mst-lm__field input[aria-invalid="true"] { border-color: var(--mst-lm-error); }
.mst-lm--full .mst-lm__button {
	height: 48px;
	padding: 0 24px;
	font-family: var(--mst-lm-sans);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	color: var(--mst-lm-espresso); /* Never white on gold. */
	background: var(--mst-lm-gold);
	border: 0;
	border-radius: 10px;
	box-shadow: none;
	transition: background-color 0.15s ease;
}
.mst-lm--full .mst-lm__button:hover { background: var(--mst-lm-gold-dark); color: var(--mst-lm-espresso); }
.mst-lm--full .mst-lm__consent input { accent-color: var(--mst-lm-espresso); }
.mst-lm--full .mst-lm__small { color: #6B5A48; opacity: 1; }
.mst-lm--full .mst-lm__success {
	padding: 18px 20px;
	font-family: var(--mst-lm-serif);
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1.4;
	background: var(--mst-lm-oat);
	border-radius: 12px;
}
.mst-lm--full input:focus-visible,
.mst-lm--full .mst-lm__button:focus-visible,
.mst-lm--full a:focus-visible { outline-color: var(--mst-lm-espresso); }

/* Narrow box: cover on top. */
@container mstlm (max-width: 600px) {
	.mst-lm--full.mst-lm--image .mst-lm__inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.mst-lm--full .mst-lm__cover { width: 100%; max-width: 240px; margin: 0 auto; }
}

/* Older browsers without container queries: use the screen width. */
@supports not (container-type: inline-size) {
	@media (max-width: 720px) {
		.mst-lm--full.mst-lm--image .mst-lm__inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
		.mst-lm--full .mst-lm__cover { max-width: 240px; margin: 0 auto; }
		.mst-lm .mst-lm__row { grid-template-columns: minmax(0, 1fr); }
		.mst-lm .mst-lm__button { width: 100%; }
	}
}

@media (max-width: 720px) {
	.mst-lm--full { padding: 22px 18px; }
}
