/**
 * Lead Form Webhook – estilos.
 * Colores en variables: el tema puede sobrescribirlas, p. ej. .lfw { --lfw-accent: #e30613; }
 */

.lfw {
	--lfw-accent: #0057a8;
	--lfw-accent-hover: #003f7d;
	--lfw-text: #1f2933;
	--lfw-label: #3e4c59;
	--lfw-muted: #616e7c;
	--lfw-border: #cbd2d9;
	--lfw-field-bg: #ffffff;
	--lfw-error: #c0392b;
	--lfw-success: #1e7b34;
	--lfw-radius: 6px;
	color: var(--lfw-text);
	font-family: inherit;
	line-height: 1.4;
}

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

/* ---------- Rejilla ---------- */

.lfw__form {
	margin: 0;
}

.lfw__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px 20px;
}

@media (min-width: 640px) {
	.lfw--embedded .lfw__grid {
		grid-template-columns: 1fr 1fr;
	}

	.lfw--embedded .lfw__row {
		grid-column: 1 / -1;
	}

	.lfw--embedded .lfw__row--half {
		grid-column: auto;
	}
}

.lfw__row {
	min-width: 0;
}

/* ---------- Etiquetas y campos ---------- */

.lfw .lfw__label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--lfw-label);
}

.lfw__req {
	margin-left: 2px;
	color: var(--lfw-error);
}

/* Selector reforzado para anular estilos de inputs del tema/Elementor. */
.lfw .lfw__input {
	display: block;
	width: 100%;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--lfw-border);
	border-radius: var(--lfw-radius);
	background: var(--lfw-field-bg);
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--lfw-text);
}

.lfw .lfw__input::placeholder {
	color: #9aa5b1;
	opacity: 1;
}

.lfw .lfw__input:focus {
	border-color: var(--lfw-accent);
	outline: 2px solid color-mix(in srgb, var(--lfw-accent) 25%, transparent);
	outline-offset: 0;
}

.lfw textarea.lfw__input {
	min-height: 120px;
	resize: vertical;
}

.lfw .has-error .lfw__input {
	border-color: var(--lfw-error);
}

.lfw__error {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--lfw-error);
}

.lfw__error:empty {
	display: none;
}

/* ---------- Radios y checkbox ---------- */

.lfw .lfw__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.lfw__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.lfw .lfw__option,
.lfw .lfw__check {
	display: inline-flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: var(--lfw-text);
	cursor: pointer;
}

.lfw .lfw__option input,
.lfw .lfw__check input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--lfw-accent);
}

/* ---------- Pie del formulario ---------- */

.lfw__privacy {
	margin: 16px 0;
	font-size: 13px;
	color: var(--lfw-muted);
}

.lfw__privacy a {
	color: var(--lfw-accent);
	text-decoration: underline;
}

.lfw .lfw__submit {
	display: inline-block;
	margin: 0;
	padding: 13px 40px;
	border: 0;
	border-radius: var(--lfw-radius);
	background: var(--lfw-accent);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.lfw .lfw__submit:hover,
.lfw .lfw__submit:focus-visible {
	background: var(--lfw-accent-hover);
	color: #fff;
}

.lfw .lfw__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.lfw__feedback {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: var(--lfw-radius);
	font-size: 14px;
}

.lfw__feedback:empty {
	display: none;
}

.lfw__feedback.is-success {
	background: #e3f4e7;
	color: var(--lfw-success);
}

.lfw__feedback.is-error {
	background: #fbe9e7;
	color: var(--lfw-error);
}

.lfw__feedback a {
	color: inherit;
	text-decoration: underline;
}

/* ---------- Anti-spam ---------- */

.lfw__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* ==========================================================================
   Widget flotante: estilo chat de WhatsApp (mismo diseño del widget de Ecomed).
   Mobile-first; @media (min-width: 481px) ajusta a escritorio.
   ========================================================================== */

.lfw--floating {
	--lfw-wa-green: #00c033;
	--lfw-wa-bubble: #dcf8c6;
	--lfw-wa-bg: #e5ddd5;
	--lfw-wa-btn: #0b6156;
	--lfw-wa-btn-hover: #04433b;
	font-family: Helvetica, Arial, sans-serif;
	line-height: normal;
}

/* ---------- Botón flotante ---------- */

.lfw .lfw__launcher {
	position: fixed;
	right: 8%;
	bottom: 15%;
	z-index: 100000030;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 45px;
	height: 45px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lfw-wa-green);
	color: #fff;
	box-shadow: rgba(0, 0, 0, 0.25) 0 4px 14px;
	cursor: pointer;
}

.lfw .lfw__launcher:hover,
.lfw .lfw__launcher:focus {
	background: var(--lfw-wa-green);
	color: #fff;
}

.lfw__launcher .lfw__icon {
	width: 22px;
	height: 22px;
}

.lfw--floating.is-open .lfw__launcher {
	display: none;
}

/* ---------- Capa oscura ---------- */

.lfw__overlay {
	position: fixed;
	inset: 0;
	z-index: -3;
	background: rgba(0, 0, 0, 0.7);
	opacity: 0;
	visibility: hidden;
	transition: 0.3s;
}

.lfw--floating.is-open .lfw__overlay {
	z-index: 100000000;
	opacity: 1;
	visibility: visible;
}

/* ---------- Panel ---------- */

.lfw--floating .lfw__panel {
	position: fixed;
	left: 2.5%;
	bottom: -800px;
	z-index: 100000031;
	display: flex;
	flex-direction: column;
	width: 95%;
	max-height: 85vh;
	overflow: hidden;
	border-radius: 7px;
	background: var(--lfw-wa-bg) url("../img/chat-bg.jpg") center top / cover no-repeat;
	box-shadow: rgba(0, 0, 0, 0.25) 0 4px 4px;
	opacity: 0;
	visibility: hidden;
	transition: 0.3s;
}

.lfw--floating.is-open .lfw__panel {
	bottom: 10%;
	opacity: 1;
	visibility: visible;
}

/* ---------- Cabecera ---------- */

.lfw__header {
	display: flex;
	flex-shrink: 0;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
	padding: 4px 8px;
	border-bottom: 1px solid #bcbcbc;
	border-radius: 7px 7px 0 0;
	background: #fafafa;
}

.lfw__profile {
	display: flex;
	align-items: flex-start;
}

.lfw__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	min-width: 30px;
	height: 30px;
	overflow: hidden;
	border-radius: 50%;
	background: #fff;
}

.lfw .lfw__avatar img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	object-fit: contain;
}

.lfw__meta {
	margin-top: 4px;
	padding-left: 8px;
	text-align: left;
}

.lfw__name {
	font-size: 11px;
	font-weight: 700;
	color: #2a2f32;
}

.lfw__status {
	font-size: 10px;
	color: #a0a0a0;
}

.lfw .lfw__close {
	display: block;
	margin: 0;
	padding: 0 10px 0 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 24px;
	line-height: 1.2;
	color: #2a2f32;
	cursor: pointer;
}

/* ---------- Conversación ---------- */

.lfw--floating .lfw__body {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 16px 8px;
	overflow-y: auto;
}

.lfw--floating .lfw__form {
	display: flex;
	flex-direction: column;
}

.lfw--floating .lfw__grid {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Globo entrante (bienvenida). */
.lfw__in {
	align-self: flex-start;
	width: 90%;
	max-width: 266px;
	margin-bottom: 20px;
	padding-left: 10px;
	border-bottom: 1px solid #ccc;
	border-radius: 4px;
}

.lfw__bubble-in {
	position: relative;
	padding: 8px;
	border-radius: 4px 0 0;
	background: #fff;
	font-size: 11px;
	color: gray;
}

.lfw__bubble-in::after {
	content: "";
	position: absolute;
	left: -10px;
	bottom: 0;
	border-top: 10px solid transparent;
	border-right: 10px solid #fff;
}

/* Cada campo es un globo saliente. */
.lfw--floating .lfw__row {
	position: relative;
	align-self: flex-end;
	width: calc(90% - 10px);
	max-width: 256px;
	margin: 0 10px 8px 0;
	padding: 2px 8px;
	border-bottom: 1px solid #ccc;
	border-radius: 4px 0 4px 4px;
	background: var(--lfw-wa-bubble);
	text-align: left;
}

.lfw--floating .lfw__row::after {
	content: "";
	position: absolute;
	top: 0;
	right: -10px;
	border-bottom: 10px solid transparent;
	border-left: 10px solid var(--lfw-wa-bubble);
}

.lfw--floating .lfw__label {
	margin: 0;
	font-size: 11px;
	font-weight: 400;
	color: #737373;
}

.lfw--floating .lfw__req {
	margin-left: 0;
	color: inherit;
}

.lfw--floating .lfw__input,
.lfw--floating .lfw__input:focus {
	padding: 2px 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	font-size: 12px;
	line-height: 18px;
	color: #333;
}

.lfw--floating .lfw__input::placeholder {
	color: #757575;
}

.lfw--floating textarea.lfw__input {
	min-height: 0;
	max-height: 100px;
	resize: none;
}

.lfw--floating .lfw__options {
	flex-direction: column;
	gap: 4px;
	padding: 4px 0;
}

.lfw--floating .lfw__option,
.lfw--floating .lfw__check {
	font-size: 12px;
	color: #333;
}

.lfw--floating .lfw__option input,
.lfw--floating .lfw__check input {
	width: 13px;
	height: 13px;
	accent-color: var(--lfw-wa-btn);
}

/* La casilla de consentimiento va sin globo, alineada a la derecha. */
.lfw--floating .lfw__row--checkbox {
	padding: 0;
	border: 0;
	background: transparent;
}

.lfw--floating .lfw__row--checkbox::after {
	display: none;
}

.lfw--floating .lfw__check {
	font-size: 11px;
	color: #000;
}

.lfw--floating .lfw__error {
	margin: 0;
	font-size: 10px;
	text-align: center;
}

.lfw--floating .lfw__privacy {
	align-self: flex-end;
	width: calc(90% - 10px);
	max-width: 256px;
	margin: 0 10px 8px 0;
	font-size: 11px;
	text-align: right;
	color: #000;
}

.lfw--floating .lfw__privacy a {
	color: #397a9e;
}

/* ---------- Botón y mensajes ---------- */

.lfw--floating .lfw__submit {
	align-self: flex-end;
	width: 180px;
	margin: 10px 10px 40px 0;
	padding: 10px 0;
	border-radius: 4px;
	background: var(--lfw-wa-btn);
	font-size: 12px;
	font-weight: 700;
}

.lfw--floating .lfw__submit:hover,
.lfw--floating .lfw__submit:focus-visible {
	background: var(--lfw-wa-btn-hover);
}

.lfw .lfw__submit[hidden] {
	display: none;
}

.lfw--floating .lfw__feedback {
	align-self: flex-start;
	width: 90%;
	max-width: 266px;
	margin: 0 0 8px 10px;
	padding: 8px;
	background: #fff;
	font-size: 11px;
}

.lfw--floating .lfw__feedback.is-success {
	color: var(--lfw-wa-btn);
}

/* ---------- Escritorio ---------- */

@media (min-width: 481px) {
	.lfw .lfw__launcher {
		right: 2%;
		bottom: 12%;
		width: 70px;
		height: 70px;
	}

	.lfw__launcher .lfw__icon {
		width: 42px;
		height: 42px;
	}

	.lfw--floating .lfw__panel {
		left: auto;
		right: 50px;
		width: 350px;
	}

	.lfw--floating.is-open .lfw__panel {
		bottom: 75px;
	}
}
