/**
 * Formulario de contacto por pasos (widget Form de Elementor Pro).
 *
 * No es un shortcode: se engancha a la clase CSS "BP-Formulario" que lleva
 * el widget, y los assets se encolan cuando esa clase aparece en la pagina.
 *
 * Paleta y medidas tomadas del diseño (formulario-pasos.png). El panel de
 * vidrio que rodea al formulario lo pone el contenedor de Elementor: este
 * archivo se ocupa solo de lo que va adentro.
 *
 * Sobre la especificidad: Elementor genera reglas del tipo
 * `.elementor-14 .elementor-element.elementor-element-d3a72bd .x`, que pesan
 * mas que cualquier selector de este archivo. Por eso las propiedades que
 * Elementor tambien define llevan !important; las demas no.
 */

.BP-Formulario {
	/* El panel lo pone el contenedor de Elementor; aqui solo va su contenido. */
	--gd-form-campo: rgba(37, 55, 69, 0.62);
	--gd-form-campo-hover: rgba(48, 68, 84, 0.7);
	--gd-form-borde: rgba(56, 84, 134, 0.71);
	--gd-form-acento: #4e72c1;
	--gd-form-acento-hover: #5b81d4;
	--gd-form-texto: #ffffff;
	--gd-form-tenue: rgba(255, 255, 255, 0.55);
	--gd-form-placeholder: rgba(255, 255, 255, 0.3);
	--gd-form-radio: 14px;

	--gd-form-fuente-titulo: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;

	/*
	 * Variables del stepper que expone Elementor. "primary" es el color del
	 * numero y de la etiqueta; "secondary" es el fondo del circulo.
	 */
	--e-form-steps-indicator-active-primary-color: #ffffff !important;
	--e-form-steps-indicator-active-secondary-color: var(--gd-form-acento) !important;
	--e-form-steps-indicator-completed-primary-color: #ffffff !important;
	--e-form-steps-indicator-completed-secondary-color: var(--gd-form-acento) !important;
	--e-form-steps-indicator-inactive-primary-color: rgba(129, 138, 146, 0.9) !important;
	--e-form-steps-indicator-inactive-secondary-color: rgba(42, 58, 72, 0.62) !important;
	--e-form-steps-divider-width: 1px !important;
	--e-form-steps-divider-gap: 16px !important;
	--e-form-steps-indicator-padding: 0px !important;
	--e-form-steps-indicators-spacing: 34px !important;
}

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


/* --- Barra de pasos -------------------------------------------------------
 * Elementor apila el numero y la etiqueta; el diseño los pone en linea.
 * ---------------------------------------------------------------------- */

.BP-Formulario .e-form__indicators {
	align-items: center;
	justify-content: center;
	margin-bottom: 28px;
}

.BP-Formulario .e-form__indicators__indicator {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	padding: 0;
	flex: 0 0 auto;
}

.BP-Formulario .e-form__indicators__indicator__number {
	width: 32px;
	height: 32px;
	min-width: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Halo del paso en curso, como en el diseño. */
.BP-Formulario .e-form__indicators__indicator--state-active .e-form__indicators__indicator__number {
	box-shadow: 0 0 0 6px rgba(78, 114, 193, 0.18);
}

.BP-Formulario .e-form__indicators__indicator__label {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

/*
 * La etiqueta del paso es un <label>, y el kit del sitio pinta los label del
 * formulario de azul claro con mas peso que las variables del stepper. Por
 * eso el color va aqui, estado por estado, y no en --e-form-steps-*.
 */
.BP-Formulario .e-form__indicators__indicator--state-active .e-form__indicators__indicator__label {
	color: #7fb2f5 !important;
}

.BP-Formulario .e-form__indicators__indicator--state-completed .e-form__indicators__indicator__label {
	color: rgba(255, 255, 255, 0.7) !important;
}

.BP-Formulario .e-form__indicators__indicator--state-inactive .e-form__indicators__indicator__label {
	color: rgba(255, 255, 255, 0.42) !important;
}

.BP-Formulario .e-form__indicators__indicator__separator {
	flex: 1 1 auto;
	max-width: 110px;
	background-color: rgba(255, 255, 255, 0.16) !important;
}


/* --- Titulo de cada paso --------------------------------------------------
 * Son campos de tipo HTML dentro del formulario.
 * ---------------------------------------------------------------------- */

.BP-Formulario .elementor-field-type-html {
	margin-bottom: 18px;
	color: var(--gd-form-texto) !important;
	font-family: var(--gd-form-fuente-titulo);
	font-size: 22px !important;
	font-weight: 700 !important;
	line-height: 1.25;
}


/* --- Campos --------------------------------------------------------------- */

.BP-Formulario .elementor-field-group > label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.BP-Formulario .elementor-field-group .elementor-field,
.BP-Formulario .elementor-field-group .elementor-select-wrapper select {
	min-height: 48px;
	padding: 12px 16px;
	border: 1px solid var(--gd-form-borde) !important;
	border-radius: var(--gd-form-radio) !important;
	background-color: var(--gd-form-campo) !important;
	color: var(--gd-form-texto) !important;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color 0.25s ease, background-color 0.25s ease,
		box-shadow 0.25s ease;
}

.BP-Formulario textarea.elementor-field {
	min-height: 150px;
	resize: vertical;
}

.BP-Formulario .elementor-field-group .elementor-field::placeholder {
	color: var(--gd-form-placeholder);
	opacity: 1;
}

.BP-Formulario .elementor-field-group .elementor-field:hover {
	background-color: var(--gd-form-campo-hover) !important;
}

.BP-Formulario .elementor-field-group .elementor-field:focus,
.BP-Formulario .elementor-field-group .elementor-field:focus-visible {
	border-color: var(--gd-form-acento) !important;
	box-shadow: 0 0 0 3px rgba(78, 114, 193, 0.25);
	outline: none;
}


/* --- Selector de pais -----------------------------------------------------
 * El campo real sigue siendo el <select> de Elementor: el JS lo esconde y
 * dibuja estas fichas encima, sincronizando el valor. Sin JS, el usuario ve
 * el <select> de siempre y el formulario funciona igual.
 * ---------------------------------------------------------------------- */

.BP-Formulario .gd-form__paises {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	width: 100%;
	margin-top: 4px;
}

.BP-Formulario .gd-form__pais {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 74px;
	padding: 14px 12px !important;
	border: 1px solid var(--gd-form-borde) !important;
	border-radius: var(--gd-form-radio) !important;
	background: var(--gd-form-campo) !important;
	background-image: none !important;
	color: var(--gd-form-texto);
	font-family: var(--gd-form-fuente-titulo);
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	text-transform: none !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	transition: border-color 0.25s ease, background-color 0.25s ease,
		box-shadow 0.25s ease, transform 0.25s ease;
}

.BP-Formulario .gd-form__pais__bandera {
	font-size: 22px;
	line-height: 1;
}

.BP-Formulario .gd-form__pais:hover {
	background: var(--gd-form-campo-hover) !important;
	transform: translateY(-2px);
}

.BP-Formulario .gd-form__pais.is-elegido {
	border-color: var(--gd-form-acento) !important;
	background: rgba(78, 114, 193, 0.22) !important;
	box-shadow: 0 0 0 3px rgba(78, 114, 193, 0.22);
}

.BP-Formulario .gd-form__pais:focus-visible {
	outline: 2px solid var(--gd-form-acento);
	outline-offset: 3px;
}

/* Variante sin bandera (paso "Su necesidad"): tarjetas anchas, una por fila. */
.BP-Formulario .gd-form__paises--tarjetas {
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.BP-Formulario .gd-form__paises--tarjetas .gd-form__pais {
	justify-content: flex-start;
	min-height: 56px;
	padding: 14px 20px !important;
	font-size: 15px;
	line-height: 1.35;
	text-align: left;
	white-space: normal !important;
	overflow-wrap: anywhere;
}

.BP-Formulario .gd-form__paises--tarjetas .gd-form__pais__nombre {
	min-width: 0;
	white-space: normal;
}

/*
 * El <select> real se esconde, pero sigue en el formulario: display:none no
 * impide que un campo se envie (eso solo lo hace disabled). Quien lo sustituye
 * de cara al usuario y a los lectores de pantalla es el radiogroup de fichas.
 *
 * Lleva !important porque el envoltorio tambien es .elementor-field, y esa
 * regla pesa mas que esta clase.
 */
.BP-Formulario .gd-form__oculto {
	display: none !important;
}


/* --- Contador del textarea ------------------------------------------------ */

.BP-Formulario .gd-form__contador {
	margin: 8px 0 0;
	color: var(--gd-form-tenue);
	font-size: 13px;
	line-height: 1.3;
}

.BP-Formulario .gd-form__contador.is-corto {
	color: rgba(255, 176, 132, 0.9);
}


/* --- Botones --------------------------------------------------------------
 * El diseño pone "Atras" a la izquierda como enlace y la accion principal a
 * la derecha como pastilla. Elementor los estira al 100 % del ancho.
 * ---------------------------------------------------------------------- */

.BP-Formulario .e-form__buttons {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	width: 100%;
	margin-top: 22px;
	padding-top: 22px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cuando hay boton de retroceso, se separan a los extremos. */
.BP-Formulario .e-form__buttons:has(.e-form__buttons__wrapper__button-previous) {
	justify-content: space-between;
}

/*
 * Elementor estira los botones con flex-basis (el widget esta en modo
 * "ancho 100%"), asi que no basta con width:auto: hay que ganarle al flex.
 */
.BP-Formulario .e-form__buttons__wrapper,
.BP-Formulario .elementor-field-type-submit {
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none;
	padding: 0 !important;
	margin-bottom: 0 !important;
}

.BP-Formulario .elementor-field-type-submit {
	display: flex;
	justify-content: flex-end;
}

.BP-Formulario .e-form__buttons__wrapper__button,
.BP-Formulario .elementor-button[type="submit"] {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex: 0 0 auto !important;
	width: auto !important;
	min-width: 0;
	padding: 13px 26px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--gd-form-acento) !important;
	background-image: none !important;
	font-family: var(--gd-form-fuente-titulo);
	font-size: 15px !important;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none !important;
	cursor: pointer;
	box-shadow: 0 12px 26px -14px rgba(78, 114, 193, 0.9);
	transition: background-color 0.25s ease, transform 0.25s ease,
		box-shadow 0.25s ease;
}

.BP-Formulario .e-form__buttons__wrapper__button:hover,
.BP-Formulario .elementor-button[type="submit"]:hover {
	background-color: var(--gd-form-acento-hover) !important;
	transform: translateY(-1px);
}

/* Flecha de avance, dibujada en CSS para no depender de iconos del widget. */
.BP-Formulario .e-form__buttons__wrapper__button-next::after,
.BP-Formulario .elementor-button[type="submit"]::after {
	content: "";
	width: 17px;
	height: 17px;
	flex: 0 0 auto;
	background: currentColor;
	-webkit-mask: var(--gd-form-flecha) center / contain no-repeat;
	mask: var(--gd-form-flecha) center / contain no-repeat;
}

.BP-Formulario {
	--gd-form-flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* "Atras": enlace discreto, no pastilla. */
.BP-Formulario .e-form__buttons__wrapper__button-previous {
	padding: 13px 4px !important;
	background-color: transparent !important;
	color: var(--gd-form-tenue) !important;
	font-weight: 500;
	box-shadow: none !important;
}

.BP-Formulario .e-form__buttons__wrapper__button-previous:hover {
	background-color: transparent !important;
	color: var(--gd-form-texto) !important;
	transform: none;
}

.BP-Formulario .e-form__buttons__wrapper__button-previous::before {
	content: "";
	width: 17px;
	height: 17px;
	flex: 0 0 auto;
	background: currentColor;
	-webkit-mask: var(--gd-form-flecha) center / contain no-repeat;
	mask: var(--gd-form-flecha) center / contain no-repeat;
	transform: rotate(180deg);
}


/* --- Estrecho ------------------------------------------------------------- */

@media (max-width: 767px) {
	.BP-Formulario .e-form__indicators__indicator__label {
		display: none;
	}

	.BP-Formulario .elementor-field-type-html {
		font-size: 19px !important;
	}

	.BP-Formulario .gd-form__paises {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.BP-Formulario .gd-form__paises--tarjetas {
		grid-template-columns: minmax(0, 1fr);
	}

	.BP-Formulario .e-form__buttons {
		gap: 10px;
	}

	.BP-Formulario .e-form__buttons__wrapper__button,
	.BP-Formulario .elementor-button[type="submit"] {
		padding: 12px 20px !important;
		font-size: 14px !important;
	}
}


/* --- Preferencias de movimiento ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.BP-Formulario .gd-form__pais,
	.BP-Formulario .e-form__buttons__wrapper__button,
	.BP-Formulario .elementor-button[type="submit"],
	.BP-Formulario .elementor-field-group .elementor-field {
		transition: none;
	}

	.BP-Formulario .gd-form__pais:hover,
	.BP-Formulario .e-form__buttons__wrapper__button:hover {
		transform: none;
	}
}
