/*
 * Formulario de contacto de las páginas (Contact Form 7, «Contacto web (páginas)»).
 * Sustituye al formulario de UiCore Elements y conserva su aspecto: la tarjeta
 * (fondo, borde, radio, sombra, padding) la pone el widget de Elementor; aquí
 * solo va la rejilla de campos, los controles y los mensajes.
 */
.wpcf7-form .hfx-cf7 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 12px;
	font-family: Manrope, sans-serif;
}

.wpcf7-form .hfx-cf7__field--full { grid-column: 1 / -1; }

.wpcf7-form .hfx-cf7 label,
.wpcf7-form .hfx-cf7__legend {
	display: block;
	margin: 0;
	color: #1A1308;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
}

.wpcf7-form .hfx-cf7 .wpcf7-form-control-wrap { display: block; }

.wpcf7-form .hfx-cf7 input[type="text"],
.wpcf7-form .hfx-cf7 input[type="email"],
.wpcf7-form .hfx-cf7 input[type="tel"],
.wpcf7-form .hfx-cf7 select {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid rgba(222, 28, 29, 0.1);
	border-radius: 8px;
	background-color: rgba(222, 28, 29, 0.02);
	box-shadow: none;
	color: #1A1308;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
	transition: border-color 0.2s ease;
}

.wpcf7-form .hfx-cf7 select {
	padding-right: 36px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231A1308' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 14px 14px;
	cursor: pointer;
}

.wpcf7-form .hfx-cf7 input::placeholder { color: rgba(6, 39, 2, 0.6); opacity: 1; }

.wpcf7-form .hfx-cf7 input:hover,
.wpcf7-form .hfx-cf7 select:hover { border-color: rgba(222, 28, 29, 0.3); }

.wpcf7-form .hfx-cf7 input:focus,
.wpcf7-form .hfx-cf7 select:focus {
	outline: none;
	border-color: #DE1C1D;
}

.wpcf7-form .hfx-cf7 input:focus-visible,
.wpcf7-form .hfx-cf7 select:focus-visible { box-shadow: 0 0 0 3px rgba(222, 28, 29, 0.15); }

.wpcf7-form .hfx-cf7 p { margin: 0; }
.wpcf7-form .hfx-cf7 br { display: none; }

/* Aceptación de la política de privacidad */
.wpcf7-form .hfx-cf7__legal { color: #6E7A84; font-size: 15px; line-height: 1.6; }
.wpcf7-form .hfx-cf7__legal .wpcf7-list-item { margin: 0; }
.wpcf7-form .hfx-cf7__legal .wpcf7-list-item label { display: flex; align-items: flex-start; gap: 8px; color: inherit; font-size: inherit; font-weight: 400; cursor: pointer; }
.wpcf7-form .hfx-cf7__legal input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 4px 0 0; accent-color: #DE1C1D; }
.wpcf7-form .hfx-cf7__legal a { color: #DE1C1D; }

/* Botón */
.wpcf7-form .hfx-cf7__submit { position: relative; }

.wpcf7-form .hfx-cf7 input[type="submit"] {
	display: block;
	width: 100%;
	margin: 0;
	padding: 20px 40px;
	border: 0;
	border-radius: 50px;
	background-color: #DE1C1D;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

/* El kit de Elementor pinta :hover/:focus en gris (uicore_secondary): tras el clic el botón conserva el foco. */
.wpcf7-form .hfx-cf7 input[type="submit"]:focus { background-color: #DE1C1D; color: #FFFFFF; }

.wpcf7-form .hfx-cf7 input[type="submit"]:hover,
.wpcf7-form .hfx-cf7 input[type="submit"]:focus-visible { background-color: #9A0E0F; color: #FFFFFF; }

.wpcf7-form .hfx-cf7 input[type="submit"]:focus-visible { outline: 2px solid #1A1308; outline-offset: 3px; }

/* Turnstile deshabilita el botón hasta verificar: se mantiene rojo, atenuado. */
.wpcf7-form .hfx-cf7 input[type="submit"]:disabled { background-color: #DE1C1D; color: #FFFFFF; opacity: 0.55; cursor: not-allowed; }
.wpcf7-form.submitting .hfx-cf7 input[type="submit"] { opacity: 0.7; cursor: wait; }

/* El spinner de CF7 no cabe dentro del botón a ancho completo: se centra debajo. */
.wpcf7-form .hfx-cf7__submit .wpcf7-spinner { position: absolute; left: 50%; bottom: -30px; margin: 0 0 0 -12px; }

/* Turnstile (lo inyecta simple-cloudflare-turnstile antes del botón) */
/* El plugin escribe margin-bottom:-15px en línea y el botón queda pegado al recuadro de verificación;
   solo !important puede con un estilo en línea. (El <div> sale del <p> de CF7 al parsear: no vale un gap.) */
.wpcf7-form .hfx-cf7 .cf7-cf-turnstile { margin: 0 0 14px !important; }
.wpcf7-form .hfx-cf7 .cf-turnstile { margin: 0; }

/* Errores de validación y respuesta */
.wpcf7-form .hfx-cf7 input.wpcf7-not-valid,
.wpcf7-form .hfx-cf7 select.wpcf7-not-valid { border-color: #DE1C1D; }
.wpcf7-form .hfx-cf7 .wpcf7-not-valid-tip { margin-top: 4px; color: #B3161A; font-size: 13px; line-height: 1.4; }

.wpcf7-form:has(.hfx-cf7) .wpcf7-response-output {
	margin: 20px 0 0;
	padding: 12px 16px;
	border: 1px solid rgba(222, 28, 29, 0.2);
	border-radius: 8px;
	color: #1A1308;
	font-family: Manrope, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.wpcf7-form.sent:has(.hfx-cf7) .wpcf7-response-output { border-color: rgba(6, 120, 60, 0.35); background: rgba(6, 120, 60, 0.05); }

@media (max-width: 767px) {
	.wpcf7-form .hfx-cf7 { grid-template-columns: minmax(0, 1fr); }
}
