/**
 * Bloque cimentia/formulario-con-cf7
 * Estiliza la salida de Contact Form 7 según el diseño de Figma.
 *
 * Requiere que el formulario CF7 use la plantilla de markup documentada en
 * README.md (clases .cmt-form__*). Los estilos también cubren los controles
 * nativos de CF7 (.wpcf7-form-control) por si se usa un markup más simple.
 */

.cmt-formulario-cf7 {
	--cmt-form-border: #717171;
	--cmt-form-dark: #0b1222;
	--cmt-form-label: 12px;
	--cmt-form-gap: 40px;
	width: 100%;
	max-width: 1440px;
	margin-inline: auto;
	padding-inline: clamp(16px, 11.6vw, 168px);
	box-sizing: border-box;
}

.cmt-formulario-cf7 * {
	box-sizing: border-box;
}

/* Aviso de admin (CF7 inactivo / sin ID). */
.cmt-formulario-cf7__notice {
	padding: 24px;
	border: 1px dashed var(--cmt-form-border);
	border-radius: 8px;
	color: var(--cmt-form-border);
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 14px;
}

/* Contenedor del formulario CF7. */
.cmt-formulario-cf7 .wpcf7-form {
	display: flex;
	flex-direction: column;
}

/* Filas y campos (plantilla recomendada). */
.cmt-formulario-cf7 .cmt-form__row {
	display: flex;
	flex-wrap: wrap;
	column-gap: var(--cmt-form-gap);
	row-gap: var(--cmt-form-gap);
}

.cmt-formulario-cf7 .cmt-form__row--2col > .cmt-form__field {
	flex: 1 1 240px;
	min-width: 0;
}

.cmt-formulario-cf7 .cmt-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 100%;
}

/* Etiquetas. */
.cmt-formulario-cf7 label,
.cmt-formulario-cf7 .cmt-form__field > label {
	font-family: "Ubuntu", system-ui, sans-serif;
	font-size: var(--cmt-form-label);
	line-height: 16px;
	color: var(--cmt-form-border);
	font-weight: 400;
}

/* Campos de texto (text, email, tel). */
.cmt-formulario-cf7 input.wpcf7-form-control:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]),
.cmt-formulario-cf7 input[type="text"],
.cmt-formulario-cf7 input[type="email"],
.cmt-formulario-cf7 input[type="tel"] {
	width: 100%;
	height: 56px;
	padding: 0 24px;
	background: #ffffff;
	border: 1px solid var(--cmt-form-border);
	border-radius: 8px;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 16px;
	line-height: 24px;
	color: var(--cmt-form-dark);
}

/* Área de texto (mensaje). */
.cmt-formulario-cf7 textarea.wpcf7-form-control,
.cmt-formulario-cf7 textarea {
	width: 100%;
	min-height: 136px;
	padding: 24px;
	background: #ffffff;
	border: 1px solid var(--cmt-form-border);
	border-radius: 24px;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 16px;
	line-height: 24px;
	color: var(--cmt-form-dark);
	resize: vertical;
}

.cmt-formulario-cf7 input::placeholder,
.cmt-formulario-cf7 textarea::placeholder {
	color: var(--cmt-form-border);
	opacity: 1;
}

.cmt-formulario-cf7 input:focus,
.cmt-formulario-cf7 textarea:focus,
.cmt-formulario-cf7 select:focus {
	outline: none;
	border-color: var(--cmt-form-dark);
}

/* Desplegable (select "puesto"): mismo box que los inputs + chevron. */
.cmt-formulario-cf7 select,
.cmt-formulario-cf7 select.wpcf7-form-control {
	width: 100%;
	height: 56px;
	padding: 0 48px 0 24px;
	background-color: #ffffff;
	border: 1px solid var(--cmt-form-border);
	border-radius: 8px;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 16px;
	line-height: 24px;
	color: var(--cmt-form-dark);
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%230b1222' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 24px center;
}

/* Adjuntar CV (file). */
.cmt-formulario-cf7 input[type="file"],
.cmt-formulario-cf7 input.wpcf7-file {
	width: 100%;
	height: auto;
	padding: 16px 24px;
	background: #ffffff;
	border: 1px solid var(--cmt-form-border);
	border-radius: 8px;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 14px;
	line-height: 24px;
	color: var(--cmt-form-border);
	cursor: pointer;
}

.cmt-formulario-cf7 input[type="file"]::file-selector-button {
	margin-right: 16px;
	padding: 6px 14px;
	background: var(--cmt-form-dark);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 13px;
	line-height: 20px;
	cursor: pointer;
}

/* Pie: aviso de obligatorios + aceptación + botón. */
.cmt-formulario-cf7 .cmt-form__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	padding-bottom: clamp(48px, 11vw, 160px);
	padding-top: 24px;
}

.cmt-formulario-cf7 .cmt-form__footer-left {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cmt-formulario-cf7 .cmt-form__required {
	margin: 0;
	font-family: "Ubuntu", system-ui, sans-serif;
	font-size: 12px;
	line-height: 16px;
	color: var(--cmt-form-dark);
}

/* Checkbox de aceptación (política de privacidad). */
.cmt-formulario-cf7 .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.cmt-formulario-cf7 .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	cursor: pointer;
}

.cmt-formulario-cf7 .wpcf7-acceptance input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	margin: 0;
	border: 1px solid var(--cmt-form-border);
	border-radius: 0;
	background: #ffffff;
	cursor: pointer;
}

.cmt-formulario-cf7 .wpcf7-acceptance input[type="checkbox"]:checked {
	background: var(--cmt-form-dark);
	border-color: var(--cmt-form-dark);
}

.cmt-formulario-cf7 .wpcf7-acceptance .wpcf7-list-item-label,
.cmt-formulario-cf7 .wpcf7-acceptance label {
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 14px;
	line-height: 24px;
	color: var(--cmt-form-dark);
}

/* Botón de envío. */
.cmt-formulario-cf7 .wpcf7-submit,
.cmt-formulario-cf7 input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 8px 16px;
	background: var(--cmt-form-dark);
	border: none;
	border-radius: 8px;
	color: #ffffff;
	font-family: "Ubuntu Mono", ui-monospace, monospace;
	font-size: 14px;
	line-height: 24px;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='15' viewBox='0 0 19 15' fill='none'%3E%3Cpath d='M11.5 14.5L18.5 7.5L11.5 0.5M18.5 7.5L0.5 7.5' stroke='white' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 47px;
	transition: opacity 0.2s ease;
}

.cmt-formulario-cf7 .wpcf7-submit:hover {
	opacity: 0.9;
}

/* Mensajes de respuesta / validación de CF7. */
.cmt-formulario-cf7 .wpcf7-response-output {
	margin: 8px 0 0;
	padding: 12px 16px;
	border-radius: 8px;
	font-family: "Ubuntu", system-ui, sans-serif;
	font-size: 14px;
}

.cmt-formulario-cf7 .wpcf7-not-valid-tip {
	color: #b00020;
	font-family: "Ubuntu", system-ui, sans-serif;
	font-size: 12px;
	line-height: 16px;
}

.cmt-formulario-cf7 .wpcf7-not-valid {
	border-color: #b00020 !important;
}

/* Responsive: en móvil las filas de 2 columnas se apilan. */
@media (max-width: 640px) {
	.cmt-formulario-cf7 {
		--cmt-form-gap: 24px;
	}

	.cmt-formulario-cf7 .cmt-form__row--2col > .cmt-form__field {
		flex: 1 1 100%;
	}

	.cmt-formulario-cf7 .cmt-form__footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.cmt-formulario-cf7 .wpcf7-submit,
	.cmt-formulario-cf7 input[type="submit"] {
		width: 100%;
	}
}
